Skip to content

[Fusion] Fix deferred fragments resolving same-named fields from the wrong type condition branch#10040

Merged
tobias-tengler merged 2 commits into
mainfrom
tte/fix-defer-wrapping-field-type-condition
Jul 2, 2026
Merged

[Fusion] Fix deferred fragments resolving same-named fields from the wrong type condition branch#10040
tobias-tengler merged 2 commits into
mainfrom
tte/fix-defer-wrapping-field-type-condition

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 2, 2026 19:20

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 addresses a Fusion defer planning bug where deferred fragments could resolve same-named fields from the wrong sibling type-condition branch, causing nested composite selections to be dropped during incremental operation reconstruction.

Changes:

  • Update DeferOperationRewriter.ResolveWrappingField to match wrapping fields by both response name and the active inline-fragment type condition.
  • Add two regression tests covering nested composite selections under one/both sibling type-condition branches.
  • Add snapshots capturing the stable response stream, subgraph interactions, and operation plan output for the new scenarios.

Reviewed changes

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

File Description
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/DeferOperationRewriter.cs Fix wrapping-field resolution to respect the type-condition branch recorded in the path segment.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/DeferTests.cs Add regression tests for nested composite selections across sibling type-condition branches under @defer.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/DeferTests.Defer_Nested_Composite_On_One_Of_Sibling_Type_Conditions.yaml Snapshot for the “one sibling branch” regression case (ensures nested composite selections are preserved).
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/DeferTests.Defer_Nested_Composite_On_Both_Sibling_Type_Conditions.yaml Snapshot for the “both sibling branches” regression case (divergent nested composite sub-selections).

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

@tobias-tengler
tobias-tengler merged commit 6955b73 into main Jul 2, 2026
147 checks passed
@tobias-tengler
tobias-tengler deleted the tte/fix-defer-wrapping-field-type-condition branch July 2, 2026 19:26
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (5/5)

File Covered Changed Patch %
…/src/Fusion.Execution/Planning/DeferOperationRewriter.cs 5 5 100.0% 🟢

Project coverage: 52.5% (217115/413263 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.

2 participants