GraphQL API Server example using Koa, Apollo GraphQL Server & RethinkDB. 🚀
Notes:
Koa
requires NodeJS v7.6.0 or higher.
- Install dependencies via Yarn:
yarn
or using npm:
npm install
- Run RethinkDB Server
rethinkdb
- 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.
Use the GraphiQL GUI to add demo data. Enter to GraphiQL app at http://localhost:4020/graphiql
1. createAuthor:
mutation {
createAuthor(firstName: "Jose Luis", lastName: "Quintana")
}
2. createPost:
mutation {
createPost(title: "Queries and Mutations", authorId: "THE_AUTHOR_ID_HERE", votes: 1)
}
3. authors with posts query:
{
authors {
id
firstName
lastName
posts
}
}
Check out the GraphQL Schema.
Feel free to send some Pull request or issue.
MIT license
© 2017 José Luis Quintana