Commit 77afc73
authored
Support for query fragments with Apollo (aws#103)
This changeset enables the use of graphQL query fragments with Apollo Server:
-changed Apollo event handler to pass along any query fragments to the resolver
-added logic to the resolver to detect referenced fragments in the query AST and replace them with the appropriate fragment's selection set
-changed App Sync event handlers to throw an Error if a fragment is detected in the query so that the user is presented with an appropriate error message 'Fragments are not supported' instead of failing downstream and presenting a cryptic error message
-changed functions in the resolver which require fragments data to accept a single object argument instead of multiple arguments for easier readability when calling the function
-updated airports.customized.graphql test schema to have separate input types for create and update mutations so that the resolver unit test could verify test cases for mutations with fragments
-note that this changeset does not address inline fragments1 parent feb34d4 commit 77afc73
File tree
12 files changed
+486
-99
lines changed- src
- test
- templates
- templates
- ApolloServer
- Lambda4AppSyncGraphSDK
- Lambda4AppSyncHTTP
- Lambda4AppSyncSDK
- test
12 files changed
+486
-99
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
582 | 586 | | |
583 | 587 | | |
584 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
17 | 31 | | |
18 | 32 | | |
19 | 33 | | |
| |||
30 | 44 | | |
31 | 45 | | |
32 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
33 | 61 | | |
34 | 62 | | |
35 | 63 | | |
| |||
48 | 76 | | |
49 | 77 | | |
50 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
51 | 97 | | |
52 | 98 | | |
53 | 99 | | |
| |||
87 | 133 | | |
88 | 134 | | |
89 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
90 | 168 | | |
91 | 169 | | |
92 | 170 | | |
| |||
130 | 208 | | |
131 | 209 | | |
132 | 210 | | |
133 | | - | |
134 | | - | |
| 211 | + | |
| 212 | + | |
135 | 213 | | |
136 | 214 | | |
137 | 215 | | |
138 | | - | |
| 216 | + | |
139 | 217 | | |
140 | 218 | | |
141 | 219 | | |
| |||
0 commit comments