Skip to content

[Fusion] Fix planning of nested fields under abstract node lookup#9762

Merged
tobias-tengler merged 2 commits into
mainfrom
tte/fix-fusion-nested-selection-node-planning
May 21, 2026
Merged

[Fusion] Fix planning of nested fields under abstract node lookup#9762
tobias-tengler merged 2 commits into
mainfrom
tte/fix-fusion-nested-selection-node-planning

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

Closes #9760

@tobias-tengler tobias-tengler marked this pull request as ready for review May 21, 2026 13:06
Copilot AI review requested due to automatic review settings May 21, 2026 13:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SelectionSetByTypePartitioner by 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 node where:
    • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fusion] bug with deeply nested field queries

2 participants