Repository navigation
[Fusion] Fix deferred fragments losing type conditions on composite fields - #10038
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a Fusion defer planning bug where composite fields selected under a type condition could lose that type condition when reconstructing incremental plan operations (leading to invalid subgraph operations when the enclosing parent is abstract-typed).
Changes:
- Track the active type condition name on
FieldPathSegmentwhen entering composite fields during defer occurrence collection. - When rebuilding incremental plan operations, re-wrap composite fields in an
... on <Type>inline fragment when the path segment indicates a type condition. - Add a regression test and snapshot covering a
Node(abstract) parent with deferred fragments and a deferred composite field requiring an entity lookup across subgraphs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/DeferTests.cs | Adds a regression test exercising deferred composite fields under a type condition on an abstract parent. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/DeferTests.Defer_Composite_Field_Under_Type_Condition_On_Abstract_Parent_Is_Wrapped.yaml | Snapshot proving the reconstructed deferred operations preserve the type condition wrapping. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/FieldPathSegment.cs | Extends path segments to carry an optional TypeCondition for later reconstruction. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/DeferOperationRewriter.cs | Re-wraps reconstructed composite fields in inline fragments based on the stored path segment type condition. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Planning/DeferOccurrenceCollector.cs | Records the active type condition name onto composite path segments during traversal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Patch coverage100.0% of changed lines covered (16/16)
Project coverage: 52.5% (217101/413261 lines) |
This was referenced Jul 7, 2026
This was referenced Jul 14, 2026
This was referenced Jul 23, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Sep 1, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 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.