Skip to content

Commit 9e91f47

Browse files
tnineslingclaude
andcommitted
chore: upgrade apollo-compiler to v2.0.0-beta.0
Adopts the 2025 GraphQL spec updates: Operation, Fragment, and VariableDefinition now carry an optional description field. Also renames response_key() to response_name() and FieldError to ExecutionError per the new API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 20551dc commit 9e91f47

11 files changed

Lines changed: 80 additions & 41 deletions

File tree

‎Cargo.lock‎

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
184184
checksum = "b877306ffde4d3cc428bbc8f506fdd67b99255298ae92b919954c0c52f530504"
185185
dependencies = [
186186
"ahash",
187-
"apollo-parser",
187+
"apollo-parser 0.8.6",
188+
"ariadne",
189+
"futures",
190+
"indexmap 2.14.0",
191+
"rowan",
192+
"serde",
193+
"serde_json_bytes",
194+
"thiserror 2.0.20",
195+
"triomphe",
196+
"typed-arena",
197+
]
198+
199+
[[package]]
200+
name = "apollo-compiler"
201+
version = "2.0.0-beta.0"
202+
source = "registry+https://github.com/rust-lang/crates.io-index"
203+
checksum = "f5f6d0efa38a950a9429c90ccb422a68f4a382e5b67abd5ff9a6b8885d787c84"
204+
dependencies = [
205+
"ahash",
206+
"apollo-parser 0.9.0-beta.0",
188207
"ariadne",
189208
"futures",
190209
"indexmap 2.14.0",
@@ -279,9 +298,9 @@ name = "apollo-federation"
279298
version = "2.17.0"
280299
dependencies = [
281300
"ahash",
282-
"apollo-compiler",
301+
"apollo-compiler 2.0.0-beta.0",
283302
"apollo-federation",
284-
"apollo-parser",
303+
"apollo-parser 0.9.0-beta.0",
285304
"clap",
286305
"derive_more",
287306
"dhat",
@@ -331,7 +350,7 @@ name = "apollo-federation-cli"
331350
version = "0.1.0"
332351
dependencies = [
333352
"anyhow",
334-
"apollo-compiler",
353+
"apollo-compiler 2.0.0-beta.0",
335354
"apollo-federation",
336355
"clap",
337356
"insta",
@@ -412,6 +431,17 @@ dependencies = [
412431
"thiserror 2.0.20",
413432
]
414433

434+
[[package]]
435+
name = "apollo-parser"
436+
version = "0.9.0-beta.0"
437+
source = "registry+https://github.com/rust-lang/crates.io-index"
438+
checksum = "0c72cf951e113a1a27378bdddb82ccf08bbe2f49436cf597eb851ae8cb012ea3"
439+
dependencies = [
440+
"memchr",
441+
"rowan",
442+
"thiserror 2.0.20",
443+
]
444+
415445
[[package]]
416446
name = "apollo-qos"
417447
version = "0.5.1"
@@ -451,7 +481,7 @@ dependencies = [
451481
"addr2line 0.27.1",
452482
"ahash",
453483
"anyhow",
454-
"apollo-compiler",
484+
"apollo-compiler 2.0.0-beta.0",
455485
"apollo-environment-detector",
456486
"apollo-errors",
457487
"apollo-federation",
@@ -624,7 +654,7 @@ dependencies = [
624654
name = "apollo-router-benchmarks"
625655
version = "2.17.0"
626656
dependencies = [
627-
"apollo-parser",
657+
"apollo-parser 0.9.0-beta.0",
628658
"apollo-router",
629659
"apollo-smith",
630660
"arbitrary",
@@ -663,12 +693,12 @@ dependencies = [
663693

664694
[[package]]
665695
name = "apollo-smith"
666-
version = "0.16.0"
696+
version = "0.17.0-beta.0"
667697
source = "registry+https://github.com/rust-lang/crates.io-index"
668-
checksum = "231b846cb1c3fd7c15d1a96eeab979883105ca1be4e238ee9cdad32658984c18"
698+
checksum = "c75e0aa74f34bd906db5b991ef9e4d8ea5c85011f333affd2ca11684366395b7"
669699
dependencies = [
670-
"apollo-compiler",
671-
"apollo-parser",
700+
"apollo-compiler 2.0.0-beta.0",
701+
"apollo-parser 0.9.0-beta.0",
672702
"arbitrary",
673703
"indexmap 2.14.0",
674704
"once_cell",
@@ -2531,7 +2561,7 @@ dependencies = [
25312561
"libc",
25322562
"option-ext",
25332563
"redox_users",
2534-
"windows-sys 0.59.0",
2564+
"windows-sys 0.61.0",
25352565
]
25362566

25372567
[[package]]
@@ -2785,7 +2815,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
27852815
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
27862816
dependencies = [
27872817
"libc",
2788-
"windows-sys 0.52.0",
2818+
"windows-sys 0.60.2",
27892819
]
27902820

27912821
[[package]]
@@ -3902,7 +3932,7 @@ dependencies = [
39023932
"libc",
39033933
"percent-encoding",
39043934
"pin-project-lite",
3905-
"socket2 0.5.10",
3935+
"socket2 0.6.3",
39063936
"tokio",
39073937
"tower-service",
39083938
"tracing",
@@ -4949,7 +4979,7 @@ version = "0.50.3"
49494979
source = "registry+https://github.com/rust-lang/crates.io-index"
49504980
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
49514981
dependencies = [
4952-
"windows-sys 0.59.0",
4982+
"windows-sys 0.61.0",
49534983
]
49544984

49554985
[[package]]
@@ -6615,7 +6645,7 @@ version = "0.0.0"
66156645
dependencies = [
66166646
"anyhow",
66176647
"apollo-federation",
6618-
"apollo-parser",
6648+
"apollo-parser 0.9.0-beta.0",
66196649
"apollo-router",
66206650
"apollo-smith",
66216651
"async-trait",
@@ -6779,7 +6809,7 @@ dependencies = [
67796809
"errno",
67806810
"libc",
67816811
"linux-raw-sys",
6782-
"windows-sys 0.52.0",
6812+
"windows-sys 0.61.0",
67836813
]
67846814

67856815
[[package]]
@@ -6846,7 +6876,7 @@ dependencies = [
68466876
"security-framework",
68476877
"security-framework-sys",
68486878
"webpki-root-certs",
6849-
"windows-sys 0.52.0",
6879+
"windows-sys 0.61.0",
68506880
]
68516881

68526882
[[package]]
@@ -7201,11 +7231,11 @@ dependencies = [
72017231

72027232
[[package]]
72037233
name = "shape"
7204-
version = "0.8.0"
7234+
version = "0.9.0-preview.0"
72057235
source = "registry+https://github.com/rust-lang/crates.io-index"
7206-
checksum = "8687837087ee58ab3479bbbf80dd7b2c119a523ddf8b439317078fb22265896f"
7236+
checksum = "0ac234112195c859e0acdd79d080ff8359e84d91025a0ecb802a548295f16168"
72077237
dependencies = [
7208-
"apollo-compiler",
7238+
"apollo-compiler 2.0.0-beta.0",
72097239
"indexmap 2.14.0",
72107240
"serde_json",
72117241
"serde_json_bytes",
@@ -7369,7 +7399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
73697399
checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e"
73707400
dependencies = [
73717401
"libc",
7372-
"windows-sys 0.60.2",
7402+
"windows-sys 0.61.0",
73737403
]
73747404

73757405
[[package]]
@@ -7509,7 +7539,7 @@ name = "supergraph_sdl"
75097539
version = "0.1.0"
75107540
dependencies = [
75117541
"anyhow",
7512-
"apollo-compiler",
7542+
"apollo-compiler 1.32.0",
75137543
"apollo-router",
75147544
"async-trait",
75157545
"tower",
@@ -7669,10 +7699,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
76697699
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
76707700
dependencies = [
76717701
"fastrand",
7672-
"getrandom 0.3.4",
7702+
"getrandom 0.4.2",
76737703
"once_cell",
76747704
"rustix",
7675-
"windows-sys 0.52.0",
7705+
"windows-sys 0.61.0",
76767706
]
76777707

76787708
[[package]]
@@ -7682,7 +7712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
76827712
checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874"
76837713
dependencies = [
76847714
"rustix",
7685-
"windows-sys 0.59.0",
7715+
"windows-sys 0.61.0",
76867716
]
76877717

76887718
[[package]]
@@ -8873,7 +8903,7 @@ version = "0.1.10"
88738903
source = "registry+https://github.com/rust-lang/crates.io-index"
88748904
checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22"
88758905
dependencies = [
8876-
"windows-sys 0.48.0",
8906+
"windows-sys 0.60.2",
88778907
]
88788908

88798909
[[package]]

‎Cargo.toml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ debug = 1
4848
# https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
4949
[workspace.dependencies]
5050
ahash = "0.8.11"
51-
apollo-compiler = "1.32.0"
52-
apollo-parser = "0.8.6"
53-
apollo-smith = "0.16.0"
51+
apollo-compiler = "=2.0.0-beta.0"
52+
apollo-parser = "=0.9.0-beta.0"
53+
apollo-smith = "=0.17.0-beta.0"
5454
async-trait = "0.1.77"
5555
encoding_rs = "0.8"
5656
heck = "0.5.0"

‎apollo-federation/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ url = "2"
5959
either = "1.13.0"
6060
tracing = "0.1.40"
6161
ron = { version = "0.12.0", optional = true }
62-
shape = "=0.8.0"
62+
shape = "=0.9.0-preview.0"
6363
form_urlencoded = "1.2.1"
6464
parking_lot = "0.12.4"
6565
mime = "0.3.17"

‎apollo-federation/src/correctness/response_shape.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ impl ResponseShapeContext {
10551055
// Record this selection's definition.
10561056
let value = response_shape
10571057
.definitions_per_response_key
1058-
.entry(field.response_key().clone())
1058+
.entry(field.response_name().clone())
10591059
.or_default();
10601060
value.insert_possible_definition(
10611061
self.type_condition.clone(),

‎apollo-federation/src/operation/mod.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,6 +2811,7 @@ impl TryFrom<&Operation> for executable::Operation {
28112811
fn try_from(normalized_operation: &Operation) -> Result<Self, Self::Error> {
28122812
let operation_type: executable::OperationType = normalized_operation.root_kind.into();
28132813
Ok(Self {
2814+
description: None,
28142815
operation_type,
28152816
name: normalized_operation.name.clone(),
28162817
variables: normalized_operation.variables.deref().clone(),

‎apollo-federation/src/operation/optimize.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl Operation {
137137

138138
let operation_type: executable::OperationType = self.root_kind.into();
139139
let operation = executable::Operation {
140+
description: None,
140141
operation_type,
141142
name: self.name.clone(),
142143
variables: self.variables.deref().clone(),
@@ -409,6 +410,7 @@ impl<'a> FragmentGenerator<'a> {
409410
// minify current selection set and extract named fragment
410411
let minified_selection_set = self.minify(selection_set)?;
411412
let new_fragment = Fragment {
413+
description: None,
412414
name: self.next_name(),
413415
selection_set: minified_selection_set,
414416
directives: Default::default(),

‎apollo-federation/src/query_plan/fetch_dependency_graph.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,6 +2906,7 @@ impl FetchDependencyGraphNode {
29062906
let context_variable_definitions = self.inputs.iter().flat_map(|inputs| {
29072907
inputs.used_contexts.iter().map(|(context, ty)| {
29082908
Node::new(VariableDefinition {
2909+
description: None,
29092910
name: context.clone(),
29102911
ty: ty.clone(),
29112912
default_value: None,
@@ -3452,6 +3453,7 @@ fn representations_variable_definition(
34523453
let any_name = schema.federation_type_name_in_schema(ANY_SCALAR_NAME)?;
34533454

34543455
Ok(VariableDefinition {
3456+
description: None,
34553457
name: FEDERATION_REPRESENTATIONS_VAR_NAME,
34563458
ty: Type::Named(any_name).non_null().list().non_null().into(),
34573459
default_value: None,

‎apollo-router/src/plugins/mock_subgraphs/mod.rs‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use apollo_compiler::ExecutableDocument;
77
use apollo_compiler::Schema;
88
use apollo_compiler::ast::OperationType;
99
use apollo_compiler::resolvers::Execution;
10-
use apollo_compiler::resolvers::FieldError;
10+
use apollo_compiler::resolvers::ExecutionError;
1111
use apollo_compiler::resolvers::ObjectValue;
1212
use apollo_compiler::resolvers::ResolveInfo;
1313
use apollo_compiler::resolvers::ResolvedValue;
@@ -297,7 +297,7 @@ impl ObjectValue for RootResolver<'_> {
297297
fn resolve_field<'a>(
298298
&'a self,
299299
info: &'a ResolveInfo<'a>,
300-
) -> Result<ResolvedValue<'a>, FieldError> {
300+
) -> Result<ResolvedValue<'a>, ExecutionError> {
301301
if info.field_name() != "_entities" {
302302
let in_entity = false;
303303
return resolve_normal_field(
@@ -309,17 +309,17 @@ impl ObjectValue for RootResolver<'_> {
309309
}
310310
let entities = info.arguments()["representations"]
311311
.as_array()
312-
.ok_or(FieldError {
312+
.ok_or(ExecutionError {
313313
message: "expected array `representations`".into(),
314314
})?
315315
.iter()
316316
.map(move |representation| {
317-
let representation = representation.as_object().ok_or(FieldError {
317+
let representation = representation.as_object().ok_or(ExecutionError {
318318
message: "expected object `representations[n]`".into(),
319319
})?;
320320
let entity = self
321321
.find_entities(representation)
322-
.ok_or_else(|| FieldError {
322+
.ok_or_else(|| ExecutionError {
323323
message: format!(
324324
"no mocked entity found for representation {representation:?}"
325325
),
@@ -353,7 +353,7 @@ impl ObjectValue for MockResolver<'_> {
353353
fn resolve_field<'a>(
354354
&'a self,
355355
info: &'a ResolveInfo<'a>,
356-
) -> Result<ResolvedValue<'a>, FieldError> {
356+
) -> Result<ResolvedValue<'a>, ExecutionError> {
357357
resolve_normal_field(self.response_extensions, self.in_entity, self.mocks, info)
358358
}
359359
}
@@ -371,10 +371,10 @@ fn resolve_normal_field<'a>(
371371
in_entity: bool,
372372
mocks: &'a JsonMap,
373373
info: &'a ResolveInfo<'a>,
374-
) -> Result<ResolvedValue<'a>, FieldError> {
374+
) -> Result<ResolvedValue<'a>, ExecutionError> {
375375
// TODO: find some way to vary response based on arguments?
376376
let field_name = info.field_name();
377-
let mock = mocks.get(field_name).ok_or_else(|| FieldError {
377+
let mock = mocks.get(field_name).ok_or_else(|| ExecutionError {
378378
message: format!("field '{field_name}' not found in mocked data"),
379379
})?;
380380
resolve_value(response_extensions, in_entity, mock, info)
@@ -385,7 +385,7 @@ fn resolve_value<'a>(
385385
in_entity: bool,
386386
mock: &'a JsonValue,
387387
info: &'a ResolveInfo<'a>,
388-
) -> Result<ResolvedValue<'a>, FieldError> {
388+
) -> Result<ResolvedValue<'a>, ExecutionError> {
389389
match mock {
390390
JsonValue::Object(map) => {
391391
if !in_entity && let Some(keys) = map.get("__cacheTags") {

‎apollo-router/src/plugins/response_cache/plugin.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ fn get_invalidation_root_keys_from_schema(
18061806
fn resolve_field<'a>(
18071807
&'a self,
18081808
info: &'a resolvers::ResolveInfo<'a>,
1809-
) -> Result<resolvers::ResolvedValue<'a>, resolvers::FieldError> {
1809+
) -> Result<resolvers::ResolvedValue<'a>, resolvers::ExecutionError> {
18101810
let mut result = self.result.borrow_mut();
18111811
let Ok(keys) = &mut *result else {
18121812
return Ok(resolvers::ResolvedValue::SkipForPartialExecution);

‎apollo-router/src/query_planner/subgraph_context.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ fn transform_operation(
245245
if arguments.contains(v.name.as_str()) {
246246
for i in 0..*count {
247247
new_variables.push(Node::new(VariableDefinition {
248+
description: None,
248249
name: Name::new_unchecked(&format!("{}_{}", v.name.as_str(), i)),
249250
ty: v.ty.clone(),
250251
default_value: v.default_value.clone(),
@@ -440,6 +441,7 @@ mod subgraph_context_unit_tests {
440441
// add_alias = true will add a "_3:" alias
441442
let clone = selection_set.clone();
442443
let mut operation = Node::new(executable::Operation {
444+
description: None,
443445
operation_type: executable::OperationType::Query,
444446
name: None,
445447
variables: vec![],

0 commit comments

Comments
 (0)