Check and run the code created by Lee Byron @leeb:
$ git clone https://github.com/aaronplanell/graphql-starwars-demo.git
$ cd graphql-starwars-demo
$ npm install
$ npm start
If you need to modify the code, remember compile it before before run it:
$ npm run-script compile
$ npm start
- Return one field:
- Return one field, filtering by the episode:
- Return various fields and a its list of friends (nested by characterInterface):
- The same, but returning the list of friends of every friend. An example of how GraphQL can nest queries.
- Return one field filtering by ID:
- The same, but with an alias:
- The same (using aliases), but with two persons:
- Adding their planet:
- With 'fragments'. It avoids to rewrite name of fields twice:
Thanks to:
- Lee Byron @leeb.
Mail: [email protected]