Created
February 18, 2017 18:49
-
-
Save joshbalfour/3f8f017ce62a07a14b069871f021d448 to your computer and use it in GitHub Desktop.
Koa 1.x wrapper for graphql-server-koa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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