From 0a94b7421b571af8cde4310153c9650d3406134a Mon Sep 17 00:00:00 2001 From: TylerBloom Date: Sun, 27 Jul 2025 17:54:32 -0400 Subject: [PATCH 1/2] Added a changelog entry for #7929 --- .changesets/fix_tylerb_fed_644.md | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .changesets/fix_tylerb_fed_644.md diff --git a/.changesets/fix_tylerb_fed_644.md b/.changesets/fix_tylerb_fed_644.md new file mode 100644 index 0000000000..dc7dc532a9 --- /dev/null +++ b/.changesets/fix_tylerb_fed_644.md @@ -0,0 +1,49 @@ +### Fix failure to advance path with a direct option affected by progressive override ([PR #7929](https://github.com/apollographql/router/pull/7929)) + +A bug was introduced when porting the query planner to Rust, which affected the ability to generate plans when overriding types in a subgraph that implement interfaces local to that subgraph. As an example, the following query and schema produced a plan in the JS query planner but led to an error in the Rust planner. This has been fixed. +```graphql +# Subgraph A +interface IImage { + id: ID! + absoluteUri: String! +} +type Image implements IImage @key(fields: "id") { + id: ID! + absoluteUri: String! +} +extend type AssetMetadata @key(fields: "id") { + id: ID! + image: Image +} + +# Subgraph B +type Image @key(fields: "id") { + id: ID! + absoluteUri: String! @override(from: "subgraphA", label: "percent(1)") +} +type AssetMetadata @key(fields: "id") { + id: ID! + image: Image @override(from: "subgraphA", label: "percent(1)") +} + +# Subgraph C +type Query { + assetMetadata(id: ID!): AssetMetadata +} +type AssetMetadata @key(fields: "id") { + id: ID! + name: String! +} + +# Query +query ExampleQuery($id: ID!) { + assetMetadata(id: $id) { + __typename + image { + absoluteUri + } + } +} +``` + +By [@TylerBloom](https://github.com/TylerBloom) in https://github.com/apollographql/router/pull/7929 From bb3161204a29ee93ef0f307c501c0cebbdbc4fff Mon Sep 17 00:00:00 2001 From: Tyler Bloom Date: Mon, 28 Jul 2025 09:42:39 -0400 Subject: [PATCH 2/2] Update .changesets/fix_tylerb_fed_644.md Co-authored-by: Jesse Rosenberger --- .changesets/fix_tylerb_fed_644.md | 51 +++++-------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/.changesets/fix_tylerb_fed_644.md b/.changesets/fix_tylerb_fed_644.md index dc7dc532a9..d335f8f5a2 100644 --- a/.changesets/fix_tylerb_fed_644.md +++ b/.changesets/fix_tylerb_fed_644.md @@ -1,49 +1,12 @@ -### Fix failure to advance path with a direct option affected by progressive override ([PR #7929](https://github.com/apollographql/router/pull/7929)) +### Query planning errors with progressive override on interface implementations ([PR #7929](https://github.com/apollographql/router/pull/7929)) -A bug was introduced when porting the query planner to Rust, which affected the ability to generate plans when overriding types in a subgraph that implement interfaces local to that subgraph. As an example, the following query and schema produced a plan in the JS query planner but led to an error in the Rust planner. This has been fixed. -```graphql -# Subgraph A -interface IImage { - id: ID! - absoluteUri: String! -} -type Image implements IImage @key(fields: "id") { - id: ID! - absoluteUri: String! -} -extend type AssetMetadata @key(fields: "id") { - id: ID! - image: Image -} +The router now correctly generates query plans when using [progressive override](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/migrate-fields#incremental-migration-with-progressive-override) (`@override` with labels) on types that implement interfaces within the same subgraph. Previously, the Rust query planner would fail to generate plans for these scenarios with the error `"Was not able to find any options for {}: This shouldn't have happened."`, while the JavaScript planner handled them correctly. -# Subgraph B -type Image @key(fields: "id") { - id: ID! - absoluteUri: String! @override(from: "subgraphA", label: "percent(1)") -} -type AssetMetadata @key(fields: "id") { - id: ID! - image: Image @override(from: "subgraphA", label: "percent(1)") -} +This fix resolves planning failures when your schema uses: +- Interface implementations local to a subgraph +- Progressive override directives on both the implementing type and its fields +- Queries that traverse through the overridden interface implementations -# Subgraph C -type Query { - assetMetadata(id: ID!): AssetMetadata -} -type AssetMetadata @key(fields: "id") { - id: ID! - name: String! -} - -# Query -query ExampleQuery($id: ID!) { - assetMetadata(id: $id) { - __typename - image { - absoluteUri - } - } -} -``` +The router will now successfully plan and execute queries that previously resulted in query planning errors. By [@TylerBloom](https://github.com/TylerBloom) in https://github.com/apollographql/router/pull/7929