[Fusion] Fix conditionals below shared field#9236
Merged
tobias-tengler merged 11 commits intomainfrom Mar 3, 2026
Merged
Conversation
Contributor
Fusion Gateway Performance ResultsSimple Composite Query
Response Times
Deep Recursion Query
Response Times
Variable Batching Throughput
Response Times
Runner 1 = benchmarking-1Run 22613092164 • Commit b0e98bb • Tue, 03 Mar 2026 08:01:30 GMT |
03ccec6 to
6f20e8a
Compare
a5ad97e to
049961c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Fusion’s planning/execution pipeline to correctly propagate @skip/@include conditions through partitioning/backlog work items (notably “below shared field” scenarios), and refreshes/extends the test suite to validate the new behavior.
Changes:
- Propagate conditional directives into unresolvable selection sets and requirement work items via “conditioned” wrappers, so downstream planned steps inherit the correct execution conditions.
- Improve planning/path handling for anonymous inline fragments and “empty” operations, and treat
fusion__emptyselections as internal. - Re-enable previously skipped conditional/shared-path tests, add new static-skip coverage, and update snapshots accordingly.
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/snapshots/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml | Snapshot updated for revised interaction planning/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/snapshots/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml | Snapshot updated for revised interaction planning/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml | Snapshot updated for revised batching/ordering in planned execution. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml | Snapshot updated for revised batching/ordering in planned execution. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml | Snapshot updated (variable value change) to reflect new execution behavior. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/SharedPathTests.Single_Shared_Root_Field_With_Inline_Fragment_Without_TypeCondition.yaml | New snapshot covering anonymous inline fragment conditional propagation. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml | Snapshot updated for revised interaction grouping/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml | Snapshot updated for revised interaction grouping/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml | Snapshot updated for revised interaction grouping/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml | Snapshot updated for revised interaction grouping/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml | Snapshot updated for revised interaction grouping/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/RequireTests.Requirement_On_Property_Within_Nullable_Object_Returning_Null.yaml | Snapshot updated for revised requirement/interaction planning. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/RequireTests.Requirement_On_Property_Within_Nullable_Object.yaml | Snapshot updated for revised requirement/interaction planning. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/RequireTests.Requirement_On_Nullable_Leaf_Field_Returning_Null.yaml | Snapshot updated for revised requirement/interaction planning. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/RequireTests.Requirement_On_Leaf_Field.yaml | Snapshot updated for revised requirement/interaction planning. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml | Snapshot updated for revised execution ordering/batching. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml | Snapshot updated for revised execution ordering/batching. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml | Snapshot updated for revised execution ordering/batching. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml | Snapshot updated for revised interaction grouping/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Same_Dependency.yaml | Snapshot updated for revised interaction grouping/output. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Fields_Below_Entry_Field.yaml | Snapshot updated; conditions now appear on downstream nodes as expected. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Entry_Field.yaml | Snapshot updated; previously failing case now plans conditionally gated nodes. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml | Snapshot updated; root-skip condition now attached to execution node(s). |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml | Snapshot updated; multiple conditions now forwarded/represented. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Root_Field_Statically_Skipped.yaml | New snapshot covering statically skipped root field behavior. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml | Snapshot updated to include conditions/batching group IDs. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml | Snapshot updated to include propagated node conditions. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml | Snapshot updated to include propagated lookup conditions. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml | Snapshot updated; requirement-related condition forwarding validated. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml | Snapshot updated; requirement/lookup condition forwarding validated. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml | Snapshot updated; lookup subtree conditions now represented. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml | Snapshot updated; mixed requirement/field conditions now represented. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml | Snapshot updated; multiple conditions propagated to lookup step. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml | Snapshot updated; multiple conditions propagated to lookup step. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.All_Selections_On_A_Field_Statically_Skipped.yaml | New snapshot covering statically skipped nested selection behavior. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SharedPathTests.cs | Re-enables the previously skipped shared-path inline-fragment test. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/ConditionalTests.cs | Re-enables multiple conditional tests and adds a new static-skip test. |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/FusionTestBase.cs | Adjusts interaction capture to correlate grouped HTTP requests to a stable interaction id. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Partitioners/SelectionSetPartitionerResult.cs | Extends partitioner result to carry condition-aware unresolvable/requirement selections. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Partitioners/SelectionSetPartitioner.cs | Extracts directive conditions during partitioning and snapshots them onto backlog entries. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Partitioners/ConditionedSelectionSet.cs | New wrapper type to associate selection sets with execution conditions. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Partitioners/ConditionedFieldSelection.cs | New wrapper type to associate requirement field selections with execution conditions. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationWorkItem.cs | Adds condition propagation to operation backlog work items. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/FieldWithRequirementWorkItem.cs | Adds condition propagation to field-requirement backlog work items. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Backlog.cs | Propagates conditions when pushing unresolvable selection sets and requirement work items. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationPlanner.cs | Threads work-item conditions through lookup/requirement planning and supports anonymous fragments in path reversal. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationPlanner.BuildExecutionTree.cs | Improves handling of empty operations, conditional extraction/merge, and internal introspection behavior. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/Nodes/OperationCompiler.cs | Treats fusion__empty as an internal directive (like fusion__requirement). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 1, 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.
No description provided.