An open API service indexing awesome lists of open source software.

https://github.com/cuongndc9/apollo-nodejs

🔥💚 Using Apollo with NodeJS.
https://github.com/cuongndc9/apollo-nodejs

103cuong apollo apollo-nodejs apollo-server apollo-server-express graphql graphql-server mutation

Last synced: 3 months ago
JSON representation

🔥💚 Using Apollo with NodeJS.

Awesome Lists containing this project

README

          

goodbye coding 👋
# apollo-nodejs

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg)](#contributors)

🔥💚 Using Apollo with NodeJS

## Quick start

### Install dependencies

```sh
$ yarn
```

### Run this app

```sh
$ yarn start
```

### Client

1. Query, aliases and fragments

![query1](./images/query1.png)

```
query getCat($catId: Int!) {
cat(id: $catId) {
id
name
color
}
}
```

![query2](./images/query2.png)

```
query getCatWithFagments($catId1: Int!, $catId2: Int!) {
cat1: cat(id: $catId1) {
...catFields
},
cat2: cat(id: $catId2) {
...catFields
}
}

fragment catFields on Cat {
id
name
color
}
```

![query3](./images/query3.png)

```
query getCats($color:String) {
cats(color: $color) {
...CatFields
}
}

fragment CatFields on Cat {
name
color
}
```

2. Mutation

![mutation](./images/mutation.png)

```
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](https://allcontributors.org/docs/en/emoji-key)):

Cuong Duy Nguyen
Cuong Duy Nguyen

💻 📖 ⚠️ 👀

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## License

MIT © [Cuong Nguyen](https://www.linkedin.com/in/cuong9/)

> "The only way to do great work is to love what you do." - Steve Jobs