Running GraphQL playground in AWS Lambda with the help of TypeScript and Serverless.
- Install dependencies and run the boilerplate query:
npm install
npm start
-
You can now edit the
.graphql-data.json
file to adjust the query or mutation. -
When ready just re-run the
npm start
command to test out the Lambda function locally.
- Run deployment to AWS:
npm run deploy
-
Navigate to the GraphQL Playground available at https://RANDOM-ID.execute-api.eu-west-1.amazonaws.com/dev/graphql.
-
Run clean up the AWS application stack run:
npm run remove
You can run npm run invoke-watch
to have the Serverless framwork monitor for file changes and re-run the mock Lambda environment.
Thanks to the help of this article and repository you can debug the function in VS Code: