Skip to content

[Fusion] Fold leaf Apollo lookups into a deeper identical lookup - #10628

Merged
tobias-tengler merged 7 commits into
mainfrom
tte/fusion-fold-leaf-apollo-lookups
Oct 20, 2026
Merged

tobias-tengler merged 7 commits into
mainfrom
tte/fusion-fold-leaf-apollo-lookups

Conversation

@tobias-tengler

@tobias-tengler tobias-tengler commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

An Apollo Federation lookup that nothing in the plan depends on is sent as its own _entities request, even when a structurally identical lookup for the same entity runs at a greater dependency depth. In the apollo-federation benchmark query the inventory lookup for topProducts runs alone in the second wave, while the same inventory lookup for three nested product paths runs in the fourth wave.

This PR moves such a leaf lookup into the deeper identical lookup when that lookup already waits for all of the leaf's dependencies, so its representations are sent with the existing deeper request. A shallower lookup that other nodes depend on stays separate. OperationPlanner.Version goes to 2.4.0.

Benchmark query Version HTTP requests Subgraph operations Waves
apollo-federation base 7 8 4
apollo-federation PR 6 7 4

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

95.2% of changed lines covered (100/105)

File Covered Changed Patch %
…/Planning/OperationPlanner.BuildExecutionTree.cs 99 104 95.2% 🟡
…/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs 1 1 100.0% 🟢
Uncovered changed lines (JSON)
{
  "sha": "380ff6e7078981a077ce70facbdd5dd0fb425959",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.BuildExecutionTree.cs", "ranges": [[1244, 1246], [1283, 1284]] }
  ]
}

Project coverage: 59.1% (313252/529604 lines)

@tobias-tengler
tobias-tengler changed the base branch from main to tte/fusion-merge-apollo-entity-lookups October 19, 2026 06:44
@tobias-tengler
tobias-tengler force-pushed the tte/fusion-fold-leaf-apollo-lookups branch from 44c4182 to 2cfd93f Compare October 20, 2026 15:20
@tobias-tengler
tobias-tengler force-pushed the tte/fusion-fold-leaf-apollo-lookups branch from aeabaf6 to 0edb63b Compare October 20, 2026 15:55
@tobias-tengler
tobias-tengler marked this pull request as ready for review October 20, 2026 16:08
Copilot AI balanced review requested due to automatic review settings October 20, 2026 16:08

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tobias-tengler
tobias-tengler force-pushed the tte/fusion-fold-leaf-apollo-lookups branch from 0edb63b to 075fc9e Compare October 20, 2026 16:30
@tobias-tengler
tobias-tengler force-pushed the tte/fusion-fold-leaf-apollo-lookups branch 3 times, most recently from 62fff41 to c777442 Compare October 20, 2026 16:49
Base automatically changed from tte/fusion-merge-apollo-entity-lookups to main October 20, 2026 16:58
An Apollo entity lookup that no plan node depends on now joins a
structurally identical lookup at a greater dependency depth when that
lookup already waits for all of the leaf's dependencies. No selections
are added to any lookup and no dependent waits longer; the leaf's
representations move into the existing deeper request.
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