Repository navigation
Fix node planning for interface fragments with non-Node implementors - #10182
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
SelectionSetByTypePartitionerto 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
nodefield result type, including nested interface fragments. - Add abstract lookup fanout planning tests + snapshots to ensure non-
Nodeinterface 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.
Contributor
Patch coverage100.0% of changed lines covered (23/23)
Project coverage: 54.0% (237560/439953 lines) |
This was referenced Aug 6, 2026
Merged
This was referenced Aug 13, 2026
Closed
Closed
This was referenced Aug 25, 2026
Closed
This was referenced Sep 1, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 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.
Fixes #10170