The application is a simple example of users and roles
Application requires Node.js v8+ to run and json-server
Install the dependencies and devDependencies and start the server.
$ git clone --recursive [email protected]:brunoflegler/graphql-pt01.git
$ cd graphql-pt01
Installation is done using the npm install command:
$ npm install
Or run Yarn install command:
$ yarn install
First step:
$ json-server --watch ./data/storage.json
Second step:
$ yarn dev or npm dev
//Server ready at http://localhost:4000/
First query using graphql
query {
users {
name
}
}
Response:
{
"data": {
"users": [
{
"name": "Ana Torre"
},
{
"name": "Gabriel Costa"
},
{
"name": "Flavia Lins"
},
{
"name": "Carlos Marques"
},
{
"name": "Silvia Souza"
},
{
"name": "Marcia Silva"
}
]
}
}