elstr / GraphQL-Examples

:beginner: Basic GraphQL examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL Examples

These are some really basic GraphQL examples

Getting started

You need node to exec the examples.
To run the examples, exec in the terminal node filename
Example: node /initial/index.js

For all the examples, except the ones in initial, exec in the terminal node filename and open http://localhost:3000/graphql

Order in chaos

  1. Start in /initial/index.js
  2. How to work with collections /initial/video-collection.js
  3. Check how to use graphql and express express/use-express-graphql.js
  4. How to write a schema with js express/js-graphql-schema.js
  5. Query videos by specific ID using args in query/query-by-id.js
  6. How to define required args with GraphQLNonNull in query/non-null.js
  7. Return a collection of videos with GraphQLList in query/resolve-all-videos.js
  8. Mutations! Add a new video to the collection mutations/mutation.js
  9. Input types, organize args in mutations: mutations/input-type.js

About

:beginner: Basic GraphQL examples


Languages

Language:JavaScript 100.0%