Home

Awesome

Koa-GraphQL-RethinkDB

GraphQL API Server example using Koa, Apollo GraphQL Server & RethinkDB. :rocket:

Notes:

Usage

  1. Install dependencies via Yarn:
yarn

or using npm:

npm install
  1. Run RethinkDB Server
rethinkdb
  1. Start GraphQL API Server
yarn start

Optional: Then the server is running you could run the Vue 2 + Typescript client example to consuming this GraphQL API.

GraphiQL

koa-graphql-rethinkdb GraphiQL

Use the GraphiQL GUI to add demo data. Enter to GraphiQL app at http://localhost:4020/graphiql

Mutations

1. createAuthor:

mutation {
  createAuthor(firstName: "Jose Luis", lastName: "Quintana")
}

2. createPost:

mutation {
  createPost(title: "Queries and Mutations", authorId: "THE_AUTHOR_ID_HERE", votes: 1)
}

Queries

3. authors with posts query:

{
  authors {
    id
    firstName
    lastName
    posts
  }
}

API

Check out the GraphQL Schema.

Contributions

Feel free to send some Pull request or issue.

License

MIT license

© 2017 José Luis Quintana