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.md
+58
Original file line number
Diff line number
Diff line change
@@ -711,6 +711,64 @@ You can subclass `AppSyncResolverEvent` to bring your own set of methods to hand
711
711
}
712
712
```
713
713
714
+
### Split operations with Router
715
+
716
+
As you grow the number of related GraphQL operations a given Lambda function should handle, it is natural to split them into separate files to ease maintenance - That's where the `Router` feature is useful.
717
+
718
+
Let's assume you have `app.py` as your Lambda function entrypoint and routes in `users.py`, this is how you'd use the `Router` feature.
719
+
720
+
=== "resolvers/location.py"
721
+
722
+
We import **Router** instead of **AppSyncResolver**; syntax wise is exactly the same.
723
+
724
+
```python hl_lines="4 7 10 15"
725
+
from typing import Any, Dict, List
726
+
727
+
from aws_lambda_powertools import Logger
728
+
from aws_lambda_powertools.event_handler.appsync import Router
0 commit comments