Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 659 Bytes

README.md

File metadata and controls

48 lines (38 loc) · 659 Bytes

nodejs.graphql.basic.template

⚗ Basic template of a NodeJS application with GraphQL

Run mongoDB docker container

docker run --name mongodb -d -p 27017:27017 mongo

Query examples

Getting a user by id

query {
  user(id: "61fff210196972b7cc1d3789") {
    name
    email
  }
}

Getting a list of users

query {
  users {
    id
    name
    email
  }
}

Mutations examples

Creating a user and returning the user's id

mutation {
  createUser(name: "Diogo", email: "[email protected]") {
    id
  }
}