Posted On: Nov 17, 2022

Amazon AppSync, a service that makes it easier to build scalable APIs that connect applications to data, just got simpler. API developers can now use JavaScript to define the business logic that connects their AppSync GraphQL and Pub/Sub APIs to data, and leverage two new libraries and a new service API command to simplify local development and testing.

With AppSync, developers write functions contained in Pipeline Resolvers to connect the types, fields, or operations defined in a GraphQL schema to their data sources. Now, when creating Pipeline Resolvers and Functions, developers can define their data access business logic in JavaScript, or the Velocity Template Language (VTL), and can mix Functions written in JavaScript, or VTL inside a single Pipeline Resolver.

To simplify local development of Resolvers, AppSync is also releasing two new NPM libraries: @aws-appsync/eslint-plugin, to catch and fix problems quickly during development; and @aws-appsync/utils to provide type validation and autocompletion in code editors. Finally, to make it easier to test and debug code, AppSync is releasing a new API command (that can be called from the Amazon CLI or Amazon SDK), evaluate-code, that helps developers unit test their resolvers and functions code from their local environment.

The feature is now available in Amazon Web Services China (Beijing) Region, operated by Sinnet and Amazon Web Services China (Ningxia) Region, operated by NWCD. For more details about Amazon AppSync, please visit the Amazon AppSync Developer Guide.