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
apollo-server-lambda example not working #2120
Comments
Apologies, I was invoking the function locally like a REST API. For anyone who encounters a similar problem, make sure to run : Furthermore, when you deploy you might run into an error message saying "missing authentication token", to solve this make sure your
Reason being is that API Gateway does not have access to your URL's stage and resources it is using. |
What I found confusing is that for me this "apollo-server-lambda" and the ".createHandler(...)" thing looked like it could really do lambda.invoke() calls with it but instead it assumes HTTP requests. In order to use lambda.invoke, like you would for example if you try to use apollo-link-lambda, you have to do something like this:
This way you make a HTTP event out of the raw lambda-invoke and return the body of the HTTP body as Payload back to the calling lambda.invoke. |
I don't think the above conversion approach will work. It still expects params like |
Intended Outcome: To deploy an apollo-server to AWS Lambda based off the example provided in the Apollo docs, here is my code below:
Operating System: Windows 10
Yarn Version: 1.1.0
Dependencies:
apollo-server-lambda: "^2.3.1"
Actual outcome: when I invoke the function locally or deploy it I get the following response:
How to reproduce: Run the following in your terminal:
then run
npm install
and after that installapollo-server-lambda
. Create agraphql.js
file and copy the code above into it.Then run:
serverless invoke local --function graphql
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: