diff --git a/.circleci/config.yml b/.circleci/config.yml index eea532b73b..91bce18b05 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,7 @@ version: 2.1 +# Cache key bump: 1 + # These "CircleCI Orbs" are reusable bits of configuration that can be shared # across projects. See https://circleci.com/orbs/ for more information. orbs: diff --git a/CHANGELOG.md b/CHANGELOG.md index adc42690e4..bb4866bf62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to Router will be documented in this file. This project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html). +# [1.57.1] - 2024-10-31 + +## 🐛 Fixes + +### Progressive override: fix query planner cache warmup ([PR #6108](https://github.com/apollographql/router/pull/6108)) + +This fixes an issue in progressive override where the override labels were not transmitted to the query planner during cache warmup. Queries were correctly using the overridden fields at first, but after an update, reverted to non overridden fields, and could not recover. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/6108 + + + # [1.57.0] - 2024-10-22 > [!IMPORTANT] diff --git a/Cargo.lock b/Cargo.lock index 58595d4317..c97f22a4b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,7 +178,7 @@ dependencies = [ [[package]] name = "apollo-federation" -version = "1.57.0" +version = "1.57.1" dependencies = [ "apollo-compiler", "derive_more", @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "apollo-router" -version = "1.57.0" +version = "1.57.1" dependencies = [ "access-json", "ahash", @@ -397,7 +397,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "1.57.0" +version = "1.57.1" dependencies = [ "apollo-parser", "apollo-router", @@ -413,7 +413,7 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.57.0" +version = "1.57.1" dependencies = [ "anyhow", "cargo-scaffold", diff --git a/apollo-federation/Cargo.toml b/apollo-federation/Cargo.toml index 56def7c08c..ce77a6af9e 100644 --- a/apollo-federation/Cargo.toml +++ b/apollo-federation/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-federation" -version = "1.57.0" +version = "1.57.1" authors = ["The Apollo GraphQL Contributors"] edition = "2021" description = "Apollo Federation" diff --git a/apollo-router-benchmarks/Cargo.toml b/apollo-router-benchmarks/Cargo.toml index ad2cd569c7..d26748c696 100644 --- a/apollo-router-benchmarks/Cargo.toml +++ b/apollo-router-benchmarks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-benchmarks" -version = "1.57.0" +version = "1.57.1" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" diff --git a/apollo-router-scaffold/Cargo.toml b/apollo-router-scaffold/Cargo.toml index a598f6f5ee..63bf887d7f 100644 --- a/apollo-router-scaffold/Cargo.toml +++ b/apollo-router-scaffold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-scaffold" -version = "1.57.0" +version = "1.57.1" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" diff --git a/apollo-router-scaffold/templates/base/Cargo.template.toml b/apollo-router-scaffold/templates/base/Cargo.template.toml index 3855918e82..6b9873bf75 100644 --- a/apollo-router-scaffold/templates/base/Cargo.template.toml +++ b/apollo-router-scaffold/templates/base/Cargo.template.toml @@ -22,7 +22,7 @@ apollo-router = { path ="{{integration_test}}apollo-router" } apollo-router = { git="https://github.com/apollographql/router.git", branch="{{branch}}" } {{else}} # Note if you update these dependencies then also update xtask/Cargo.toml -apollo-router = "1.57.0" +apollo-router = "1.57.1" {{/if}} {{/if}} async-trait = "0.1.52" diff --git a/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml b/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml index 0c164855ff..f58bd86237 100644 --- a/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml +++ b/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml @@ -13,7 +13,7 @@ apollo-router-scaffold = { path ="{{integration_test}}apollo-router-scaffold" } {{#if branch}} apollo-router-scaffold = { git="https://github.com/apollographql/router.git", branch="{{branch}}" } {{else}} -apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.57.0" } +apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.57.1" } {{/if}} {{/if}} anyhow = "1.0.58" diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 020e624ef9..ced84ad29f 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router" -version = "1.57.0" +version = "1.57.1" authors = ["Apollo Graph, Inc. "] repository = "https://github.com/apollographql/router/" documentation = "https://docs.rs/apollo-router" @@ -62,7 +62,7 @@ features = ["docs_rs"] access-json = "0.1.0" anyhow = "1.0.86" apollo-compiler.workspace = true -apollo-federation = { path = "../apollo-federation", version = "=1.57.0" } +apollo-federation = { path = "../apollo-federation", version = "=1.57.1" } arc-swap = "1.6.0" async-channel = "1.9.0" async-compression = { version = "0.4.6", features = [ diff --git a/apollo-router/src/query_planner/caching_query_planner.rs b/apollo-router/src/query_planner/caching_query_planner.rs index 1c4e953c05..6ef9a671e8 100644 --- a/apollo-router/src/query_planner/caching_query_planner.rs +++ b/apollo-router/src/query_planner/caching_query_planner.rs @@ -336,6 +336,11 @@ where lock.insert(caching_key.metadata) }); + let _ = context.insert( + LABELS_TO_OVERRIDE_KEY, + caching_key.plan_options.override_conditions.clone(), + ); + let request = QueryPlannerRequest { query, operation_name, diff --git a/apollo-router/tests/samples/enterprise/progressive-override/basic/README.md b/apollo-router/tests/samples/enterprise/progressive-override/basic/README.md new file mode 100644 index 0000000000..3802c3942d --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/basic/README.md @@ -0,0 +1,3 @@ +# Progressive override + +This tests subgraph field migration: https://www.apollographql.com/docs/federation/entities/migrate-fields/ \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/basic/configuration.yaml b/apollo-router/tests/samples/enterprise/progressive-override/basic/configuration.yaml new file mode 100644 index 0000000000..321fd80abd --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/basic/configuration.yaml @@ -0,0 +1,13 @@ +include_subgraph_errors: + all: true + +telemetry: + exporters: + logging: + stdout: + format: text + +experimental_query_planner_mode: legacy + +plugins: + experimental.expose_query_plan: true \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/basic/configuration2.yaml b/apollo-router/tests/samples/enterprise/progressive-override/basic/configuration2.yaml new file mode 100644 index 0000000000..7c445ce5b2 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/basic/configuration2.yaml @@ -0,0 +1,17 @@ +include_subgraph_errors: + all: true + +telemetry: + exporters: + logging: + stdout: + format: text + +experimental_query_planner_mode: legacy + +rhai: + scripts: "tests/samples/enterprise/progressive-override/basic/rhai" + main: "main.rhai" + +plugins: + experimental.expose_query_plan: true \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/basic/plan.json b/apollo-router/tests/samples/enterprise/progressive-override/basic/plan.json new file mode 100644 index 0000000000..6cdf9d7b60 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/basic/plan.json @@ -0,0 +1,226 @@ +{ + "enterprise": true, + "actions": [ + { + "type": "Start", + "schema_path": "./supergraph.graphql", + "configuration_path": "./configuration.yaml", + "subgraphs": { + "Subgraph1": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive1__Subgraph1__0{percent100{__typename id}}", + "operationName": "progressive1__Subgraph1__0" + } + }, + "response": { + "body": { + "data": { + "percent100": { + "__typename": "T", + "id": "1" + } + } + } + } + } + ] + }, + "Subgraph2": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive1__Subgraph2__1($representations:[_Any!]!){_entities(representations:$representations){...on T{foo}}}", + "operationName": "progressive1__Subgraph2__1", + "variables": { + "representations": [ + { + "__typename": "T", + "id": "1" + } + ] + } + } + }, + "response": { + "body": { + "data": { + "_entities": [ + { + "foo": 1 + } + ] + } + } + } + }, + { + "request": { + "body": { + "query": "query progressive2__Subgraph2__0{percent0{foo}}", + "operationName": "progressive2__Subgraph2__0" + } + }, + "response": { + "body": { + "data": { + "percent0": { + "foo": 2 + } + } + } + } + } + ] + } + } + }, + { + "type": "Request", + "request": { + "query": "query progressive1 { percent100 { foo } }" + }, + "headers": { + "apollo-expose-query-plan": "false" + }, + "expected_response": { + "data": { + "percent100": { + "foo": 1 + } + } + } + }, + { + "type": "Request", + "request": { + "query": "query progressive2 { percent0 { foo } }" + }, + "expected_response": { + "data": { + "percent0": { + "foo": 2 + } + } + } + }, + { + "type": "ReloadConfiguration", + "configuration_path": "./configuration2.yaml" + }, + { + "type": "ReloadSubgraphs", + "subgraphs": { + "Subgraph1": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive3__Subgraph1__0{percent100{__typename id}}", + "operationName": "progressive3__Subgraph1__0" + } + }, + "response": { + "body": { + "data": { + "percent100": { + "__typename": "T", + "id": "1" + } + } + } + } + }, + { + "request": { + "body": { + "query": "query progressive4__Subgraph1__0{percent100{bar}}", + "operationName": "progressive4__Subgraph1__0" + } + }, + "response": { + "body": { + "data": { + "percent100": { + "bar": 2 + } + } + } + } + } + ] + }, + "Subgraph2": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive3__Subgraph2__1($representations:[_Any!]!){_entities(representations:$representations){...on T{bar}}}", + "operationName": "progressive3__Subgraph2__1", + "variables": { + "representations": [ + { + "__typename": "T", + "id": "1" + } + ] + } + } + }, + "response": { + "body": { + "data": { + "_entities": [ + { + "bar": 1 + } + ] + } + } + } + } + ] + } + } + }, + { + "type": "Request", + "request": { + "query": "query progressive3 { percent100 { bar } }" + }, + "headers": { + "apollo-expose-query-plan": "false" + }, + "expected_response": { + "data": { + "percent100": { + "bar": 1 + } + } + } + }, + { + "type": "Request", + "request": { + "query": "query progressive4 { percent100 { bar } }" + }, + "headers": { + "apollo-expose-query-plan": "false", + "x-override": "true" + }, + "expected_response": { + "data": { + "percent100": { + "bar": 2 + } + } + } + }, + { + "type": "Stop" + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/basic/rhai/main.rhai b/apollo-router/tests/samples/enterprise/progressive-override/basic/rhai/main.rhai new file mode 100644 index 0000000000..3ecb55cca9 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/basic/rhai/main.rhai @@ -0,0 +1,22 @@ +fn supergraph_service(service) { + const request_callback = Fn("process_request"); + service.map_request(request_callback); +} + +// Add a timestamp to context which we'll use in the response. +fn process_request(request) { + request.context["request_start"] = Router.APOLLO_START.elapsed; + let labels = request.context["apollo_override::unresolved_labels"]; + print(`unresolved: ${labels}`); + + let override = request.context["apollo_override::labels_to_override"]; + print(`override: ${override}`); + + + if "x-override" in request.headers { + if request.headers["x-override"] == "true" { + request.context["apollo_override::labels_to_override"] += "bar"; + } + } +} + diff --git a/apollo-router/tests/samples/enterprise/progressive-override/basic/supergraph.graphql b/apollo-router/tests/samples/enterprise/progressive-override/basic/supergraph.graphql new file mode 100644 index 0000000000..e5ffb347c0 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/basic/supergraph.graphql @@ -0,0 +1,98 @@ +schema + @link(url: "https://specs.apollo.dev/link/v1.0") + @link(url: "https://specs.apollo.dev/join/v0.4", for: EXECUTION) { + query: Query +} + +directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE + +directive @join__field( + graph: join__Graph + requires: join__FieldSet + provides: join__FieldSet + type: String + external: Boolean + override: String + usedOverridden: Boolean + overrideLabel: String +) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION + +directive @join__graph(name: String!, url: String!) on ENUM_VALUE + +directive @join__implements( + graph: join__Graph! + interface: String! +) repeatable on OBJECT | INTERFACE + +directive @join__type( + graph: join__Graph! + key: join__FieldSet + extension: Boolean! = false + resolvable: Boolean! = true + isInterfaceObject: Boolean! = false +) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR + +directive @join__unionMember( + graph: join__Graph! + member: String! +) repeatable on UNION + +directive @link( + url: String + as: String + for: link__Purpose + import: [link__Import] +) repeatable on SCHEMA + +scalar join__FieldSet + +enum join__Graph { + SUBGRAPH1 @join__graph(name: "Subgraph1", url: "https://Subgraph1") + SUBGRAPH2 @join__graph(name: "Subgraph2", url: "https://Subgraph2") +} + +scalar link__Import + +enum link__Purpose { + """ + \`SECURITY\` features provide metadata necessary to securely resolve fields. + """ + SECURITY + + """ + \`EXECUTION\` features provide metadata necessary for operation execution. + """ + EXECUTION +} + +type Query @join__type(graph: SUBGRAPH1) @join__type(graph: SUBGRAPH2) { + percent100: T + @join__field( + graph: SUBGRAPH1 + override: "Subgraph2" + overrideLabel: "percent(100)" + ) + @join__field(graph: SUBGRAPH2, overrideLabel: "percent(100)") + percent0: T + @join__field( + graph: SUBGRAPH1 + override: "Subgraph2" + overrideLabel: "percent(0)" + ) + @join__field(graph: SUBGRAPH2, overrideLabel: "percent(0)") +} + +type T + @join__type(graph: SUBGRAPH1, key: "id") + @join__type(graph: SUBGRAPH2, key: "id") { + id: ID + foo: Int + @join__field(graph: SUBGRAPH1, override: "Subgraph2", overrideLabel: "foo") + @join__field(graph: SUBGRAPH2, overrideLabel: "foo") + bar: Int + @join__field(graph: SUBGRAPH1, override: "Subgraph2", overrideLabel: "bar") + @join__field(graph: SUBGRAPH2, overrideLabel: "bar") + baz: Int + @join__field(graph: SUBGRAPH1, override: "Subgraph2", overrideLabel: "baz") + @join__field(graph: SUBGRAPH2, overrideLabel: "baz") +} diff --git a/apollo-router/tests/samples/enterprise/progressive-override/warmup/README.md b/apollo-router/tests/samples/enterprise/progressive-override/warmup/README.md new file mode 100644 index 0000000000..dfc4a1834c --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/warmup/README.md @@ -0,0 +1,3 @@ +# Progressive override warmup + +This checks progrssive override behaviour across router reloads \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/warmup/configuration.yaml b/apollo-router/tests/samples/enterprise/progressive-override/warmup/configuration.yaml new file mode 100644 index 0000000000..b069d5af18 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/warmup/configuration.yaml @@ -0,0 +1,17 @@ +include_subgraph_errors: + all: true + +supergraph: + query_planning: + warmed_up_queries: 5 + +telemetry: + exporters: + logging: + stdout: + format: text + +experimental_query_planner_mode: legacy + +plugins: + experimental.expose_query_plan: true \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/warmup/configuration2.yaml b/apollo-router/tests/samples/enterprise/progressive-override/warmup/configuration2.yaml new file mode 100644 index 0000000000..413d26aba3 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/warmup/configuration2.yaml @@ -0,0 +1,21 @@ +include_subgraph_errors: + all: true + +supergraph: + query_planning: + warmed_up_queries: 6 + +telemetry: + exporters: + logging: + stdout: + format: text + +experimental_query_planner_mode: legacy + +# rhai: +# scripts: "tests/samples/enterprise/progressive-override/rhai" +# main: "main.rhai" + +plugins: + experimental.expose_query_plan: true \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/warmup/plan.json b/apollo-router/tests/samples/enterprise/progressive-override/warmup/plan.json new file mode 100644 index 0000000000..8f913eb5be --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/warmup/plan.json @@ -0,0 +1,196 @@ +{ + "enterprise": true, + "actions": [ + { + "type": "Start", + "schema_path": "./supergraph.graphql", + "configuration_path": "./configuration.yaml", + "subgraphs": { + "Subgraph1": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive1__Subgraph1__0{percent100{__typename id}}", + "operationName": "progressive1__Subgraph1__0" + } + }, + "response": { + "body": { + "data": { + "percent100": { + "__typename": "T", + "id": "1" + } + } + } + } + } + ] + }, + "Subgraph2": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive1__Subgraph2__1($representations:[_Any!]!){_entities(representations:$representations){...on T{foo}}}", + "operationName": "progressive1__Subgraph2__1", + "variables": { + "representations": [ + { + "__typename": "T", + "id": "1" + } + ] + } + } + }, + "response": { + "body": { + "data": { + "_entities": [ + { + "foo": 1 + } + ] + } + } + } + }, + { + "request": { + "body": { + "query": "query progressive2__Subgraph2__0{percent0{foo}}", + "operationName": "progressive2__Subgraph2__0" + } + }, + "response": { + "body": { + "data": { + "percent0": { + "foo": 2 + } + } + } + } + } + ] + } + } + }, + { + "type": "Request", + "request": { + "query": "query progressive1 { percent100 { foo } }" + }, + "headers": { + "apollo-expose-query-plan": "false" + }, + "expected_response": { + "data": { + "percent100": { + "foo": 1 + } + } + } + }, + { + "type": "ReloadConfiguration", + "configuration_path": "./configuration2.yaml" + }, + { + "type": "ReloadSubgraphs", + "subgraphs": { + "Subgraph1": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive1__Subgraph1__0{percent100{__typename id}}", + "operationName": "progressive1__Subgraph1__0" + } + }, + "response": { + "body": { + "data": { + "percent100": { + "__typename": "T", + "id": "1" + } + } + } + } + } + ] + }, + "Subgraph2": { + "requests": [ + { + "request": { + "body": { + "query": "query progressive1__Subgraph2__1($representations:[_Any!]!){_entities(representations:$representations){...on T{foo}}}", + "operationName": "progressive1__Subgraph2__1", + "variables": { + "representations": [ + { + "__typename": "T", + "id": "1" + } + ] + } + } + }, + "response": { + "body": { + "data": { + "_entities": [ + { + "foo": 1 + } + ] + } + } + } + }, + { + "request": { + "body": { + "query": "query progressive2__Subgraph2__0{percent0{foo}}", + "operationName": "progressive2__Subgraph2__0" + } + }, + "response": { + "body": { + "data": { + "percent0": { + "foo": 2 + } + } + } + } + } + ] + } + } + }, + { + "type": "Request", + "request": { + "query": "query progressive1 { percent100 { foo } }" + }, + "headers": { + "apollo-expose-query-plan": "false" + }, + "expected_response": { + "data": { + "percent100": { + "foo": 1 + } + } + } + }, + { + "type": "Stop" + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/samples/enterprise/progressive-override/warmup/rhai/main.rhai b/apollo-router/tests/samples/enterprise/progressive-override/warmup/rhai/main.rhai new file mode 100644 index 0000000000..3ecb55cca9 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/warmup/rhai/main.rhai @@ -0,0 +1,22 @@ +fn supergraph_service(service) { + const request_callback = Fn("process_request"); + service.map_request(request_callback); +} + +// Add a timestamp to context which we'll use in the response. +fn process_request(request) { + request.context["request_start"] = Router.APOLLO_START.elapsed; + let labels = request.context["apollo_override::unresolved_labels"]; + print(`unresolved: ${labels}`); + + let override = request.context["apollo_override::labels_to_override"]; + print(`override: ${override}`); + + + if "x-override" in request.headers { + if request.headers["x-override"] == "true" { + request.context["apollo_override::labels_to_override"] += "bar"; + } + } +} + diff --git a/apollo-router/tests/samples/enterprise/progressive-override/warmup/supergraph.graphql b/apollo-router/tests/samples/enterprise/progressive-override/warmup/supergraph.graphql new file mode 100644 index 0000000000..e5ffb347c0 --- /dev/null +++ b/apollo-router/tests/samples/enterprise/progressive-override/warmup/supergraph.graphql @@ -0,0 +1,98 @@ +schema + @link(url: "https://specs.apollo.dev/link/v1.0") + @link(url: "https://specs.apollo.dev/join/v0.4", for: EXECUTION) { + query: Query +} + +directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE + +directive @join__field( + graph: join__Graph + requires: join__FieldSet + provides: join__FieldSet + type: String + external: Boolean + override: String + usedOverridden: Boolean + overrideLabel: String +) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION + +directive @join__graph(name: String!, url: String!) on ENUM_VALUE + +directive @join__implements( + graph: join__Graph! + interface: String! +) repeatable on OBJECT | INTERFACE + +directive @join__type( + graph: join__Graph! + key: join__FieldSet + extension: Boolean! = false + resolvable: Boolean! = true + isInterfaceObject: Boolean! = false +) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR + +directive @join__unionMember( + graph: join__Graph! + member: String! +) repeatable on UNION + +directive @link( + url: String + as: String + for: link__Purpose + import: [link__Import] +) repeatable on SCHEMA + +scalar join__FieldSet + +enum join__Graph { + SUBGRAPH1 @join__graph(name: "Subgraph1", url: "https://Subgraph1") + SUBGRAPH2 @join__graph(name: "Subgraph2", url: "https://Subgraph2") +} + +scalar link__Import + +enum link__Purpose { + """ + \`SECURITY\` features provide metadata necessary to securely resolve fields. + """ + SECURITY + + """ + \`EXECUTION\` features provide metadata necessary for operation execution. + """ + EXECUTION +} + +type Query @join__type(graph: SUBGRAPH1) @join__type(graph: SUBGRAPH2) { + percent100: T + @join__field( + graph: SUBGRAPH1 + override: "Subgraph2" + overrideLabel: "percent(100)" + ) + @join__field(graph: SUBGRAPH2, overrideLabel: "percent(100)") + percent0: T + @join__field( + graph: SUBGRAPH1 + override: "Subgraph2" + overrideLabel: "percent(0)" + ) + @join__field(graph: SUBGRAPH2, overrideLabel: "percent(0)") +} + +type T + @join__type(graph: SUBGRAPH1, key: "id") + @join__type(graph: SUBGRAPH2, key: "id") { + id: ID + foo: Int + @join__field(graph: SUBGRAPH1, override: "Subgraph2", overrideLabel: "foo") + @join__field(graph: SUBGRAPH2, overrideLabel: "foo") + bar: Int + @join__field(graph: SUBGRAPH1, override: "Subgraph2", overrideLabel: "bar") + @join__field(graph: SUBGRAPH2, overrideLabel: "bar") + baz: Int + @join__field(graph: SUBGRAPH1, override: "Subgraph2", overrideLabel: "baz") + @join__field(graph: SUBGRAPH2, overrideLabel: "baz") +} diff --git a/apollo-router/tests/samples_tests.rs b/apollo-router/tests/samples_tests.rs index 22e3b31e18..cf2e9b99f7 100644 --- a/apollo-router/tests/samples_tests.rs +++ b/apollo-router/tests/samples_tests.rs @@ -231,6 +231,22 @@ impl TestExecution { path: &Path, out: &mut String, ) -> Result<(), Failed> { + if let Some(requests) = self + .subgraphs_server + .as_ref() + .unwrap() + .received_requests() + .await + { + writeln!(out, "Will reload config, subgraphs received requests:").unwrap(); + for request in requests { + writeln!(out, "\tmethod: {}", request.method).unwrap(); + writeln!(out, "\tpath: {}", request.url).unwrap(); + writeln!(out, "\t{}\n", std::str::from_utf8(&request.body).unwrap()).unwrap(); + } + } else { + writeln!(out, "subgraphs received no requests").unwrap(); + } let mut subgraphs_server = match self.subgraphs_server.take() { Some(subgraphs_server) => subgraphs_server, None => self.start_subgraphs(out).await.0, diff --git a/dockerfiles/tracing/docker-compose.datadog.yml b/dockerfiles/tracing/docker-compose.datadog.yml index c6b46fcd7e..db46f878fb 100644 --- a/dockerfiles/tracing/docker-compose.datadog.yml +++ b/dockerfiles/tracing/docker-compose.datadog.yml @@ -3,7 +3,7 @@ services: apollo-router: container_name: apollo-router - image: ghcr.io/apollographql/router:v1.57.0 + image: ghcr.io/apollographql/router:v1.57.1 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/datadog.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.jaeger.yml b/dockerfiles/tracing/docker-compose.jaeger.yml index 71d4e88301..a38d04b6ba 100644 --- a/dockerfiles/tracing/docker-compose.jaeger.yml +++ b/dockerfiles/tracing/docker-compose.jaeger.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router #build: ./router - image: ghcr.io/apollographql/router:v1.57.0 + image: ghcr.io/apollographql/router:v1.57.1 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/jaeger.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.zipkin.yml b/dockerfiles/tracing/docker-compose.zipkin.yml index 2e6eea86ba..366bff5506 100644 --- a/dockerfiles/tracing/docker-compose.zipkin.yml +++ b/dockerfiles/tracing/docker-compose.zipkin.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router build: ./router - image: ghcr.io/apollographql/router:v1.57.0 + image: ghcr.io/apollographql/router:v1.57.1 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/zipkin.router.yaml:/etc/config/configuration.yaml diff --git a/helm/chart/router/Chart.yaml b/helm/chart/router/Chart.yaml index adfef3761f..9d7c28d3d0 100644 --- a/helm/chart/router/Chart.yaml +++ b/helm/chart/router/Chart.yaml @@ -20,10 +20,10 @@ type: application # so it matches the shape of our release process and release automation. # By proxy of that decision, this version uses SemVer 2.0.0, though the prefix # of "v" is not included. -version: 1.57.0 +version: 1.57.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v1.57.0" +appVersion: "v1.57.1" diff --git a/helm/chart/router/README.md b/helm/chart/router/README.md index 44c483d39b..6dd2aaea77 100644 --- a/helm/chart/router/README.md +++ b/helm/chart/router/README.md @@ -2,7 +2,7 @@ [router](https://github.com/apollographql/router) Rust Graph Routing runtime for Apollo Federation -![Version: 1.57.0](https://img.shields.io/badge/Version-1.57.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.57.0](https://img.shields.io/badge/AppVersion-v1.57.0-informational?style=flat-square) +![Version: 1.57.1](https://img.shields.io/badge/Version-1.57.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.57.1](https://img.shields.io/badge/AppVersion-v1.57.1-informational?style=flat-square) ## Prerequisites @@ -11,7 +11,7 @@ ## Get Repo Info ```console -helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.57.0 +helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.57.1 ``` ## Install Chart @@ -19,7 +19,7 @@ helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.57.0 **Important:** only helm3 is supported ```console -helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.57.0 --values my-values.yaml +helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.57.1 --values my-values.yaml ``` _See [configuration](#configuration) below._ diff --git a/scripts/install.sh b/scripts/install.sh index 1123fb1802..a542864a9a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -11,7 +11,7 @@ BINARY_DOWNLOAD_PREFIX="https://github.com/apollographql/router/releases/downloa # Router version defined in apollo-router's Cargo.toml # Note: Change this line manually during the release steps. -PACKAGE_VERSION="v1.57.0" +PACKAGE_VERSION="v1.57.1" download_binary() { downloader --check