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

apollo-server-lambda "local" testing #738

Closed
dbrrt opened this issue Dec 28, 2017 · 5 comments
Closed

apollo-server-lambda "local" testing #738

dbrrt opened this issue Dec 28, 2017 · 5 comments

Comments

@dbrrt
Copy link

dbrrt commented Dec 28, 2017

It'd be nice to have the ability to test locally apollo-server-lambda in addition of the online workflow with S3 (with a library such as lambda-local); some users might want to migrate from apollo-server-{something} to apollo-server-lambda and the conversion should be smoother if it could be done locally.

@dhm116
Copy link

dhm116 commented May 15, 2018

I'm not sure if you've found a solution or not, but you should be able to do local development and testing with apollo-server-lambda via the serverless-offline library.

@n1ru4l
Copy link
Contributor

n1ru4l commented May 15, 2018

@dbrrt I am using apollo-server-lamba for local server tests. All you have to do is import your lambda handler in a test and execute it with a payload.

If you want a local "dev server" environment serverless-offline is working fine for me too (like @dhm116
said)!

@abernix
Copy link
Member

abernix commented Sep 24, 2018

As stated by others above, testing apollo-server-lamdba locally can be accomplished using serverless. Since creating a reliably environment that simulates AWS Lambda can be a bit complicated and specialized, it’s probably best that we rely on libarires that specialize in doing exactly that.

Thanks for this suggestion originally!

@saidybarry
Copy link

@dhm116
Hi, I recently deployed my Apollo Server onto AWS with the help of apollo-server-lambda,
But I want to run the server locally for development testing I did try out the serverless-offline it's running fine but when I hit the endpoint is shows "Cannot GET null".

Do you have any idea what I am missing?

@dhm116
Copy link

dhm116 commented Sep 9, 2022

@saidybarry I wish I could be of more help, but I don't have a quick answer for the problem you're running into 😞

It looks like apollo-server-lambda is using vendia/serverless-express to provide the "lambda" feature and I happened to notice that their sails-example project happened to mention a rather similar issue as to the one you had described:

This example is a WIP which works locally by simulating a Lambda handler invocation, however, in production we're receiving 404 'Cannot GET /'.

It's possible the problem you're running into has something to do with the way vendia/serverless-express works, or it's possible it could be caused by how you have your app/configuration/environment set up 🤷

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 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

5 participants