Skip to content

Commit 925040e

Browse files
committed
docs: clean up no-aggregate processing section
1 parent 06480d4 commit 925040e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docs/core/event_handler/appsync.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,17 @@ stateDiagram-v2
428428

429429
<em><center>Batch resolvers: reducing Lambda invokes but fetching data N times (similar to single resolver).</center></em>
430430

431-
You can process each item in the batch individually, and we can handle exceptions for you. However, it's important to note that utilizing this method may increase the execution time of your Lambda function.
431+
In rare scenarios, you might want to process each item individually, trading ease of use for increased latency as you handle one batch item at a time.
432432

433-
???+ tip
434-
For better error handling, you may need to configure response mapping templates and specify error keys. Explore more on returning individual errors [here](https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html#advanced-use-case-batching){target="_blank"}.
433+
You can toggle `aggregate` parameter in `@batch_resolver` parameter for your resolver function to be called N times.
434+
435+
!!! note "This does not resolve the N+1 problem, but shifts it to the Lambda runtime."
436+
437+
In this mode, we will:
438+
439+
1. Aggregate each response we receive from your function in the exact order it receives
440+
2. Gracefully handle errors by adding `None` in the final response for each batch item that failed processing
441+
* You can customize `nul` or error responses back to the client in the [AppSync resolver mapping templates](https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html#returning-individual-errors){target="_blank"}
435442

436443
=== "getting_started_with_batch_resolver_individual.py"
437444
```python hl_lines="3 7 17"

0 commit comments

Comments
 (0)