Commit c21715d
authored
The previous implementation called `resolve_references` once per
contiguous `__typename` to ensure the correct ordering of the response.
This could have resulted in wildly varying runtime efficiencies.
A request calling for N unique types across M entities could have
as little as N queries or as many as M queries, depending on if the
entities happened to be in large groups of the same type or very
interleaved.
By keeping track of the requested representations and their original
indices, we can rebuild the response in the correct order even when
things get shuffled during computation.
1 parent 04e67ca commit c21715d
File tree
2 files changed
+23
-4
lines changed- lib/apollo-federation
- spec/apollo-federation
2 files changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | | - | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
52 | | - | |
53 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| 73 | + | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
330 | 337 | | |
331 | 338 | | |
332 | 339 | | |
| |||
0 commit comments