fix(federation/query-planning): Fix bug where subgraph jump key fields are fetched from the wrong node#8016
Merged
sachindshinde merged 3 commits intodevfrom Oct 1, 2025
Conversation
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 32cc33479e2a7a2af19bf806 |
This comment has been minimized.
This comment has been minimized.
4b84a63 to
46156ba
Compare
duckki
approved these changes
Aug 2, 2025
012c938 to
c7e2e35
Compare
Contributor
|
can't approve more! let's merge. |
…nly try to collect its key fields from a subgraph that didn't have them.
c7e2e35 to
1cd1577
Compare
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a
@requiresedge needs a subgraph jump during fetch dependency graph processing, this would sometimes cause the locally satisfiable key fields needed by that jump to be fetched from the parent node instead of the current node (which apparently was done as an optimization). This can be a problem, sinceGraphPath::can_satisfy_conditions()only really guarantees the current node has those key fields.This PR updates the code using the parent node to now explicitly check whether the locally satisfiable key can be fetched from that node, and if not, falls back to the current node (adding it as a parent, if needed). This lets us keep the optimization and avoid unnecessarily changing query plans.
This PR mirrors its JS equivalent at apollographql/federation#3293 , and fixes #6004 .