Skip to content

Instantly share code, notes, and snippets.

@joshbalfour
Created February 18, 2017 18:49
Show Gist options
  • Save joshbalfour/3f8f017ce62a07a14b069871f021d448 to your computer and use it in GitHub Desktop.
Save joshbalfour/3f8f017ce62a07a14b069871f021d448 to your computer and use it in GitHub Desktop.
Koa 1.x wrapper for graphql-server-koa
const { graphqlKoa, graphiqlKoa } = require('graphql-server-koa')
module.exports = {
graphqlKoa: options => function *(){
const context = this
return yield graphqlKoa(Object.assign({}, options, {
context
}))(context)
},
graphiqlKoa: options => function (){
const context = this
graphiqlKoa(Object.assign({}, options, {
context
}))(context)
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment