Maintained with ☕️ by
IcePanel logo

AWS AppSync now supports environment variables in GraphQL resolvers and functions

Share

Services

AWS AppSync is a managed service that connects applications to data. With AppSync, API developers can write resolvers and functions in JavaScript to define the business logic that connects their AppSync GraphQL and Pub/Sub APIs to data. AppSync now allows developers to define environment variables for their GraphQL API, making it easier to configure their code’s behavior without having to change their resolver or function implementation. Developers can define key-value pairs on their GraphQL API at configuration time, and access them in their resolvers and functions at runtime when resolving GraphQL requests. Environment variables are available in JavaScript and VTL code. Developers can define environment variables on GraphQL APIs at creation time or in an update from the AWS AppSync console or with AWS CloudFormation, AWS Cloud Development Kit (CDK), the AWS CLI and the AWS SDKs. This feature is available in all [AWS regions](https://docs.aws.amazon.com/general/latest/gr/appsync.html) supported by AppSync. For more details, refer to the [AppSync documentation](https://docs.aws.amazon.com/appsync/latest/devguide/environmental-variables.html).