[Fusion] Fix deferred fragments resolving same-named fields from the wrong type condition branch#10040
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.ResolveWrappingFieldto 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.
Contributor
Patch coverage100.0% of changed lines covered (5/5)
Project coverage: 52.5% (217115/413263 lines) |
This was referenced Jul 7, 2026
This was referenced Jul 14, 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.