Posted On: Aug 31, 2023

AWS AppSync is a managed service that makes it easier to build scalable APIs that connect applications to data. With AppSync, API developers can write resolvers to define the business logic that connects their AppSync GraphQL and Pub/Sub APIs to data. Developers use AppSync to interact with data sources like Amazon DynamoDB tables by writing their JavaScript resolvers that are executed on the AppSync JavaScript (APPSYNC_JS) runtime. Now, AppSync provides new functions to interact with DynamoDB tables that simplifies the developer experience in JavaScript resolvers.

AppSync provides a new module available in the "@aws-appsync/utils/dynamodb" package that developers can use to build DynamoDB requests. Developers can use functions like "scan", "get", "create", "update", "sync" and "remove" to build their requests. They can directly pass their JavaScript objects to the functions that automatically handle conversion between JavaScript types and DynamoDB types. With the utilities, developers can easily implement full or partial item updates, specify conditions, and write filters for scan and queries. When working locally, the functions are fully typed, allowing developers to use type validation with TypeScript and leverage autocompletion in their code editors.

AppSync new utilities for DynamoDB are now available in all AWS regions supported by AppSync. For more details, refer to our blog post, the JavaScript resolvers overview, and the Built-in modules documentation.