Open michaelCaleyWhaley opened 1 year ago
I considered adding a local testing suite to this library, but after much consideration decided it would be out-of-scope. There are other tools and libraries for developing locally with lambda. My personal recommendation is to unit test your middleware, and integration test it with a real lambda deployment. If you're using infrastructure as code like the cdk, this should be as easy as a cdk deploy and a cdk destroy in the test environment.
@BlenderDude when i try to run locally with serverless invoke local --function, i get a { "statusCode": 400, "body": "Cannot read properties of undefined (reading 'http')" }
any solution for that?
Im getting the same problem @DarlonHenrique
I was able to fix this isssue by converting my events to API Gateway V2 https://www.serverless.com/framework/docs/providers/aws/events/http-api
Changed to this
Hi
It'd be really helpful for me if there could be a local testing example in the docs. Currently using a different entry point for the local and hosted version of my subgraph Hosted
import { startServerAndCreateLambdaHandler } from '@as-integrations/aws-lambda';
Local
import { startStandaloneServer } from '@apollo/server/standalone';
This is making it difficult to test things such as middleware