-
Notifications
You must be signed in to change notification settings - Fork 2k
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
graphql-server-lambda - graphiql not compatible with nodejs8.10 runtime #1042
Comments
We're running graphiql with the nodejs8.10 runtime without any issues that we're aware of - are you able to provide any snippets demonstrating the issue? Aside from the serverless configuration, this is all we needed to enable graphiql to work with serverless and serverless-offline: // Avoid using async/promises until apollo-server-lambda/apollo-server-core
// are updated to support async/await
exports.graphiqlHandler = (event, context, callback) => {
const graphqlHandler = graphiqlLambda({ endpointURL: '/graphql' });
return graphqlHandler(event, context, callback);
}; |
My failing handler looks like this. Node6 workd node8 fails. Interesting. return server.graphiqlLambda({
endpointURL: GRAPHQL_ENDPOINT,
passHeader: event.queryStringParameters && event.queryStringParameters.auth,
})(event, context, callback) |
Yeah, that looks very similar....as I mentioned, we're using service: example
provider:
name: aws
runtime: nodejs8.10
region: us-west-2
profile: user-profile
stage: ${self:custom.stage}
endpointType: REGIONAL
package:
individually: true
excludeDevDependencies: true
plugins:
- serverless-webpack
- serverless-mocha-plugin
- serverless-offline
custom:
# Plugin Config
webpack:
includeModules:
forceExclude:
- aws-sdk
packager: npm
serverless-offline:
port: 4000
functions:
graphql:
name: ${self:provider.stage}-graphql
description: GraphQL Handler (GET/POST /graphql)
handler: graphql/index.handler
warmup: production
events:
- http:
path: graphql
method: post
- http:
path: graphql
method: get
graphiql:
name: ${self:provider.stage}-graphiql
description: GraphiQL Handler (GET /graphqli)
handler: graphql/index.graphiqlHandler
events:
- http:
path: graphiql
method: get |
I was using Node 8.11 in Lambda with this configutation, and worked perfectly module.exports.graphiQL = server.graphiqlLambda({
endpointURL: '/graphql',
}) functions
graphiql:
handler: handler.graphiQL
events:
http:
path: graphiql
method: get |
I'm going to close this, since it seems we've figured out the issue and #1125 is out! |
Is it possible to use graphiql with apollo-server2 or only playground? I get TypeError: server.graphiqlLambda is not a function |
graphiql handler is failing with no error message thrown when changing lambda runtime to nodejs8.10
The text was updated successfully, but these errors were encountered: