Front-End Web & Mobile

AWS AppSync now supports projection expressions in DynamoDB resolvers

AWS AppSync is a fully managed service that makes it easy to create and manage GraphQL and real-time APIs. Now, AWS AppSync API developers who use DynamoDB data sources can define projection expressions in their DynamoDB resolvers. Before today, DynamoDB resolvers for AWS AppSync APIs would retrieve all the attributes from a DynamoDB table. Now, you can retrieve only the attributes that you need.

Define a projection expression with a DynamoDB resolver to specify the names of only the attributes that you want to retrieve, instead of all attributes. In response, DynamoDB returns only those specific attributes. Using projection expressions to simplify your resolver’s execution can help reduce your network costs, improve your GraphQL query performance, and reduce request token consumption. You can also use projection expressions to pass specific attributes, in case your DynamoDB table has attribute-level permissions to deny returning all attributes.

This feature is available in all AWS Regions where AWS AppSync is available.

For more information about DynamoDB resolvers, along with examples, see the following in the AWS AppSync Developer Guide: