Skip to content

Commit

Permalink
fix(koa): fix koa middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Toth committed Mar 22, 2016
1 parent 1446f89 commit d969942
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/koa/koa.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export default function middleware({ graphiql = true, schema = required() } = {}
}

if (isGet(this) && query && query.includes('mutation')) {
this.status = 406;
this.body = 'GraphQL mutation only allowed in POST request.';
return this.body;
this.throw(406, 'GraphQL mutation only allowed in POST request.');
}

let parsedVariables = variables;
Expand All @@ -39,6 +37,6 @@ export default function middleware({ graphiql = true, schema = required() } = {}
return this.body;
}

return next;
return yield next;
};
}

0 comments on commit d969942

Please sign in to comment.