[Fusion] Fix planning of nested fields under abstract node lookup#9762
Merged
tobias-tengler merged 2 commits intoMay 21, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Fusion operation planning failures for deeply nested selections under abstract node lookups (interface selections), as reported in issue #9760. The fix ensures selection-set cloning is tracked correctly in the selection-set index so that requirement inlining can target the original selection sets without triggering missing-key errors during planning.
Changes:
- Fix selection-set cloning in
SelectionSetByTypePartitionerby switching from a rewriter-based approach to an explicit top-down clone that correctly registers cloned selection sets against their originals. - Add regression tests covering interface selections under
nodewhere:- all interface implementations live in the same subgraph, and
- nested fields require fetching additional data from another subgraph.
- Add/update snapshot baselines for the new tests (including expected operation plan structure).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/Partitioners/SelectionSetByTypePartitioner.cs | Replaces rewriter-based cloning with explicit top-down cloning and proper RegisterCloned bookkeeping to prevent planner key-miss failures. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/GlobalObjectIdentificationTests.cs | Adds regression tests for interface selections under node lookup, including cross-subgraph nested field planning. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/GlobalObjectIdentificationTests.Node_Field_Interface_Selection_All_Implementations_In_Same_Subgraph_Only_Node_Lookup.yaml | Snapshot baseline for the “single subgraph” interface-selection node lookup test. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/GlobalObjectIdentificationTests.Node_Field_Interface_Selection_With_Nested_Field_From_Other_Subgraph.yaml | Snapshot baseline for the cross-subgraph nested field planning regression test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 21, 2026
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.
Closes #9760