Posted On: Feb 23, 2022
AWS AppSync is a fully managed service that makes it easy to develop and manage GraphQL and Real-time APIs, making it easy to securely access, manipulate, and combine data from one or more data sources via a single API endpoint.
Now AppSync supports configuring custom HTTP headers in responses to GraphQL operations. With the new feature it is now possible to define directly in AppSync additional headers sent to clients upon a response to an API call. For instance, if there is a security requirement for a specific header to be present in the HTTP response, the GraphQL operation can be configured in AppSync to generate it.
AWS AppSync provides a set of built-in utility helpers which can be leveraged within a GraphQL resolver to simplify interactions with data sources or clients. You can now use the new resolver utility $util.http.addResponseHeaders() to configure additional headers in the response for a GraphQL API operation.
This feature is available in all AWS Regions where AppSync is available. For more details on the the new VTL utility helper to customize HTTP response headers, refer to the Resolver Mapping Template Utility Reference AppSync documentation.