mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 02:01:40 -05:00
Use body parser only for post requests in koa
This commit is contained in:
parent
50866dc5ba
commit
943120269c
1 changed files with 1 additions and 3 deletions
|
@ -122,9 +122,7 @@ const router = new koaRouter();
|
|||
const PORT = 3000;
|
||||
|
||||
// koaBody is needed just for POST.
|
||||
app.use(koaBody());
|
||||
|
||||
router.post('/graphql', graphqlKoa({ schema: myGraphQLSchema }));
|
||||
router.post('/graphql', koaBody(), graphqlKoa({ schema: myGraphQLSchema }));
|
||||
router.get('/graphql', graphqlKoa({ schema: myGraphQLSchema }));
|
||||
|
||||
app.use(router.routes());
|
||||
|
|
Loading…
Add table
Reference in a new issue