๐ฅ๐ Using Apollo with NodeJS
$ yarn
$ yarn start
- Query, aliases and fragments
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
}
query getCats($color:String) {
cats(color: $color) {
...CatFields
}
}
fragment CatFields on Cat {
name
color
}
- Mutation
mutation updateCatColor($id: Int!, $newColor: String!) {
updateCatColor(id: $id, newColor: $newColor) {
...catFields
}
}
fragment catFields on Cat {
id
name
color
}
๐ Awesome
Thanks goes to these wonderful people (emoji key):
Cuong Duy Nguyen ๐ป ๐ |
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT ยฉ cuongw