Skip to content

Fix Fusion require subtree routed to non-owning schema - #10184

Merged
michaelstaib merged 2 commits into
mainfrom
mst/fix-fusion-require-subtree-misroute
Aug 3, 2026
Merged

michaelstaib merged 2 commits into
mainfrom
mst/fix-fusion-require-subtree-misroute

Conversation

@michaelstaib

@michaelstaib michaelstaib commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #10183

Copilot AI review requested due to automatic review settings August 3, 2026 08:51

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 tightens Fusion’s requirement inlining logic so that a requirement subtree is only folded into an existing planned fetch when the chosen source schema can actually resolve the full connector chain (fields + type conditions) down to the requirement target. This prevents the planner from generating subgraph documents that reference intermediate fields/fragments not declared by that subgraph.

Changes:

  • Added a connector-chain resolvability check when selecting an ancestor step to inline requirements into (OperationPlanner).
  • Added a regression test covering a case where the entry schema declares a nested lookup but does not own the required subtree (RequirementReentrancyTests).

Reviewed changes

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

File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/RequirementReentrancyTests.cs Adds a regression test and composed schema setup to ensure require subtrees stay in the owning subgraph even when another subgraph declares adjacent lookups.
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs Ensures ancestor-step requirement inlining only happens when the candidate schema can resolve the full connector chain (rejects invalid inlining into non-owning schemas).

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

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

91.7% of changed lines covered (22/24)

File Covered Changed Patch %
…/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs 22 24 91.7% 🟡
Uncovered changed lines (JSON)
{
  "sha": "f8a71b9886136d67ed552b833eabdaec2582ed52",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs", "ranges": [[4117, 4118]] }
  ]
}

Project coverage: 54.0% (237568/439994 lines)

@michaelstaib
michaelstaib merged commit c81f04f into main Aug 3, 2026
150 checks passed
@michaelstaib
michaelstaib deleted the mst/fix-fusion-require-subtree-misroute branch August 3, 2026 09:14
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.

Fusion: @require field's subtree planned into the parent source schema when it needs a further lookup hop

2 participants