aws / aws/aws-appsync-community
Mapping Template APPSYNC_JS runtime: Array.prototype.reduce silently stops at 1000th element
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
I've built a small CDK application to verify this behavior.
I would like to process over 1000 (very small) results from a DynamoDb query result set in an AppSync response mapping template. All of the results are delivered to the response mapping template, but calling `reduce()` on the resultset `items` array only processes the first 1000 results, silently returning the accumulator without processing the remaining results thereafter.
Why are we limited to 1000 items in the `reduce()` call? And if this is simply a shortcoming of the APPSYNC_JS runtime, why on earth wouldn't it be documented anywhere? [This page](https://docs.aws.amazon.com/appsync/latest/devguide/supported-features.html) claims that Array.prototype.reduce is supported, and says NOTHING about a limit of 1000 items. Can someone help me understand what is going on?
Contributor guide
Research direction
Start with the small CDK application described in the issue and reproduce the response mapping template behavior against a DynamoDB query result set larger than 1,000 items. Compare the observed reduce() behavior with the supported-features page; done means establishing whether the limit is an APPSYNC_JS runtime constraint and documenting the verified behavior or identifying the required correction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, graphql
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100