Skip to content

fix(federation/query-planner): Avoid unnecessarily precomputing non-trivial followup edges#8373

Merged
sachindshinde merged 2 commits intodevfrom
sachin/avoid-precomputing-non-trivial-followup-edges-for-subgraph-query-graphs
Oct 21, 2025
Merged

fix(federation/query-planner): Avoid unnecessarily precomputing non-trivial followup edges#8373
sachindshinde merged 2 commits intodevfrom
sachin/avoid-precomputing-non-trivial-followup-edges-for-subgraph-query-graphs

Conversation

@sachindshinde
Copy link
Contributor

@sachindshinde sachindshinde commented Oct 2, 2025

We currently precompute non-trivial followup edge information for all query graph builders, so as to mirror the JS codebase. This is necessary when building federated query graphs and supergraph/API schema query graphs. However, this isn't needed when building subgraph query graphs (as FederatedQueryGraphBuilder::build() does it later, and no graph paths are used in between).

This PR accordingly updates SchemaQueryGraphBuilder::build() to skip this precomputation if building a subgraph query graph, to avoid the unnecessary edge iteration/memory allocation. Note that this precomputation was originally skipped completely in SchemaQueryGraphBuilder::build() during query planning, but was introduced when aligning parity with the JS codebase in #7961.

@github-actions

This comment has been minimized.

@apollo-librarian
Copy link

apollo-librarian bot commented Oct 2, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: f0263a1cf7b4d65dae2a49c7
Build Logs: View logs

@sachindshinde sachindshinde force-pushed the sachin/avoid-precomputing-non-trivial-followup-edges-for-subgraph-query-graphs branch from 469fc37 to 3e99c0b Compare October 2, 2025 16:51
Copy link
Contributor

@duckki duckki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@TylerBloom
Copy link
Contributor

This change makes sense. I want to verify this is the problem via RTF before we commit this

@sachindshinde sachindshinde requested a review from a team as a code owner October 2, 2025 17:19
@sachindshinde sachindshinde merged commit 0a978b3 into dev Oct 21, 2025
15 checks passed
@sachindshinde sachindshinde deleted the sachin/avoid-precomputing-non-trivial-followup-edges-for-subgraph-query-graphs branch October 21, 2025 20:56
@abernix abernix mentioned this pull request Oct 27, 2025
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.

3 participants