Skip to content
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

Lambda GraphiQL errors when event.queryStringParameters is null #504

Closed
thevtm opened this issue Aug 13, 2017 · 6 comments
Closed

Lambda GraphiQL errors when event.queryStringParameters is null #504

thevtm opened this issue Aug 13, 2017 · 6 comments

Comments

@thevtm
Copy link

thevtm commented Aug 13, 2017

I'm running a Lambda GraphQL Server using AWS Lambda and API Gateway.
The GraphiQL is configured as a Lambda Proxy integration.

Intended outcome
Get the regular GraphiQL interface when I access https://myapi.com/graphiql.

Actual outcome
Cannot read property 'query' of null

How to reproduce the issue

import { graphiqlLambda } from "apollo-server-lambda";

export default graphiqlLambda({
  endpointURL: "/beta",
});

GraphiQL method configured as a Lambda Proxy integration.

Workaround
https://myapi.com/graphiql?foo=42 works just fine.

@thevtm thevtm changed the title Lambda GraphiQL errors when event.queryStringParameters is null Lambda GraphiQL errors when event.queryStringParameters is null Aug 13, 2017
@alanhoff
Copy link

I was able to reproduce it and the workaround worked.

@nenti
Copy link

nenti commented Aug 23, 2017

Is there a workaround to fix this on the server rather than by sending the client a different url?

@harshabonthu
Copy link

If I downgrade graphql-server-lambda to 0.8.5, then it works and any version above that its broken.

@diit
Copy link
Contributor

diit commented Aug 24, 2017

Ran into this as well, a good solution would be to change this:

https://github.com/apollographql/apollo-server/blob/master/packages/apollo-server-lambda/src/lambdaApollo.ts#L87

to:

const query = event.queryStringParameters || {};

@stubailo
Copy link
Contributor

I think #512 fixes this issue!

@abernix
Copy link
Member

abernix commented Oct 18, 2018

Closing as I suspect this is fixed, but please do ping back or open a new issue if this is still occurring on the latest versions of Apollo Server 2.x!

Thanks for reporting this originally!

@abernix abernix closed this as completed Oct 18, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants