Skip to content

elstr/GraphQL-Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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