-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This commit reapplies #2639 with an additional fix related to reproducing and resolving #2680. The bug existed in the SelectionSet.contains logic in the final check to provide a ContainsResult. Here the lengths of the compared selection sets are used to determine subset or strictly equal. In the case that the __typename field was ignored up above, the comparison becomes invalid unless we offset the comparison by 1 to account for the non-existent field.
- Loading branch information
1 parent
43e965c
commit b9052fd
Showing
6 changed files
with
969 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"@apollo/query-planner": patch | ||
"@apollo/federation-internals": patch | ||
"@apollo/gateway": patch | ||
--- | ||
|
||
Reapply #2639: | ||
|
||
Try reusing named fragments in subgraph fetches even if those fragment only apply partially to the subgraph. Before this change, only named fragments that were applying entirely to a subgraph were tried, leading to less reuse that expected. Concretely, this change can sometimes allow the generation of smaller subgraph fetches. | ||
|
||
Additionally, resolve a bug which surfaced in the fragment optimization logic which could result in invalid/incorrect optimizations / fragment reuse. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.