Skip to content

Fix node planning for interface fragments with non-Node implementors - #10182

Merged
michaelstaib merged 1 commit into
mainfrom
mst/fix-10170
Aug 1, 2026
Merged

michaelstaib merged 1 commit into
mainfrom
mst/fix-10170

Conversation

@michaelstaib

@michaelstaib michaelstaib commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #10170

Copilot AI review requested due to automatic review settings August 1, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes selection-set partitioning and operation planning when an interface fragment appears inside a node(...) selection set, ensuring implementors that cannot actually occur at runtime (because they are not possible types of the enclosing selection set) are pruned from generated branches/plans.

Changes:

  • Update SelectionSetByTypePartitioner to restrict concrete branches to possible types of the enclosing selection set and to additionally filter candidates against all enclosing type conditions.
  • Add partitioning tests covering interface fragments where some interface implementors are not possible types of the node field result type, including nested interface fragments.
  • Add abstract lookup fanout planning tests + snapshots to ensure non-Node interface implementors are pruned from node fanout branches.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/SelectionSetByTypePartitionerTests.cs Adds regression tests for partitioning interface/nested-interface fragments that must not produce branches for impossible runtime types.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/AbstractLookupFanoutPlanningTests.cs Adds regression tests to ensure planning prunes non-Node implementors when fanout is derived from an interface fragment inside node(...).
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/snapshots/AbstractLookupFanoutPlanningTests.Plan_Should_Prune_NonNode_Implementor_When_NodeSelectionSet_Has_No_Shared_Selections.yaml Adds snapshot for pruning behavior when node(...) has only interface-fragment selections (no shared selections).
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/snapshots/AbstractLookupFanoutPlanningTests.Plan_Should_Prune_NonNode_Implementor_When_InterfaceFragment_Is_In_NodeSelectionSet.yaml Adds snapshot for pruning behavior when node(...) includes shared Node selections plus an interface fragment.
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/Partitioners/SelectionSetByTypePartitioner.cs Fixes branch generation for interface selections by intersecting with enclosing possible types/type conditions to avoid impossible branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@michaelstaib
michaelstaib merged commit dfc3d60 into main Aug 1, 2026
148 checks passed
@michaelstaib
michaelstaib deleted the mst/fix-10170 branch August 1, 2026 07:49
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (23/23)

File Covered Changed Patch %
…/Planning/Partitioners/SelectionSetByTypePartitioner.cs 23 23 100.0% 🟢

Project coverage: 54.0% (237560/439953 lines)

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 planner crashes at plan time on node(id:) when an inline fragment's type condition has non-Node implementors

2 participants