Skip to content

Fix re-entrant lookups for nested selections under required fields#9860

Merged
michaelstaib merged 1 commit into
mainfrom
mst/planner-050626-1
Jun 5, 2026
Merged

Fix re-entrant lookups for nested selections under required fields#9860
michaelstaib merged 1 commit into
mainfrom
mst/planner-050626-1

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

…ments

Copilot AI review requested due to automatic review settings June 5, 2026 17:58
@michaelstaib michaelstaib changed the title [Fusion] Partition child selections when inlining fields with require… Fix re-entrant lookups for nested selections under required fields Jun 5, 2026
@michaelstaib michaelstaib merged commit 6c88d26 into main Jun 5, 2026
144 checks passed
@michaelstaib michaelstaib deleted the mst/planner-050626-1 branch June 5, 2026 18:00

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 adjusts Fusion operation planning when inlining fields with @require so that only child selections resolvable by the consumer schema are inlined, while unresolvable descendants are planned as re-entrant lookups. It adds regression tests to ensure correct “re-enter subgraph” behavior across requirement boundaries.

Changes:

  • Partition child selections when inlining fields with requirements; push unresolvable descendants (and nested requirement fields) back onto the backlog for separate planning.
  • Fix selection-set pathing for partitioned child selections by rooting them at the field’s response name.
  • Add new planning regression tests + snapshots covering re-entrancy vs. staying within the recommendation subgraph.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs Partitions inline field children against the consumer schema and corrects child selection paths for follow-up planning.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/RequirementReentrancyTests.cs Adds regression tests for re-entrant lookup planning across @require boundaries.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/snapshots/RequirementReentrancyTests.Plan_Should_StayInRecommendation_When_InnerProduct_Selects_OnlyId.yaml Snapshot for “no re-entry needed” case.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/snapshots/RequirementReentrancyTests.Plan_Should_Reenter_Catalog_When_EnteringFromRecommendation_Standalone.yaml Snapshot for “re-entry required” case starting from recommendation.

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

Comment on lines +1098 to +1102
var childSelections =
ExtractResolvableChildSelections(
stepConsumer.StepId,
workItem.EstimatedDepth,
workItem.Selection,
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