{"action":"created","issue":{"url":"https://api.github.com/repos/apollostack/graphql-server/issues/231","repository_url":"https://api.github.com/repos/apollostack/graphql-server","labels_url":"https://api.github.com/repos/apollostack/graphql-server/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/apollostack/graphql-server/issues/231/comments","events_url":"https://api.github.com/repos/apollostack/graphql-server/issues/231/events","html_url":"https://github.com/apollostack/graphql-server/issues/231","id":192981094,"number":231,"title":"graphql-server-koa not working","user":{"login":"AlexLeung","id":5025138,"avatar_url":"https://avatars.githubusercontent.com/u/5025138?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexLeung","html_url":"https://github.com/AlexLeung","followers_url":"https://api.github.com/users/AlexLeung/followers","following_url":"https://api.github.com/users/AlexLeung/following{/other_user}","gists_url":"https://api.github.com/users/AlexLeung/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexLeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexLeung/subscriptions","organizations_url":"https://api.github.com/users/AlexLeung/orgs","repos_url":"https://api.github.com/users/AlexLeung/repos","events_url":"https://api.github.com/users/AlexLeung/events{/privacy}","received_events_url":"https://api.github.com/users/AlexLeung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-12-01T22:31:42Z","updated_at":"2016-12-13T17:13:27Z","closed_at":null,"body":"Given the following code:\r\n```\r\nimport koa from 'koa';\r\nimport koaRouter from 'koa-router';\r\nimport { graphqlKoa, graphiqlKoa } from 'graphql-server-koa';\r\nimport koaBody from 'koa-body';\r\nimport schema from './schema';\r\n\r\nconst app = new koa();\r\nconst router = new koaRouter();\r\nconst PORT = 3010;\r\napp.use(koaBody());\r\nrouter.post('/graphql', graphqlKoa({schema}));\r\nrouter.get('/graphiql', graphiqlKoa({ endpointURL: '/graphql', query: '' }));\r\napp.use(router.routes());\r\napp.use(router.allowedMethods());\r\napp.listen(PORT);\r\n````\r\n\r\nWhen trying a `POST` request to /graphql, I get the following error \r\n``` \r\nTypeError: Cannot read property 'body' of undefined\r\n      at C:\\Users\\Alex\\...\\node_modules\\graphql-server-koa\\src\\koaApollo.ts:38:21\r\n```\r\n\r\nWhen trying a `GET` request to /graphiql, I get the following error\r\n```\r\nTypeError: Cannot read property 'query' of undefined\r\n      at Object.<anonymous> (C:\\Users\\Alex\\...\\node_modules\\graphql-server-koa\\src\\koaApollo.ts:119:26)\r\n```\r\nThis error occurs with both the `koa` and `koa@2` packages."},"comment":{"url":"https://api.github.com/repos/apollostack/graphql-server/issues/comments/266800005","html_url":"https://github.com/apollostack/graphql-server/issues/231#issuecomment-266800005","issue_url":"https://api.github.com/repos/apollostack/graphql-server/issues/231","id":266800005,"user":{"login":"helfer","id":6569980,"avatar_url":"https://avatars.githubusercontent.com/u/6569980?v=3","gravatar_id":"","url":"https://api.github.com/users/helfer","html_url":"https://github.com/helfer","followers_url":"https://api.github.com/users/helfer/followers","following_url":"https://api.github.com/users/helfer/following{/other_user}","gists_url":"https://api.github.com/users/helfer/gists{/gist_id}","starred_url":"https://api.github.com/users/helfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helfer/subscriptions","organizations_url":"https://api.github.com/users/helfer/orgs","repos_url":"https://api.github.com/users/helfer/repos","events_url":"https://api.github.com/users/helfer/events{/privacy}","received_events_url":"https://api.github.com/users/helfer/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T17:13:27Z","updated_at":"2016-12-13T17:13:27Z","body":"@AlexLeung can you check if @sweetcharity 's suggestion fixes your issue?"}}
{"actor":{"display_login":"helfer"}}