Skip to content

[Fusion] Fix inlining of abstract type requirements#9509

Merged
tobias-tengler merged 17 commits intomainfrom
tte/fix-fusion-abstract-type-issue
Apr 8, 2026
Merged

[Fusion] Fix inlining of abstract type requirements#9509
tobias-tengler merged 17 commits intomainfrom
tte/fix-fusion-abstract-type-issue

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

@tobias-tengler tobias-tengler marked this pull request as ready for review April 8, 2026 05:58
Copilot AI review requested due to automatic review settings April 8, 2026 05:59
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

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 __typename selections 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.

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.

2 participants