Very simple starter to understand the principle of GraphQL
- Clone this repo using
https://github.com/skorotkiewicz/node-graphql-starter.git
- Move to the appropriate directory:
cd gnode-graphql-starter
. - Run
npm install
to install dependencies. - Set
.env
file with your mongoURI. - Run
npm start
to see the GraphQL athttp://localhost:4000/graphql
.
Get data
{
getUsers {
id
name
email
password
}
getPosts {
id
title
description
}
}
Post data
mutation {
addPost(title: "Awasome Post!", description: "My new post <3") {
id
title
description
}
}