From d816272166087abdc406b5015bc04a0ac25543c3 Mon Sep 17 00:00:00 2001 From: I Date: Tue, 26 Jul 2016 20:58:41 +0200 Subject: [PATCH] fix(context): fix graphql parameter order --- src/express/express.js | 2 +- src/hapi/hapi.js | 2 +- src/koa/koa.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/express/express.js b/src/express/express.js index da0e13c..a213d99 100644 --- a/src/express/express.js +++ b/src/express/express.js @@ -38,7 +38,7 @@ export default function middleware({ graphiql = true, context = {}, schema = req // ignore } - return graphql(schema, query, context, request, parsedVariables) + return graphql(schema, query, { request }, context, parsedVariables) .then((result) => { if (result.errors) { const message = result.errors.map((error) => error.message).join('\n'); diff --git a/src/hapi/hapi.js b/src/hapi/hapi.js index 1b4c16a..a6304ed 100644 --- a/src/hapi/hapi.js +++ b/src/hapi/hapi.js @@ -36,7 +36,7 @@ const plugin = { // ignore } - return graphql(schema, query, context, request, parsedVariables) + return graphql(schema, query, { request }, context, parsedVariables) .then((result) => { if (result.errors) { const message = result.errors.map((error) => error.message).join('\n'); diff --git a/src/koa/koa.js b/src/koa/koa.js index 115c3e5..3f395fa 100644 --- a/src/koa/koa.js +++ b/src/koa/koa.js @@ -33,7 +33,7 @@ export default function middleware({ graphiql = true, context = {}, schema = req // ignore } - this.body = yield graphql(schema, query, context, this, parsedVariables); + this.body = yield graphql(schema, query, { request: this.request }, context, parsedVariables); return this.body; }