-
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
Incorrect playground endpoint in apollo-server-lambda #4687
Comments
I'm having the same issue. |
Is this related to #4891/#4892? That's another issue about path handling in Lambda. Oddly that one suggests that it only works without custom domains, whereas it sounds like you're saying playground only works with custom domains? I'm happy to merge a fix and have #4892 already lined up for my next PRs-outside-my-current-knowledge-learning-and-merging day); maybe #4892 needs to be expanded to fix this too? |
I did some digging and more testing... The root cause might lie in For now I have set up my local tl;dr. I think this issue can be closed with a reference to the previously mentioned bug report for |
I didn't use the Serverless framework (I used SAM/CloudFormation) so unsure how this could be related? @glasser without looking into it in too much detail, I don't think these issues are related but unsure as I've not played around with non-default base path mapping. |
While it's possible that the original author of #1527 (@stubailo) or its reviewer (@jbaxleyiii) might choose to chime in, neither of them work at Apollo any more, and it's quite likely that the world of Lambda has changed a lot in the past 3 years anyway. I've merged the other semi-related PR (#4892) but I'm not sure I understand Lambda well enough to get what's going on here. That said:
|
Apollo Server 4 replaces a hard-coded set of web framework integrations with a simple stable API for building integrations. As part of this, the core project no longer directly supports a Lambda integration. Check out the (In addition, we changed the support for Playground only to supporting multiple landing pages in AS3 without parsing paths, and AS4 doesn't parse paths at all.) |
When deploying
apollo-server-lambda
as per the readme, the url used by the playground is wrong when using the API gateway execute-api domain.I believe this is caused by the change made in #1527.
This example payload for this type of event includes a url of
https://70ixmpl4fl.execute-api.ca-central-1.amazonaws.com/Prod/
, withevent.requestContext.path
of/Prod/
(the stage name). Theevent.path
is/
. Clearly in this case usingevent.path
would be incorrect.When using an API gateway with a custom domain, the values for
event.requestContext.path
andevent.path
are identical.I'd be happy to submit a PR to fix this, but it would be good to understand why this was changed in the first place first as I don't want to break anything.
The text was updated successfully, but these errors were encountered: