feat(incremental-planner): add router integration and native_connectors config - #10156
Draft
tninesling wants to merge 6 commits into
Draft
Conversation
Plumb the FetchProtocol field from federation's FetchNode into the router's FetchNode and fetch dispatch. The incremental planner tags connector fetches with FetchProtocol::Connector carrying the directive coordinate, so the fetch service can resolve the connector by identity instead of relying on the synthetic service name from expansion. The dual-path lookup in fetch_service tries the protocol coordinate first (native connector path), falling back to the service-name-based lookup (expansion-based planner path). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the IncrementalPlanner config struct (enabled, beam_width, fuel) and native_connectors flag to the router Configuration. When native_connectors is true, schema parsing skips the expensive virtual-subgraph expansion and the incremental planner is implicitly enabled. The BULB planner's wall-clock timeout is derived from the cooperative cancellation config when in enforce mode, keeping fuel-based planning deterministic while respecting request deadlines. Both new config options register always-on usage gauges (apollo.router.config.incremental_planner and apollo.router.config.native_connectors) in populate_config_instruments so adoption is measurable from day one. Also removes the allow(dead_code) on the plan_builder module now that the planner is wired end-to-end. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port the native_connectors test module from router-private, covering end-to-end connector execution, schema parsing without synthetic subgraphs, and scaling benchmarks. Remove #[allow(dead_code)] from the CommitTarget field now reachable through the wired-up planner. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add unit and integration tests to bring coverage above 50% for: - defer.rs: 40% -> 98% (nested defer, bare fragments, serialization) - fetch_graph/mod.rs: 28% -> 97% (Display, defer groups, root hops, reachability, rollback for deferred entities) - selection_builder.rs: 13% -> 99% (save/restore, merge, signatures) Also adds integration tests for nested @defer, @skip/@include on cross-subgraph fields, three-way entity hops, and aliased fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 1 new, 20 changed, 0 removedBuild ID: 1d9c048f4df4f89c8c610c1c URL: https://www.apollographql.com/docs/deploy-preview/1d9c048f4df4f89c8c610c1c ✅ AI Style Review — No Changes DetectedNo MDX files were changed in this pull request. Review Log: View detailed log
|
Contributor
Merge Protections🔴 1 of 1 protections blocking · waiting on ⛓️ dependency
🔴 ⛓️ Depends-On RequirementsWaiting for
This rule is failing.Requirement based on the presence of
|
tninesling
marked this pull request as draft
September 2, 2026 23:12
The @requires branch added arguments to SelectionKey::Field to distinguish fields with different arguments sharing a response name. This changed shared operation code used by both planners, causing the existing planner's type_conditions test to fail: artwork fields with different variable arguments under different union members were no longer merged, triggering apollo-compiler's conflicting-arguments validation. The incremental planner doesn't need arguments in SelectionKey — its requires.rs handles argument-aware field identity through direct field.arguments comparisons and aliasing before insertion into SelectionSet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap the example coordinate in backticks so rustdoc doesn't interpret [0] as a link reference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Wires the incremental planner end-to-end into the router and adds
native_connectorsconfiguration.IncrementalPlannerconfig struct (enabled,beam_width,fuel) in routerConfigurationnative_connectorsflag: when true, schema parsing skips expensive virtual-subgraph expansion and the incremental planner is implicitly enabledapollo.router.config.incremental_planner,apollo.router.config.native_connectors) inpopulate_config_instrumentsFetchProtocolwired through router execution layer:fetch_servicetries the protocol coordinate first (native connector path), falling back to service-name lookup (expansion-based path)defer.rs(40%→98%),fetch_graph/mod.rs(28%→97%),selection_builder.rs(13%→99%) above thresholds@defer,@skip/@includeon cross-subgraph fields, three-way entity hops, aliased fieldsnative_connectorsintegration tests ported from router-privateTest plan
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
No user-facing changes; internal planner feature behind feature flag. Config metrics added per guidelines.
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
A lot of (if not most) features benefit from built-in observability and
debug-level logs. Please read this guidance on metrics best-practices. ↩Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩