-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a query planning bug where invalid subgraph queries are generated…
… with `reuseQueryFragments` set true (#2963) Fixed #2952. ### Summary of changes - updated computeExpandedSelectionSetAtType function not to trim fragment's validators if the fragment's type condition is not an object type. - This change is necessary because `FieldsInSetCanMerge` rule is more restrictive in that case. - The untrimmed validator should avoid generating invalid queries, but it may be less efficient. ### Test plan - The operations.test.ts confirms the changes of named fragments' validators. - Added a new test (based on the github issue's reproducer) confirming that subgraph queries are no longer invalid.
- Loading branch information
Showing
4 changed files
with
241 additions
and
3 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,7 @@ | ||
--- | ||
"@apollo/query-planner": patch | ||
"@apollo/composition": patch | ||
"@apollo/federation-internals": patch | ||
--- | ||
|
||
Fix a query planning bug where invalid subgraph queries are generated with `reuseQueryFragments` set true. ([#2952](https://github.com/apollographql/federation/issues/2952)) |
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
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
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