Skip to content

cuongndc/graphql-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

graphql-nodejs

All Contributors

πŸ”«πŸ Building GraphQL for NodeJS

Quick start

Install dependencies

$ npm i

Run this app

$ npm start

Client

  1. Query, aliases and fragments

query

query getCat($catId: Int!) {
  cat(id: $catId) {
    id
    name
    color
  }
}
query getCatWithFagments($catId1: Int!, $catId2: Int!) {
  cat1: cat(id: $catId1) {
    ...catFields
  },
  cat2: cat(id: $catId2) {
    ...catFields
  }
}

fragment catFields on Cat {
  id
  name
  color
}
  1. Mutation

mutation

mutation updateCatColor($id: Int!, $newColor: String!) {
  updateCatColor(id: $id, newColor: $newColor) {
    ...catFields
  }
}

fragment catFields on Cat {
  id
  name
  color
}

πŸ™Œ Awesome

Contributors

Thanks goes to these wonderful people (emoji key):

Cuong Duy Nguyen
Cuong Duy Nguyen

πŸ’» πŸ“– ⚠️ πŸ‘€

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT Β© cuongw

About

πŸ”«πŸ Building GraphQL for NodeJS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published