You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/event_handler/appsync_events.md
+105-1Lines changed: 105 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -445,12 +445,15 @@ When processing batch of items with `OnPublishAggregate()` and `OnPublishAggrega
445
445
}
446
446
```
447
447
448
-
#### Rejecting the entire request
448
+
#### Authorization control
449
449
450
450
??? warning "Raising `UnauthorizedException` will cause the Lambda invocation to fail."
451
451
452
452
You can also reject the entire payload by raising an `UnauthorizedException`. This prevents Powertools for AWS from processing any messages and causes the Lambda invocation to fail, returning an error to AppSync.
453
453
454
+
-**When working with publish events** Powertools for AWS will stop processing messages and subscribers will not receive any message.
455
+
-**When working with subscribe events** the subscription won't be established.
456
+
454
457
=== "Rejecting the entire request"
455
458
456
459
```csharp
@@ -474,6 +477,107 @@ You can access to the original Lambda event or context for additional informatio
474
477
});
475
478
```
476
479
480
+
## Event Handler workflow
481
+
482
+
#### Working with single items
483
+
484
+
<center>
485
+
```mermaid
486
+
sequenceDiagram
487
+
participant Client
488
+
participant AppSync
489
+
participant Lambda
490
+
participant EventHandler
491
+
note over Client,EventHandler: Individual Event Processing (aggregate=False)
492
+
Client->>+AppSync: Send multiple events to channel
493
+
AppSync->>+Lambda: Invoke Lambda with batch of events
494
+
Lambda->>+EventHandler: Process events with aggregate=False
495
+
loop For each event in batch
496
+
EventHandler->>EventHandler: Process individual event
497
+
end
498
+
EventHandler-->>-Lambda: Return array of processed events
0 commit comments