Reputation: 972
Is there a way to get count of items returned by DynamoDB query from AppSync API?
DDB projection COUNT is not supported in AppSync, also I can't write something like ${context.result.items.count}
in response mapping.
Upvotes: 2
Views: 1117
Reputation: 972
Quick workaround (will not work for 1MB+ results): define scalar return value for the query in schema and use in response resolver $util.toJson($ctx.result.items.size())
Upvotes: 1