Commit daf36bd
authored
Fix relative path logic when eliding subgraph jump for
This PR makes some changes to #2988, specifically:
- It fixes a bug where the relative path is computed incorrectly when a
subgraph jump is skipped/elided in the case of `@fromContext`.
- It changes the selection-set-to-renamer conversion logic to create
multiple inline fragments instead of introducing a new syntax, in the
case of a type condition on an abstract type. (This saves us from having
to update router to understand it.)
- It tweaks the iteration over the `GraphPath` in
`canSatisfyConditions()` to be cleaner/easier to understand.
- When I looked at that code again, I noticed it was strange that we
initialized `levelsInDataPath` at `1` even though we aren't guaranteed
that the last element in `GraphPath` is a field. The gist is that at the
first match, we know it's a field, so that ends up being okay. But I
think it's easier to understand code-wise if both `levelsInQueryPath`
and `levelsInDataPath` start off at 0, and every time we get a new
element (at the start of the `for` block) we increment the counts
accordingly.@fromContext (#3005)1 parent c4744da commit daf36bd
4 files changed
Lines changed: 23 additions & 13 deletions
File tree
- .changeset
- query-graphs-js/src
- query-planner-js/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1909 | 1909 | | |
1910 | 1910 | | |
1911 | 1911 | | |
1912 | | - | |
1913 | | - | |
| 1912 | + | |
| 1913 | + | |
1914 | 1914 | | |
1915 | 1915 | | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
1916 | 1920 | | |
1917 | 1921 | | |
1918 | 1922 | | |
| |||
1965 | 1969 | | |
1966 | 1970 | | |
1967 | 1971 | | |
1968 | | - | |
1969 | | - | |
1970 | | - | |
1971 | | - | |
1972 | 1972 | | |
1973 | 1973 | | |
1974 | 1974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9478 | 9478 | | |
9479 | 9479 | | |
9480 | 9480 | | |
9481 | | - | |
| 9481 | + | |
| 9482 | + | |
| 9483 | + | |
| 9484 | + | |
| 9485 | + | |
| 9486 | + | |
9482 | 9487 | | |
9483 | 9488 | | |
9484 | 9489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
| 1681 | + | |
1684 | 1682 | | |
1685 | | - | |
| 1683 | + | |
1686 | 1684 | | |
1687 | | - | |
| 1685 | + | |
1688 | 1686 | | |
1689 | 1687 | | |
1690 | 1688 | | |
| |||
4445 | 4443 | | |
4446 | 4444 | | |
4447 | 4445 | | |
| 4446 | + | |
4448 | 4447 | | |
| 4448 | + | |
4449 | 4449 | | |
4450 | | - | |
| 4450 | + | |
4451 | 4451 | | |
4452 | 4452 | | |
4453 | 4453 | | |
| |||
0 commit comments