feat(incremental-planner): add @defer support - #10143
Draft
tninesling wants to merge 3 commits into
Draft
Conversation
Contributor
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 1 new, 20 changed, 0 removedBuild ID: 8867e967e13a15ce5350cd78 URL: https://www.apollographql.com/docs/deploy-preview/8867e967e13a15ce5350cd78 ✅ 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
|
11 tasks
tninesling
marked this pull request as draft
September 2, 2026 23:12
New defer.rs module: extract_defer_label, strip_defer_directive, defer_context, build_defer_info with unit tests. defer_ref propagated through PendingSelection. Fetch groups keyed by (subgraph, merge_at, defer_ref). Plan builder partitions by defer_ref, wrapping deferred groups in DeferNode/PrimaryDeferBlock/DeferredDeferBlock. Type-conditions defer awareness: try_pass_through_fragment and try_vacuous_type_condition extract defer labels and propagate defer_ref. Strips @defer from inline fragment op path elements so the directive does not leak into subgraph operations. Uses response_name() in defer serialization so aliased fields get correct response keys. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Upstream normalization guarantees every @defer has a label by the time plan building runs. Assert this so silent data loss is caught early if the invariant ever breaks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add plan_query_with_defer helper and 4 tests covering @defer behavior: - defer_produces_defer_node - synthesized_defer_labels_do_not_leak_into_plan - defer_same_subgraph_produces_defer_node - defer_sibling_blocks_produces_multiple_deferred Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tninesling
force-pushed
the
tninesling/inc-port-15-defer
branch
from
September 3, 2026 01:22
33236b3 to
650221f
Compare
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
Implements
@deferdirective support in the incremental planner.defer.rsmodule:extract_defer_label,strip_defer_directive,defer_context,build_defer_infowith unit testsdefer_refpropagated throughPendingSelection; fetch groups keyed by(subgraph, merge_at, defer_ref)defer_ref, wrapping deferred groups inDeferNode/PrimaryDeferBlock/DeferredDeferBlocktry_pass_through_fragmentandtry_vacuous_type_conditionextract defer labels and propagatedefer_ref@deferfrom inline fragment op path elements so the directive doesn't leak into subgraph operationsresponse_name()in defer serialization so aliased fields get correct response keysdebug_assertfor unlabeled@deferinvariant (upstream normalization guarantees labels)Test plan
defer_produces_defer_node,synthesized_defer_labels_do_not_leak_into_plan,defer_same_subgraph_produces_defer_node,defer_sibling_blocks_produces_multiple_deferredChecklist
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.
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. ↩