Amazon Web Services AppSync now supports projection expressions in DynamoDB resolvers

by Michael Liendo | on

Amazon Web Services AppSync is a fully managed service that makes it easy to create and manage GraphQL and real-time APIs. Now, Amazon Web Services AppSync API developers who use DynamoDB data sources can define projection expressions in their DynamoDB resolvers. Before today, DynamoDB resolvers for Amazon Web Services 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 Amazon Web Services Regions where Amazon Web Services AppSync is available.

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

  • Tutorial: DynamoDB resolvers
  • Resolver mapping template reference for DynamoDB
  • Tutorial: DynamoDB JavaScript resolvers
  • JavaScript resolver function reference for DynamoDB