Posted On: Jul 27, 2022
AWS AppSync is a fully managed service that makes it easy to create and manage GraphQL and Pub/Sub APIs, allowing developers to securely access, manipulate, and combine data from one or more data sources via a single API endpoint. With GraphQL, developers write resolvers that fetch data from backend data sources such as Amazon DynamoDB, AWS Lambda, HTTP APIs, and more. To “resolve” a GraphQL query at run-time, AppSync evaluates the resolver code with the contextual information about the query (e.g.: the context). AppSync resolvers are written in the Velocity Template Language (VTL) and support flexible integrated utilities that allow developers to parse (e.g.: $util.parseJson), convert (e.g.: $util.toJson), generate (e.g.: $util.autoId and $util.autoUlid), and log data (e.g.: $util.log).
Today, we are releasing a new API command for AWS AppSync, EvaluateMappingTemplate, that allows developers to evaluate their resolver and function mapping templates. Previously, this functionality was only available in the AWS AppSync console. Developers can now access this functionality remotely by using the latest version of the AWS CLI, or by using the latest version of the AWS SDKs. Developers can leverage the EvaluateMappingTemplate command to write unit tests that verify the behavior of their resolvers in their favorite testing frameworks.