Skip to content

arjanc/graphql-example-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

to setup this project run the following command in your terminal when you are IN your project folder.

npm install

development

to run the server in watch mode run:

npm run dev

and in another terminal window

npm run json:server

use

now the nodejs server is running AND the json db is up. Browse to: http://localhost:4000/graphql

The json db can be access by: http://localhost:3000/instances or http://localhost:3000/instances/23 or http://localhost:3000/metrics

GraphQL

inside the GraphiQL you can type:

{
  instances(offset:0, limit:0){
    id
    name
  }
}

and you'll get

{
  "data": {
    "instances": [
      {
        "id": "23",
        "name": "Application ABC"
      },
      {
        "id": "47",
        "name": "Application DEF"
      },
      {
        "id": "41",
        "name": "Application GHI"
      }
    ]
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published