Skip to content

Instantly share code, notes, and snippets.

@joshbalfour
Created February 18, 2017 18:49
Show Gist options
  • Select an option

  • Save joshbalfour/3f8f017ce62a07a14b069871f021d448 to your computer and use it in GitHub Desktop.

Select an option

Save joshbalfour/3f8f017ce62a07a14b069871f021d448 to your computer and use it in GitHub Desktop.

Revisions

  1. joshbalfour created this gist Feb 18, 2017.
    16 changes: 16 additions & 0 deletions graphql-server-koa-one.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    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)
    },
    }