[Fusion] Fix inlining of abstract type requirements#9509
Merged
tobias-tengler merged 17 commits intomainfrom Apr 8, 2026
Merged
[Fusion] Fix inlining of abstract type requirements#9509tobias-tengler merged 17 commits intomainfrom
tobias-tengler merged 17 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Fusion operation planning when abstract-type requirements are inlined, especially across inline fragments/directive conditions, and updates the corresponding test snapshots.
Changes:
- Adjusts selection-set partitioning to merge child unresolvable entries back into the parent to avoid duplicate downstream lookups for abstract types.
- Extends operation planning with a fallback path to inline lookup requirements into the nearest ancestor plan step while preserving fragment structure.
- Adds/updates AspNetCore tests and snapshots to validate interface/abstract-type planning scenarios (including nested
@skip) and removes redundant__typenameselections from planned downstream operations.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/snapshots/InterfaceLookupPlanningTests.Abstract_Customer_Interface_With_Email_Is_Plannable.yaml | Updates planned operations snapshot (removes redundant __typename selections). |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/ConditionalTests.cs | Adds regression test for interface type refinement under nested @skip. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/AbstractTypeTests.cs | Adds multiple regression tests covering interface fields with/without type refinements (including aliasing and mismatch cases). |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Skip.yaml | New snapshot validating conditional inlining/requirements behavior. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup.yaml | Snapshot update removing redundant __typename within type refinement selections. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup_And_Field_From_Specific_Source.yaml | Snapshot update removing redundant __typename within type refinement selections. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups.yaml | Snapshot update removing redundant __typename in concrete lookup operations and responses. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups_And_Field_From_Specific_Source.yaml | Snapshot update removing redundant __typename in concrete lookup operations and responses. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Type_Refinements_Do_Not_Match.yaml | New snapshot for “type refinements do not match” scenario. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_All_Fields_On_Dedicated_Schemas.yaml | New snapshot covering dedicated-schema resolution for interface + type refinements. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Aliased_With_Different_Selections.yaml | New snapshot validating aliasing + differing selections across repeated interface fields. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/Partitioners/SelectionSetPartitioner.cs | Merges child unresolvable entries into parent unresolvable selections for abstract types; adjusts condition pop timing. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs | Adds fallback inlining via AST ancestor discovery and fragment wrapping; threads cancellation token into execution-plan build. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.BuildExecutionTree.cs | Propagates cancellation token and checks it during execution node construction. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/PlannerTopologyCache.cs | Excludes introspection complex types from planner topology cache building. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 1, 2026
This was referenced May 4, 2026
Open
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.