Commit f4557a4
authored
Handle empty responses from subgraphs and failed entity calls (#500)
This PR tackles an issue where the subgraph error could end up being
omitted entirely in the client response.
It now also handles cases where the upstream response is empty.
In cases where a subgraph call fails, there's no point to clone the
error for every entity representation. It'd result in a bloated response
with the same thing repeated multiple times (imagine fetching 1000s
representations).
Instead of cloning and adding `path` property to associate the error
with a point in GraphQL document, we attach `affectedPath` that
represents the Flatten(path) where the error occurred.1 parent c9f3415 commit f4557a4
File tree
4 files changed
+52
-14
lines changed- lib/executor/src
- execution
- executors
- response
4 files changed
+52
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | | - | |
57 | | - | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | | - | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
| 512 | + | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
594 | 603 | | |
595 | 604 | | |
596 | 605 | | |
| |||
902 | 911 | | |
903 | 912 | | |
904 | 913 | | |
| 914 | + | |
905 | 915 | | |
906 | 916 | | |
907 | 917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
165 | 179 | | |
166 | 180 | | |
167 | 181 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
185 | 190 | | |
186 | 191 | | |
187 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
| |||
251 | 259 | | |
252 | 260 | | |
253 | 261 | | |
| 262 | + | |
254 | 263 | | |
255 | 264 | | |
256 | 265 | | |
| 266 | + | |
257 | 267 | | |
258 | 268 | | |
259 | 269 | | |
260 | 270 | | |
| 271 | + | |
261 | 272 | | |
262 | 273 | | |
263 | 274 | | |
| 275 | + | |
264 | 276 | | |
265 | 277 | | |
266 | 278 | | |
| |||
270 | 282 | | |
271 | 283 | | |
272 | 284 | | |
273 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
274 | 289 | | |
275 | 290 | | |
0 commit comments