-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Can't set headers after they are sent. #557
Comments
@timsuchanek maybe this would help apollographql/apollo-server@c22bb37 |
I am also getting this error. |
@adamjking3 @timsuchanek |
In Playground Express Middleware https://github.com/graphcool/graphql-playground/blob/a5a59707e59dee92576ce91b213f8655bce28b2a/packages/graphql-playground-middleware-express/src/index.ts#L32 As a workaround you can mount middleware like this: |
Same problem with the latest new ApolloServer({ typeDefs, Resolvers }).applyMiddleware({ app })
app.use('/graphql', () => {}) |
My Solution was
|
@xelaz Your fix helped me, but fwiw you only need expressPlayground on app.get('/graphql', expressPlayground({ endpoint: '/graphql' }), function(req, res) {
res.end('');
}); |
Also, here's hoping my fix gets merged |
This issue pertains to the following package(s):
What OS and OS version are you experiencing the issue(s) on?
Ubuntu 16.04
What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?
What is the expected behavior?
Should show the playground like the screenshot in document when accessed via browser
What is the actual behavior?
What steps may we take to reproduce the behavior?
I tried to follow this, I don't know what I missed. https://github.com/graphcool/graphql-playground/blob/master/packages/graphql-playground-middleware-express/examples/basic/index.js#L27
HERE IS MY CODE
The text was updated successfully, but these errors were encountered: