Git Product home page Git Product logo

pm-service-graphql's Introduction

About project

GraphQL Server

  • Set up
  • Goal

Getting started

Clone the project, and once inside the folder, run:

    npm start

Supported Mutations

Find out more about supported operations in the service by exploring the graphiql interface. Vist the graphiql endpt: http://localhost:4000/graphiql

Or see below:

I. Create new properties

mutation CreateProperty{
  addProperty(
    name: "Creston Hill Manor", 
    description: "Charming Creston-Kenilworth Bungalow on .11 Acre Lot. Spacious living room with fireplace, hardwoods, rustic brick surround. Nook with built-ins, coved archways. Modern, open kitchen with granite counters, pantry. Dining room with wood floors."
    tags: ["personal"]
    thumbImage: ["https://placeimg.com/350/200/arch"]
    mainImage: ["https://placeimg.com/1080/500/arch"]
    location: {
      streetAddress: "4423 SE 30th Ave, Portland, OR 97202"
        coordinates: [-122.634882, 45.491029]
    }
  ) {
    name
  }
}

Support Queries

Again, find out more about support operations in the service by cloning the project and exploring the graphiql endpt. But, here's a summary:

I. Get Properties

query getProperties {
  properties {
    name
    tags
    slug
    thumbImage
    mainImage
  }
}

Inside the properties object, specify the fields desired in the response. Fields available are:

id
name
description
location
slug
thumbImage
mainImage
tags

Query response will return data in the following format:

{
  "data": {
    "properties": [
      {
        "name": "Elm's Hollow",
        "tags": [
          "personal"
        ],
        "slug": "elms-hollow",
        "thumbImage": [
          "https://placeimg.com/350/200/arch"
        ],
        "mainImage": [
          "https://placeimg.com/1080/500/arch"
        ]
      },
      {
        "name": "Colonial Split",
        "tags": [
          "rental"
        ],
        "slug": "colonial-split",
        "thumbImage": [
          "https://placeimg.com/350/200/arch"
        ],
        "mainImage": [
          "https://placeimg.com/1080/500/arch"
        ]
      },
      {
        "name": "Creston Hill Manor",
        "tags": [
          "personal"
        ],
        "slug": "creston-hill-manor",
        "thumbImage": [
          "https://placeimg.com/350/200/nature/grayscale/1"
        ],
        "mainImage": [
          "https://placeimg.com/1080/500/arch"
        ]
      }
    ]
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.