chore: upgrade apollo-compiler to v2.0.0-beta.1 - #10121
Draft
tninesling wants to merge 12 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: e08d7f48a04fb7be87a7ea87 URL: https://www.apollographql.com/docs/deploy-preview/e08d7f48a04fb7be87a7ea87 ✅ 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
force-pushed
the
tninesling/upgrade-compiler-v2-beta1
branch
2 times, most recently
from
August 31, 2026 19:48
ac1db3d to
412a157
Compare
10 tasks
tninesling
force-pushed
the
tninesling/upgrade-compiler-v2-beta1
branch
2 times, most recently
from
September 1, 2026 14:38
eacc29b to
f84c98e
Compare
Migrates Component<T> to Node<T>, ComponentName to Node<Name>, and ComponentOrigin to Option<ExtensionId>. Deduplicates compat.rs functions where ast::DirectiveList and schema::DirectiveList were unified into a single DirectiveList type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tninesling
force-pushed
the
tninesling/upgrade-compiler-v2-beta1
branch
from
September 1, 2026 15:14
f84c98e to
7448700
Compare
Remove needless borrows, useless type conversions, redundant clones, and no-op as_ref calls introduced by the apollo-compiler v2 API changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix import ordering in link/mod.rs and replace explicit closure clone with .cloned() in query_plan_soundness.rs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix import ordering in link/mod.rs (group_imports=StdExternalCrate) - Replace .map(|c| c.clone()) with .cloned() in query_plan_soundness.rs - Remove unfulfilled #[expect(clippy::result_large_err)] attributes in apq, websocket, and persisted_queries modules (type sizes changed with compiler v2, lint no longer fires) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sion compat The lint fires on CI (Rust 1.98) but not locally (1.97). Switch from #[expect] to #[allow] so it suppresses on 1.98 without causing an unfulfilled-expectation error on 1.97. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… beta1 The beta1 upgrade commit inadvertently reverted is_array()/is_object() calls back to closed_tuple/empty_object accepts patterns from the pre-shape-0.8 API. Restore them. Also update shape pretty_print assertions (List<T> -> [...T], Error<"msg"> -> Unknown (err "msg")), schema serialization expectation (@link placement), and dhat memory thresholds for compiler v2 beta1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When both the link and federation specs are explicitly linked in the input, compiler v2 keeps both @link directives together on the extend schema definition rather than placing the link spec on the base schema. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the input has `extend schema @link(link/v1.0) @link(federation/v2.0)`, the parser gives both directives an ExtensionId. The link spec's @link should live on the base `schema { ... }` definition, not on `extend schema`. After collecting link metadata, we now strip the ExtensionId from the link spec's @link directive so the serializer places it on the base schema definition. This keeps the output consistent regardless of whether the link spec was explicitly linked or implicitly added. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The beta1 Component->Node migration replaced
`Component { origin: schema_definition.origin_to_use(), ... }` with
`Node::new(...)`, losing the logic that chose whether the link-to-link
@link directive should go on the schema definition or an extension.
Restore the origin_to_use() call in add_to_schema so the directive gets
the correct ExtensionId, matching pre-upgrade serialization behavior.
Also remove the promote_link_spec_directive workaround that was papering
over the symptom in expand_schema.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The shape crate's public API is identical between preview.0 and preview.1, so the has_own_errors/any_object/any_array changes were not required. Restoring beta0 versions of connector method files to keep the changeset minimal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Compiler v2 unified DirectiveList types, so the duplicate function that existed for the separate AST DirectiveList is no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…st is unified Compiler v2 consolidated Node<Directive> and Component<Directive> into a single Node<Directive> type, so the AppliedDirective associated type that abstracted over both wrappers is no longer needed. 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
Upgrades
apollo-compilerfromv2.0.0-beta.0tov2.0.0-beta.1andapollo-federation-typesshape from0.9.0-preview.0to0.9.0-preview.1.The main API change in beta.1 is the removal of
Component<T>in favor ofNode<T>:Component<T>->Node<T>: TheComponentwrapper that trackedComponentOriginhas been removed. All uses ofComponent<T>becomeNode<T>.ComponentName->Node<Name>: Type alias replaced with the concrete type.ComponentOrigin->Option<ExtensionId>: Origin tracking simplified. Most code that inspectedComponentOrigin::DefinitionvsComponentOrigin::Extensionnow checksOption<ExtensionId>(None = definition, Some = extension).DirectiveListunified:ast::DirectiveListandschema::DirectiveListwere merged into a singleDirectiveListtype, allowing us to deduplicate several helper functions incompat.rs.Notable changes by area
apollo-federation/src/schema/position.rs(-352 lines net): Simplifiedinsert_directive,remove_directive, and field accessor methods now thatComponent<T>is gone. Many methods that previously needed to constructComponentwrappers with origins can passNode<T>directly.apollo-federation/src/compat.rs: Removed duplicate functions that existed to bridgeast::DirectiveListvsschema::DirectiveList— now a singleDirectiveListtype.apollo-federation/src/connectors/: Updated directive construction, schema expansion, and JSON selection apply_to for the newNode-based API.apollo-federation/src/merge.rs/merger/: Updated all merge operations to useNode<T>instead ofComponent<T>.apollo-router/src/: Switched#[expect(clippy::result_large_err)]to#[allow(...)]on 6 functions where the lint fires on Rust 1.98 (CI) but not 1.97 (local), avoiding unfulfilled-expectation errors.Checklist
Exceptions