Repository navigation
[Fusion] Copy completed leaf values into duplicate lookup targets - #10612
Merged
Merged
Conversation
When one lookup result is merged into a primary target and several additional targets, the primary target is completed from the source data and, when every completed value is a non-null, non-enum leaf of an object with the same selection set, the completed rows are copied into each additional target instead of completing the same source data again. Targets that do not qualify, merges with errors and pocketed errors keep the existing completion.
Contributor
Patch coverage79.4% of changed lines covered (85/107)
Uncovered changed lines (JSON){
"sha": "0997fe14af5f6a6842fe77f6f112d03dbacce953",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/FetchResultStore.Pooling.cs", "ranges": [[162, 164]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/FetchResultStore.cs", "ranges": [[729, 730], [750, 751], [759, 759], [777, 778], [787, 788], [821, 822], [866, 867], [873, 874], [881, 882], [913, 914]] }
]
}Project coverage: 59.2% (313339/529695 lines) |
This was referenced Oct 18, 2026
Duplicate targets now take the completed leaf values of the primary target through TryAssignLeafValue, the leaf copy that entity reuse uses, so targets at different paths with different selection sets are covered as well. Targets that cannot take the values (non-scalar source data, alias mappings, errors, pocketed errors, uninitialized or abstract targets, enum type mismatches) are completed from the source data. This removes the row offset copy and its document helpers.
michaelstaib
marked this pull request as ready for review
October 21, 2026 02:16
…ield The leaf copy assumed that the primary target selects every property of the source data. A batch whose additional targets select more fields than the primary left those fields uncompleted on the additional targets. Copying now stops when the primary does not select a source property, and every target is completed from the source data.
michaelstaib
approved these changes
Oct 21, 2026
michaelstaib
added a commit
that referenced
this pull request
Oct 21, 2026
Resolves the duplicate lookup target copy from #10612 onto cursor targets: the leaf copy and entity reuse read additional targets through AdditionalTargets, and TryAssignLeafValue tracks structure replacements like the other value writers. Drops the row offset copy helpers that #10612 no longer uses.
This was referenced Oct 25, 2026
Merged
This was referenced Oct 26, 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.
When several lookup targets have the same requirement values, the gateway sends one variable set and merges its result into the primary target and every additional target. For the federation benchmark query this means 324 lookup targets but only 7 distinct variable sets, and each duplicate target re-runs path building, variable writing and the full merge (value completion) of the same source data.
This PR completes the primary target once and copies the completed rows into each additional target with the same selection set, as long as every completed value is a non-null, non-enum leaf. Targets with a different selection set, merges with errors and pocketed errors keep the existing per-target completion.
mainmainThe benchmark runs the whole federation benchmark query through the gateway executor against canned subgraph responses. The apollo-federation request is 4% faster, beyond the error interval; composite-schema is unchanged within the error interval. The end-to-end numbers for this change together with #10613 are in #10613.