Commit 94f3fe5
feat(event-handler): add appsync batch resolvers (#1998)
* update changelog with latest changes
* Add batch processing to appsync handler
* Extend router to accept List of events. Add functional test
* Add e2e tests
* Add required package
* Fix linter checks
* Refactor appsync resolver
* Refactor code to use composition instead of inheritence
* Refactor appsync event handler
* fix style
* Add support for async batch processing
* Fixing sonarcloud error
* Adding docstring + increasing coverage
* Adding missing test + increasing coverage
* Start writing docs
* Refactoring examples
* Refactoring code + examples + documentation
* Moving e2e tests to the right folder
* Moving e2e tests to the right folder
* Adding partial failure
* Adding partial failure
* Fixing docstring and examples
* Adding documentation about Handling Exceptions
* Fixing docstring
* Adding fine grained control when handling exceptions
* Adding fine grained control when handling exceptions
* docs: add intro diagram
* docs: fix wording (Tech debt)
* refactor: use async_ prefix for async code
* refactor: move router to a separate file to ease maintenance
* refactor: rename BasePublic to BaseRouter
* refactor: undo router context composition to reduce complexity and call stacks (getters)
* refactor: reduce abstractions, use explicit methods over assignments
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* refactor: move registry to a separate file; make it private
* refactor: expand inline if for readability
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* refactor: short circuit upfront, complex after
Renamed long var name to `event` to make it quicker to glance through.
Simplified comments by removing redundant ones.
* refactor: simplify arg name
* refactor: add debug statements
* fix(docs): use .context instead of previous ._router.context
* refactor: use kwargs for explicitness
* refactor: use return_exceptions=True to reduce call stack
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* chore: add notes on the beauty of return_exceptions
* refactor: append suffix in exceptions
* chore: if over elif in short-circuit
* chore: improve logging; glad I learned this new f-string trick
* chore: fix debug statement location due to null resolvers
* revert: debug graceful error flag due to non-determinism async
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* revert: debug stmt due to mypy; moving elsewhere
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* docs: docstring resolver (tech debt)
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* docs: minimal batch_resolver docstring
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* chore: complete resolver docstring
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
* Removing payload exception
* Updating poetry
* Merging from develop
* Addressing Heitor's feedback
* Refactoring to support aggregate events
* Refactoring examples + docs
* Addressing Heitor's feedback
* docs: add diagram to visualize n+1 problem
* docs: improve wording in lambda invoke
* docs: add diagram where n+1 problem shifts to Lambda runtime
* docs: add diagram where n+1 problem shifts to Lambda runtime w/ error handling
* docs: highlight lambda response for non-errors
* docs(setup): increase table of contents depth to 5 to help redis and other subsections
* Adding examples
* docs: explain N+1 problem and organize content into sub-sections
* docs: clean up batch resolvers section; add typing
* docs: clean up no-aggregate processing section
* docs: clean up raise on error section
* Adding examples
* docs: clean up async section
* docs: fix highlights, add missing code annotation
* docs: rename snippets to match advanced section
* Merging from develop
* Tests
---------
Signed-off-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
Signed-off-by: Heitor Lessa <lessa@amazon.com>
Co-authored-by: Release bot <aws-devax-open-source@amazon.com>
Co-authored-by: Michal Ploski <mploski@amazon.com>
Co-authored-by: Leandro Damascena <leandro.damascena@gmail.com>
Co-authored-by: Heitor Lessa <lessa@amazon.co.uk>
Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Co-authored-by: Heitor Lessa <lessa@amazon.com>
Co-authored-by: Cavalcante Damascena <lcdama@b0be8355743f.ant.amazon.com>1 parent ce1ea74 commit 94f3fe5
File tree
34 files changed
+2593
-133
lines changed- aws_lambda_powertools
- event_handler
- graphql_appsync
- utilities
- data_classes
- parameters
- docs/core/event_handler
- examples/event_handler_graphql
- sam
- src
- tests
- e2e/event_handler_appsync
- files
- handlers
- functional/event_handler/required_dependencies/appsync
- unit/data_classes/required_dependencies
34 files changed
+2593
-133
lines changedLarge diffs are not rendered by default.
Whitespace-only changes.
Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
Lines changed: 158 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
0 commit comments