ApolloApi construct is a higher level CDK construct that makes it easy to create an Apollo Server with AWS Lambda. It provides a simple way to define the GraphQL handler route in your API. And allows you to configure the specific Lambda function if necessary. It also allows you to configure authorization, custom domains, etc.
ApolloApi construct internally extends the
And here is an example of a simple handler defined in
You can configure the Lambda function used for the Apollo Server.
You can also configure the API with a custom domain, access log format, CORS settings, and authorization settings. For more detailed examples refer to the
Use a CSV format instead of default JSON format.
Override the default behavior of allowing all methods, and only allow the GET method.
You can secure your APIs (and other AWS resources) by setting the
AWS_IAM and using the
For more examples, refer to the
Refer to the properties in the
Refer to the methods in the
Takes the following construct props in addition to the
routes option cannot be set in
The function definition used to create the function for GraphQL handler.