Serverless GraphQL Implementation
Create a serverless GraphQL implementation ready production, including CI/CD.
Developers should be able to just clone, add AWS credentials, and deploy away using GitHub Actions.
Implementation details
Use apollo-server-lambda npm package to serve the Apollo GraphQL through AWS Lambda.
It exposes the API to the Apollo implementation.
GraphQL playground
The playground provides a GUI for making GraphQL requests. E.g. GitHub’s Playground
When running locally, the playground is enabled by default. However, if you wish to have the playground available when deploying to AWS infrastructure, there is an additional step to take.
Instruct the Lambda, when the requested HTTP method is GET
, to server playground UI:
CORS
Modify the AWS SAM template to allow all CORS.