diff --git a/.circleci/config.yml b/.circleci/config.yml index 1dc4843759..cb5214a584 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,12 +59,12 @@ executors: resource_class: macos.m1.medium.gen1 windows_build: &windows_build_executor machine: - image: "windows-server-2019-vs2019:2022.08.1" + image: "windows-server-2019-vs2019:2024.02.21" resource_class: windows.xlarge shell: bash.exe --login -eo pipefail windows_test: &windows_test_executor machine: - image: "windows-server-2019-vs2019:2022.08.1" + image: "windows-server-2019-vs2019:2024.02.21" resource_class: windows.xlarge shell: bash.exe --login -eo pipefail @@ -320,7 +320,8 @@ commands: if [[ ! -d "$HOME/.cargo" ]]; then curl https://sh.rustup.rs -sSf -o rustup.sh chmod 755 ./rustup.sh - ./rustup.sh -y --profile minimal --component clippy --component rustfmt + ./rustup.sh -y --profile minimal --component clippy --component rustfmt --default-toolchain none + $HOME/.cargo/bin/rustc -V fi echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> "$BASH_ENV" @@ -344,13 +345,29 @@ commands: command: | rustup target add x86_64-apple-darwin + - when: + condition: + equal: [ *arm_linux_test_executor, << parameters.platform >> ] + steps: + - run: + name: Install nightly Rust to build the fuzzers + command: | + rustup install nightly + install_extra_tools: steps: - run: name: Install cargo deny, about, edit command: | if [[ ! -f "$HOME/.cargo/bin/cargo-deny$EXECUTABLE_SUFFIX" ]]; then - cargo install --locked cargo-deny cargo-about cargo-edit + cargo install --locked --version 0.14.21 cargo-deny + cargo install --locked --version 0.6.1 cargo-about + cargo install --locked --version 0.12.2 cargo-edit + cargo install --locked --version 0.12.0 cargo-fuzz + fi + + if [[ ! -f "$HOME/.cargo/bin/cargo-nextest$EXECUTABLE_SUFFIX" ]]; then + cargo install --locked --version 0.9.70 cargo-nextest fi fetch_dependencies: @@ -475,6 +492,9 @@ commands: - "<< pipeline.parameters.merge_version >>-test-<< parameters.variant >>" - run: name: Run tests + environment: + # Use the settings from the "ci" profile in nextest configuration. + NEXTEST_PROFILE: ci command: xtask test --workspace --locked - run: name: Delete large files from cache @@ -489,6 +509,13 @@ commands: key: "<< pipeline.parameters.merge_version >>-test-<< parameters.variant >>" paths: - target + - store_test_results: + # The results from nextest that power the CircleCI Insights. + path: ./target/nextest/ci/junit.xml + fuzz_build: + steps: + - run: cargo +nightly fuzz build + jobs: lint: environment: @@ -543,6 +570,11 @@ jobs: - setup_environment: platform: << parameters.platform >> - xtask_test + - when: + condition: + equal: [ *arm_linux_test_executor, << parameters.platform >> ] + steps: + - fuzz_build test_updated: environment: diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000000..8ea7636d0c --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,11 @@ +[profile.ci] +# Print out output for failing tests as soon as they fail, and also at the end +# of the run (for easy scrollability). +failure-output = "immediate-final" + +# Do not cancel the test run on the first failure. +fail-fast = false + +# Write to output for persistence to CircleCI +[profile.ci.junit] +path = "junit.xml" diff --git a/.github/workflows/update_apollo_protobuf.yaml b/.github/workflows/update_apollo_protobuf.yaml new file mode 100644 index 0000000000..b2c660a66b --- /dev/null +++ b/.github/workflows/update_apollo_protobuf.yaml @@ -0,0 +1,31 @@ +name: Update Apollo Protobuf +run-name: ${{ github.actor }} is updating the Apollo Protobuf ๐Ÿš€ +on: + workflow_dispatch: + schedule: + # On the 5 of every hour + - cron: '5 * * * *' +jobs: + Update-Protobuf-Schema: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - name: Make changes to pull request + run: | + curl -f https://usage-reporting.api.apollographql.com/proto/reports.proto > ./apollo-router/src/plugins/telemetry/proto/reports.proto + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + commit-message: Update Apollo Protobuf schema + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + branch: create-pull-request/apollo-proto-updates + team-reviewers: | + router + add-paths: | + apollo-router/src/plugins/telemetry/proto/reports.proto + delete-branch: true + title: 'chore: Update Apollo Protobuf' + body: | + This updates the copy of `reports.proto` which this repository relies on with the latest copy fetched via our public endpoint. diff --git a/CHANGELOG.md b/CHANGELOG.md index d1bc6fdedf..c26398ac2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,188 @@ 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.46.0] - 2024-05-07 + +## ๐Ÿš€ Features + +### Entity cache preview: support queries with private scope ([PR #4855](https://github.com/apollographql/router/pull/4855)) + +**This feature is part of the work on [subgraph entity caching](https://www.apollographql.com/docs/router/configuration/entity-caching/), currently in preview.** + +The router now supports caching responses marked with `private` scope. This caching currently works only on subgraph responses without any schema-level information. + +For details about the caching behavior, see [PR #4855](https://github.com/apollographql/router/pull/4855) + + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4855 + +### Add support of custom events defined by YAML for telemetry ([Issue #4320](https://github.com/apollographql/router/issues/4320)) + +Users can now [configure telemetry events via YAML](https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/events/) +to log that something has happened (e.g. a request had errors of a particular type) without reaching for Rhai or a custom plugin. + +Events may be triggered on conditions and can include information in the request/response pipeline as attributes. + +Here is an example of configuration: + +```yaml +telemetry: + instrumentation: + events: + router: + # Standard events + request: info + response: info + error: info + + # Custom events + my.event: + message: "my event message" + level: info + on: request + attributes: + http.response.body.size: false + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + + supergraph: + # Custom event configuration for supergraph service ... + subgraph: + # Custom event configuration for subgraph service . +``` + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/4956 + +### Ability to ignore auth prefixes in the JWT plugin + +The router now supports a configuration to ignore header prefixes with the JWT plugin. Given that many application headers use the format of `Authorization: `, this option enables the router to process requests for specific schemes within the `Authorization` header while ignoring others. + +For example, you can configure the router to process requests with `Authorization: Bearer ` defined while ignoring others such as `Authorization: Basic `: + +```yaml title="router.yaml" +authentication: + router: + jwt: + header_name: authorization + header_value_prefix: "Bearer" + ignore_mismatched_prefix: true +``` + +If the header prefix is an empty string, this option is ignored. + +By [@lleadbet](https://github.com/lleadbet) in https://github.com/apollographql/router/pull/4718 + +### Support conditions on custom attributes for spans and a new selector for GraphQL errors ([Issue #4336](https://github.com/apollographql/router/issues/4336)) + +The router now supports conditionally adding attributes on a span and the new `on_graphql_error` selector that is set to true if the response body contains GraphQL errors. + +An example configuration using `condition` in `attributes` and `on_graphql_error`: + +```yaml +telemetry: + instrumentation: + spans: + router: + attributes: + otel.status_description: + static: "there was an error" + condition: + any: + - not: + eq: + - response_status: code + - 200 + - eq: + - on_graphql_error + - true +``` + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/4987 + +## ๐Ÿ› Fixes + +### Federation v2.7.5 ([PR #5064](https://github.com/apollographql/router/pull/5064)) + +This brings in a query planner fix released in v2.7.5 of Apollo Federation. Notably, from [its changelog](https://github.com/apollographql/federation/releases/tag/%40apollo%2Fquery-planner%402.7.5): + +- Fix issue with missing fragment definitions due to `generateQueryFragments`. ([#2993](https://github.com/apollographql/federation/pull/2993)) + + An incorrect implementation detail in `generateQueryFragments` caused certain queries to be missing fragment definitions, causing the operation to be invalid and fail early in the request life-cycle (before execution). Specifically, subsequent fragment "candidates" with the same type condition and the same length of selections as a previous fragment weren't correctly added to the list of fragments. An example of an affected query is: + + ```graphql + query { + t { + ... on A { + x + y + } + } + t2 { + ... on A { + y + z + } + } + } + ``` + + In this case, the second selection set would be converted to an inline fragment spread to subgraph fetches, but the fragment definition would be missing +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/5064 + +### Use supergraph schema to extract authorization info ([PR #5047](https://github.com/apollographql/router/pull/5047)) + +The router now uses the supergraph schema to extract authorization info, as authorization information may not be available on the query planner's subgraph schemas. This reverts the authorization changes made in [PR #4975](https://github.com/apollographql/router/pull/4975). + +By [@tninesling](https://github.com/tninesling) in https://github.com/apollographql/router/pull/5047 + +### Filter fetches added to batch during batch creation ([PR #5034](https://github.com/apollographql/router/pull/5034)) + +Previously, the router didn't filter query hashes when creating batches. This could result in failed queries because the additional hashes could incorrectly make a query appear to be committed when it wasn't actually registered in a batch. + +This release fixes this issue by filtering query hashes during batch creation. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/5034 + +### Use `subgraph.name` attribute instead of `apollo.subgraph.name` ([PR #5012](https://github.com/apollographql/router/pull/5012)) + +In the router v1.45.0, subgraph name mapping didn't work correctly in the Datadog exporter. + +The Datadog exporter does some explicit mapping of attributes and was using a value `apollo.subgraph.name` that the latest versions of the router don't use. The correct choice is `subgraph.name`. + +This release updates the mapping to reflect the change and fixes subgraph name mapping for Datadog. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/5012 + +## ๐Ÿ“š Documentation + +### Document traffic shaping default configuration ([PR #4953](https://github.com/apollographql/router/pull/4953)) + +The documentation for [configuring traffic shaping](https://www.apollographql.com/docs/router/configuration/traffic-shaping#configuration) has been updated to clarify that it's enabled by default with preset values. This setting has been the default since PR [#3330](https://github.com/apollographql/router/pull/3330), which landed in [v1.23.0](https://github.com/apollographql/router/releases/tag/v1.23.0). + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/4953 + +## ๐Ÿงช Experimental + +### Experimental type conditioned fetching ([PR #4748](https://github.com/apollographql/router/pull/4748)) + +This release introduces an experimental configuration to enable type-conditioned fetching. + +Previously, when querying a field that was in a path of two or more unions, the query planner wasn't able to handle different selections and would aggressively collapse selections in fetches. This resulted in incorrect plans. + +Enabling the `experimental_type_conditioned_fetching` option can fix this issue by configuring the query planner to fetch with type conditions. + + +```yaml +experimental_type_conditioned_fetching: true # false by default +``` + +By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/4748 + + + # [1.45.1] - 2024-04-26 ## ๐Ÿ› Fixes diff --git a/Cargo.lock b/Cargo.lock index f7e2a3fbad..b000800666 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -250,7 +250,7 @@ dependencies = [ [[package]] name = "apollo-router" -version = "1.45.1" +version = "1.46.0" dependencies = [ "access-json", "anyhow", @@ -337,6 +337,7 @@ dependencies = [ "opentelemetry-stdout", "opentelemetry-zipkin", "opentelemetry_api", + "opentelemetry_sdk 0.20.0", "p256 0.13.2", "parking_lot", "paste", @@ -411,7 +412,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "1.45.1" +version = "1.46.0" dependencies = [ "apollo-parser", "apollo-router", @@ -427,7 +428,7 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.45.1" +version = "1.46.0" dependencies = [ "anyhow", "cargo-scaffold", @@ -942,7 +943,7 @@ dependencies = [ "hex", "hmac", "http 0.2.11", - "http 1.1.0", + "http 1.0.0", "once_cell", "percent-encoding", "sha2", @@ -1035,7 +1036,7 @@ dependencies = [ "aws-smithy-types", "bytes", "http 0.2.11", - "http 1.1.0", + "http 1.0.0", "pin-project-lite", "tokio", "tracing", @@ -1908,9 +1909,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ "cfg-if", "cpufeatures", @@ -2606,9 +2607,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" [[package]] name = "filetime" @@ -3301,9 +3302,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" dependencies = [ "bytes", "fnv", @@ -3959,6 +3960,7 @@ checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", + "serde", ] [[package]] @@ -5702,9 +5704,9 @@ dependencies = [ [[package]] name = "router-bridge" -version = "0.5.18+v2.7.2" +version = "0.5.21+v2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673a5f56dd761938c87c89d33affb6f53e0129457d14bf12389f0cb4ebe74cfd" +checksum = "b2142445fe3fe2aae7a3c3c5083d1211a448a0dabb489a14dd90d427cf6c0b13" dependencies = [ "anyhow", "async-channel 1.9.0", @@ -5962,9 +5964,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +checksum = "0afe01b987fac84253ce8acd5c05af9941975e4dee5b4f2d826b6947be8ec2c7" dependencies = [ "dyn-clone", "schemars_derive", @@ -5975,14 +5977,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +checksum = "d253e72f060451e9e5615a1686f3cb4ff87c4e70504c79bdab8fb3b010cd4e97" dependencies = [ "proc-macro2 1.0.76", "quote 1.0.35", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -6116,13 +6118,13 @@ dependencies = [ [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3" dependencies = [ "proc-macro2 1.0.76", "quote 1.0.35", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -8131,7 +8133,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "serde", "zeroize", diff --git a/Cargo.toml b/Cargo.toml index dfebd2c8b7..316fa6236a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,9 +59,6 @@ reqwest = { version = "0.11.24", default-features = false, features = [ "stream", ] } -# note: this dependency should _always_ be pinned, prefix the version with an `=` -router-bridge = "=0.5.18+v2.7.2" - schemars = { version = "0.8.16", features = ["url"] } serde = { version = "1.0.197", features = ["derive", "rc"] } serde_json = { version = "1.0.114", features = [ diff --git a/apollo-router-benchmarks/Cargo.toml b/apollo-router-benchmarks/Cargo.toml index 2c0e6c32b8..91086440e3 100644 --- a/apollo-router-benchmarks/Cargo.toml +++ b/apollo-router-benchmarks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-benchmarks" -version = "1.45.1" +version = "1.46.0" 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 95d195dfbd..52b903aea1 100644 --- a/apollo-router-scaffold/Cargo.toml +++ b/apollo-router-scaffold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-scaffold" -version = "1.45.1" +version = "1.46.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" diff --git a/apollo-router-scaffold/templates/base/Cargo.toml b/apollo-router-scaffold/templates/base/Cargo.toml index 78785f27e4..f91e353964 100644 --- a/apollo-router-scaffold/templates/base/Cargo.toml +++ b/apollo-router-scaffold/templates/base/Cargo.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.45.1" +apollo-router = "1.46.0" {{/if}} {{/if}} async-trait = "0.1.52" diff --git a/apollo-router-scaffold/templates/base/xtask/Cargo.toml b/apollo-router-scaffold/templates/base/xtask/Cargo.toml index f0cf6dc71b..4b855db8a5 100644 --- a/apollo-router-scaffold/templates/base/xtask/Cargo.toml +++ b/apollo-router-scaffold/templates/base/xtask/Cargo.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.45.1" } +apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.46.0" } {{/if}} {{/if}} anyhow = "1.0.58" diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index a3eebd4ab9..6f9a73fcdc 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router" -version = "1.45.1" +version = "1.46.0" authors = ["Apollo Graph, Inc. "] repository = "https://github.com/apollographql/router/" documentation = "https://docs.rs/apollo-router" @@ -146,6 +146,7 @@ once_cell = "1.19.0" # https://github.com/apollographql/router/pull/1509. A comment which exists # there (and on `tracing` packages below) should be updated should this change. opentelemetry = { version = "0.20.0", features = ["trace", "metrics"] } +opentelemetry_sdk = { version = "0.20.0", default-features = false, features = ["trace"] } opentelemetry_api = "0.20.0" opentelemetry-aws = "0.8.0" opentelemetry-datadog = { version = "0.8.0", features = ["reqwest-client"] } @@ -180,8 +181,10 @@ rand = "0.8.5" rhai = { version = "=1.17.1", features = ["sync", "serde", "internals"] } regex = "1.10.3" reqwest.workspace = true + # note: this dependency should _always_ be pinned, prefix the version with an `=` -router-bridge = "=0.5.18+v2.7.2" +router-bridge = "=0.5.21+v2.7.5" + rust-embed = "8.2.0" rustls = "0.21.11" rustls-native-certs = "0.6.3" @@ -226,7 +229,6 @@ tower-service = "0.3.2" tracing = "0.1.37" tracing-core = "0.1.31" tracing-futures = { version = "0.2.5", features = ["futures-03"] } -tracing-opentelemetry = "0.21.0" tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] } trust-dns-resolver = "0.23.2" url = { version = "2.5.0", features = ["serde"] } @@ -241,7 +243,7 @@ tokio-tungstenite = { version = "0.20.1", features = [ tokio-rustls = "0.24.1" http-serde = "1.1.3" hmac = "0.12.1" -parking_lot = "0.12.1" +parking_lot = { version = "0.12.1", features = ["serde"] } memchr = "2.7.1" brotli = "3.4.0" zstd = "0.13.0" @@ -323,6 +325,7 @@ tracing-subscriber = { version = "0.3", default-features = false, features = [ "env-filter", "fmt", ] } +tracing-opentelemetry = "0.21.0" tracing-test = "0.2.4" walkdir = "2.4.0" wiremock = "0.5.22" diff --git a/apollo-router/src/apollo_studio_interop/mod.rs b/apollo-router/src/apollo_studio_interop/mod.rs index 7cd27c3a7d..7b4e9caa73 100644 --- a/apollo-router/src/apollo_studio_interop/mod.rs +++ b/apollo-router/src/apollo_studio_interop/mod.rs @@ -32,6 +32,7 @@ pub(crate) struct ComparableUsageReporting { } /// Enum specifying the result of a comparison. +#[derive(Debug)] pub(crate) enum UsageReportingComparisonResult { /// The UsageReporting instances are the same Equal, @@ -167,6 +168,7 @@ impl UsageReportingGenerator<'_> { .get(&fragment_node.fragment_name) { e.insert(fragment.clone()); + self.extract_signature_fragments(&fragment.selection_set); } } } @@ -369,7 +371,7 @@ fn format_selection_set(selection_set: &SelectionSet, f: &mut fmt::Formatter) -> && field_str .chars() .last() - .map_or(false, |c| c.is_alphanumeric()) + .map_or(false, |c| c.is_alphanumeric() || c == '_') { f.write_str(" ")?; } @@ -414,17 +416,25 @@ fn format_field(field: &Node, f: &mut fmt::Formatter) -> fmt::Result { // The graphql-js implementation will use newlines and indentation instead of commas if the length of the "arg line" is // over 80 characters. This "arg line" includes the alias followed by ": " if the field has an alias (which is never - // the case for now), followed by all argument names and values separated by ": ", surrounded with brackets. Our usage - // reporting plugin replaces all newlines + indentation with a single space, so we have to replace commas with spaces if - // the line length is too long. + // the case for any signatures that the JS implementation formatted), followed by the field name, followed by all argument + // names and values separated by ": ", surrounded with brackets. Our usage reporting plugin replaces all newlines + + // indentation with a single space, so we have to replace commas with spaces if the line length is too long. let arg_strings: Vec = sorted_args .iter() .map(|a| ApolloReportingSignatureFormatter::Argument(a).to_string()) .collect(); - // Adjust for incorrect spacing generated by the argument formatter - 2 extra characters for the surrounding brackets, plus - // 2 extra characters per argument for the separating space and the space between the argument name and type. - let original_line_length = - 2 + arg_strings.iter().map(|s| s.len()).sum::() + (arg_strings.len() * 2); + // Adjust for incorrect spacing generated by the argument formatter. We end summing up: + // * the length of field name + // * 2 extra characters for the surrounding brackets + // * the length of all formatted arguments + // * one extra character per argument since the JS implementation inserts a space between the argument name and value + // * two extra character per argument except the last one since the JS implementation inserts a separating comma and space + // between arguments (but not the last one) + let original_line_length = field.name.len() + + 2 + + arg_strings.iter().map(|s| s.len()).sum::() + + arg_strings.len() + + ((arg_strings.len() - 1) * 2); let separator = if original_line_length > 80 { " " } else { "," }; for (index, arg_string) in arg_strings.iter().enumerate() { @@ -437,7 +447,7 @@ fn format_field(field: &Node, f: &mut fmt::Formatter) -> fmt::Result { || arg_string .chars() .last() - .map_or(true, |c| c.is_alphanumeric())) + .map_or(true, |c| c.is_alphanumeric() || c == '_')) { f.write_str(separator)?; } diff --git a/apollo-router/src/apollo_studio_interop/testdata/schema_interop.graphql b/apollo-router/src/apollo_studio_interop/testdata/schema_interop.graphql index e41e500782..1467d12abe 100644 --- a/apollo-router/src/apollo_studio_interop/testdata/schema_interop.graphql +++ b/apollo-router/src/apollo_studio_interop/testdata/schema_interop.graphql @@ -146,6 +146,10 @@ type Mutation @join__type(graph: MAIN) { noInputMutation: EverythingResponse! + graph(id: ID!): TestGraphResponse! + mutation2(id: ID!): TestGraphResponse2! + mutation3(id: ID!): TestGraphResponse3! + mutation4(id1: ID!, id2: ID!): ID! } input NestedEnumInputType @@ -183,6 +187,8 @@ type Query defaultArgQuery(stringInput: String! = "default", inputType: AnotherInputType = {anotherInput: "inputDefault"}): BasicResponse! inputTypeDefaultQuery(input: InputTypeWithDefault): BasicResponse! sortQuery(listInput: [String!]!, stringInput: String!, nullableStringInput: String, INTInput: Int!, floatInput: Float!, boolInput: Boolean!, enumInput: SomeEnum, idInput: ID!): SortResponse! + manyArgsQuery(arg1: String, arg2: String, arg3: String, arg4: String, arg5: String, arg6: String, arg7: String): EverythingResponse! + underscoreQuery(arg_: String, _arg2: String, _arg3_: String): UnderscoreResponse } enum SomeEnum @@ -203,6 +209,33 @@ type SortResponse CCC: Int } +type TestGraphResponse + @join__type(graph: MAIN) +{ + updateCheckConfiguration(downgradeDefaultValueChange: Boolean, downgradeStaticChecks: Boolean): Int! +} + +type TestGraphResponse2 + @join__type(graph: MAIN) +{ + updateCheckConfiguration(arg1: Boolean, arg2: Boolean): Int! +} + +type TestGraphResponse3 + @join__type(graph: MAIN) +{ + updateCheckConfiguration(arg1: String, arg2: String, arg3: String): Int! +} + +type UnderscoreResponse + @join__type(graph: MAIN) +{ + _: String + _name: String + _name_: String + name_: String +} + type Subscription @join__type(graph: MAIN) { diff --git a/apollo-router/src/apollo_studio_interop/tests.rs b/apollo-router/src/apollo_studio_interop/tests.rs index ac2dd78215..54aa28a555 100644 --- a/apollo-router/src/apollo_studio_interop/tests.rs +++ b/apollo-router/src/apollo_studio_interop/tests.rs @@ -1197,7 +1197,7 @@ async fn test_operation_arg_always_commas() { } #[test(tokio::test)] -async fn test_comma_edge_case() { +async fn test_comma_separator_always() { let schema_str = include_str!("testdata/schema_interop.graphql"); let query_str = r#"query QueryCommaEdgeCase { @@ -1234,6 +1234,288 @@ async fn test_comma_edge_case() { assert_bridge_results(schema_str, query_str, expected_sig, &expected_refs).await; } +#[test(tokio::test)] +async fn test_nested_fragments() { + let schema_str = include_str!("testdata/schema_interop.graphql"); + + let query_str = " + fragment UnionType1Fragment on UnionType1 { + unionType1Field + } + + fragment ObjectResponseFragment on ObjectTypeResponse { + intField + } + + fragment EverythingResponseFragment on EverythingResponse { + listOfObjects { + ...ObjectResponseFragment + ... on ObjectTypeResponse { + stringField + } + } + } + + query NestedFragmentQuery { + noInputQuery { + ...EverythingResponseFragment + ... on EverythingResponse { + listOfUnions { + ...UnionType1Fragment + ... on UnionType2 { + unionType2Field + } + } + } + } + }"; + + let schema = Schema::parse_and_validate(schema_str, "schema.graphql").unwrap(); + let doc = ExecutableDocument::parse(&schema, query_str, "query.graphql").unwrap(); + + let generated = + generate_usage_reporting(&doc, &doc, &Some("NestedFragmentQuery".into()), &schema); + + let expected_sig = "# NestedFragmentQuery\nfragment EverythingResponseFragment on EverythingResponse{listOfObjects{...ObjectResponseFragment...on ObjectTypeResponse{stringField}}}fragment ObjectResponseFragment on ObjectTypeResponse{intField}fragment UnionType1Fragment on UnionType1{unionType1Field}query NestedFragmentQuery{noInputQuery{...EverythingResponseFragment...on EverythingResponse{listOfUnions{...UnionType1Fragment...on UnionType2{unionType2Field}}}}}"; + let expected_refs: HashMap = HashMap::from([ + ( + "Query".into(), + ReferencedFieldsForType { + field_names: vec!["noInputQuery".into()], + is_interface: false, + }, + ), + ( + "EverythingResponse".into(), + ReferencedFieldsForType { + field_names: vec!["listOfObjects".into(), "listOfUnions".into()], + is_interface: false, + }, + ), + ( + "ObjectTypeResponse".into(), + ReferencedFieldsForType { + field_names: vec!["intField".into(), "stringField".into()], + is_interface: false, + }, + ), + ( + "UnionType1".into(), + ReferencedFieldsForType { + field_names: vec!["unionType1Field".into()], + is_interface: false, + }, + ), + ( + "UnionType2".into(), + ReferencedFieldsForType { + field_names: vec!["unionType2Field".into()], + is_interface: false, + }, + ), + ]); + + assert_expected_results(&generated, expected_sig, &expected_refs); + assert_bridge_results(schema_str, query_str, expected_sig, &expected_refs).await; +} + +#[test(tokio::test)] +async fn test_mutation_space() { + let schema_str = include_str!("testdata/schema_interop.graphql"); + + let query_str = " + mutation Test_Mutation_Space($arg1withalongnamegoeshere0123456789: Boolean) { + mutation2(id: \"x\") { + updateCheckConfiguration(arg1: $arg1withalongnamegoeshere0123456789, arg2: false) + } + }"; + + let schema = Schema::parse_and_validate(schema_str, "schema.graphql").unwrap(); + let doc = ExecutableDocument::parse(&schema, query_str, "query.graphql").unwrap(); + + let generated = + generate_usage_reporting(&doc, &doc, &Some("Test_Mutation_Space".into()), &schema); + + let expected_sig = "# Test_Mutation_Space\nmutation Test_Mutation_Space($arg1withalongnamegoeshere0123456789:Boolean){mutation2(id:\"\"){updateCheckConfiguration(arg1:$arg1withalongnamegoeshere0123456789 arg2:false)}}"; + let expected_refs: HashMap = HashMap::from([ + ( + "Mutation".into(), + ReferencedFieldsForType { + field_names: vec!["mutation2".into()], + is_interface: false, + }, + ), + ( + "TestGraphResponse2".into(), + ReferencedFieldsForType { + field_names: vec!["updateCheckConfiguration".into()], + is_interface: false, + }, + ), + ]); + + assert_expected_results(&generated, expected_sig, &expected_refs); + assert_bridge_results(schema_str, query_str, expected_sig, &expected_refs).await; +} + +#[test(tokio::test)] +async fn test_mutation_comma() { + let schema_str = include_str!("testdata/schema_interop.graphql"); + + let query_str = " + mutation Test_Mutation_Comma($arg1withalongnamegoeshere012345678: Boolean) { + mutation2(id: \"x\") { + updateCheckConfiguration(arg1: $arg1withalongnamegoeshere012345678, arg2: false) + } + }"; + + let schema = Schema::parse_and_validate(schema_str, "schema.graphql").unwrap(); + let doc = ExecutableDocument::parse(&schema, query_str, "query.graphql").unwrap(); + + let generated = + generate_usage_reporting(&doc, &doc, &Some("Test_Mutation_Comma".into()), &schema); + + let expected_sig = "# Test_Mutation_Comma\nmutation Test_Mutation_Comma($arg1withalongnamegoeshere012345678:Boolean){mutation2(id:\"\"){updateCheckConfiguration(arg1:$arg1withalongnamegoeshere012345678,arg2:false)}}"; + let expected_refs: HashMap = HashMap::from([ + ( + "Mutation".into(), + ReferencedFieldsForType { + field_names: vec!["mutation2".into()], + is_interface: false, + }, + ), + ( + "TestGraphResponse2".into(), + ReferencedFieldsForType { + field_names: vec!["updateCheckConfiguration".into()], + is_interface: false, + }, + ), + ]); + + assert_expected_results(&generated, expected_sig, &expected_refs); + assert_bridge_results(schema_str, query_str, expected_sig, &expected_refs).await; +} + +#[test(tokio::test)] +async fn test_comma_lower_bound() { + let schema_str = include_str!("testdata/schema_interop.graphql"); + + let query_str = " + query TestCommaLowerBound($arg: String, $slightlyTooLongName1234: String) { + manyArgsQuery(arg1: $arg, arg2: $arg, arg3: $arg, arg4: $slightlyTooLongName1234) { + enumResponse + } + }"; + + let schema = Schema::parse_and_validate(schema_str, "schema.graphql").unwrap(); + let doc = ExecutableDocument::parse(&schema, query_str, "query.graphql").unwrap(); + + let generated = + generate_usage_reporting(&doc, &doc, &Some("TestCommaLowerBound".into()), &schema); + + let expected_sig = "# TestCommaLowerBound\nquery TestCommaLowerBound($arg:String,$slightlyTooLongName1234:String){manyArgsQuery(arg1:$arg arg2:$arg arg3:$arg arg4:$slightlyTooLongName1234){enumResponse}}"; + let expected_refs: HashMap = HashMap::from([ + ( + "Query".into(), + ReferencedFieldsForType { + field_names: vec!["manyArgsQuery".into()], + is_interface: false, + }, + ), + ( + "EverythingResponse".into(), + ReferencedFieldsForType { + field_names: vec!["enumResponse".into()], + is_interface: false, + }, + ), + ]); + + assert_expected_results(&generated, expected_sig, &expected_refs); + assert_bridge_results(schema_str, query_str, expected_sig, &expected_refs).await; +} + +#[test(tokio::test)] +async fn test_comma_upper_bound() { + let schema_str = include_str!("testdata/schema_interop.graphql"); + + let query_str = " + query TestCommaUpperBound($arg: String, $slightlyTooLongName12345: String) { + manyArgsQuery(arg1: $arg, arg2: $arg, arg3: $arg, arg4: $slightlyTooLongName12345) { + enumResponse + } + }"; + + let schema = Schema::parse_and_validate(schema_str, "schema.graphql").unwrap(); + let doc = ExecutableDocument::parse(&schema, query_str, "query.graphql").unwrap(); + + let generated = + generate_usage_reporting(&doc, &doc, &Some("TestCommaUpperBound".into()), &schema); + + let expected_sig = "# TestCommaUpperBound\nquery TestCommaUpperBound($arg:String,$slightlyTooLongName12345:String){manyArgsQuery(arg1:$arg arg2:$arg arg3:$arg arg4:$slightlyTooLongName12345){enumResponse}}"; + let expected_refs: HashMap = HashMap::from([ + ( + "Query".into(), + ReferencedFieldsForType { + field_names: vec!["manyArgsQuery".into()], + is_interface: false, + }, + ), + ( + "EverythingResponse".into(), + ReferencedFieldsForType { + field_names: vec!["enumResponse".into()], + is_interface: false, + }, + ), + ]); + + assert_expected_results(&generated, expected_sig, &expected_refs); + assert_bridge_results(schema_str, query_str, expected_sig, &expected_refs).await; +} + +#[test(tokio::test)] +async fn test_underscore() { + let schema_str = include_str!("testdata/schema_interop.graphql"); + + let query_str = " + query UnderscoreQuery($arg2_: String, $_arg3_: String) { + underscoreQuery(arg_: \"x\", _arg2: $arg2_, _arg3_: $_arg3_) { + _ + _name + _name_ + name_ + } + }"; + + let schema = Schema::parse_and_validate(schema_str, "schema.graphql").unwrap(); + let doc = ExecutableDocument::parse(&schema, query_str, "query.graphql").unwrap(); + + let generated = generate_usage_reporting(&doc, &doc, &Some("UnderscoreQuery".into()), &schema); + + let expected_sig = "# UnderscoreQuery\nquery UnderscoreQuery($_arg3_:String,$arg2_:String){underscoreQuery(_arg2:$arg2_,_arg3_:$_arg3_,arg_:\"\"){_ _name _name_ name_}}"; + let expected_refs: HashMap = HashMap::from([ + ( + "Query".into(), + ReferencedFieldsForType { + field_names: vec!["underscoreQuery".into()], + is_interface: false, + }, + ), + ( + "UnderscoreResponse".into(), + ReferencedFieldsForType { + field_names: vec!["_".into(), "_name".into(), "_name_".into(), "name_".into()], + is_interface: false, + }, + ), + ]); + + assert_expected_results(&generated, expected_sig, &expected_refs); + assert_bridge_results(schema_str, query_str, expected_sig, &expected_refs).await; +} + #[test(tokio::test)] async fn test_compare() { let source = ComparableUsageReporting { diff --git a/apollo-router/src/axum_factory/axum_http_server_factory.rs b/apollo-router/src/axum_factory/axum_http_server_factory.rs index 325febd73d..6424a20448 100644 --- a/apollo-router/src/axum_factory/axum_http_server_factory.rs +++ b/apollo-router/src/axum_factory/axum_http_server_factory.rs @@ -656,7 +656,11 @@ async fn handle_graphql( let dur = context.busy_time(); let processing_seconds = dur.as_secs_f64(); - tracing::info!(histogram.apollo_router_processing_time = processing_seconds,); + f64_histogram!( + "apollo.router.processing.time", + "Time spent by the router actually working on the request, not waiting for its network calls or other queries being processed", + processing_seconds + ); match res { Err(err) => { diff --git a/apollo-router/src/batching.rs b/apollo-router/src/batching.rs index 79a7e29f83..302c7d72d9 100644 --- a/apollo-router/src/batching.rs +++ b/apollo-router/src/batching.rs @@ -19,11 +19,11 @@ use tokio::task::JoinHandle; use tower::BoxError; use tracing::Instrument; use tracing::Span; -use tracing_opentelemetry::OpenTelemetrySpanExt; use crate::error::FetchError; use crate::error::SubgraphBatchingError; use crate::graphql; +use crate::plugins::telemetry::otel::span_ext::OpenTelemetrySpanExt; use crate::query_planner::fetch::QueryHash; use crate::services::http::HttpClientServiceFactory; use crate::services::process_batches; diff --git a/apollo-router/src/configuration/metrics.rs b/apollo-router/src/configuration/metrics.rs index 67b405b318..036e5d1536 100644 --- a/apollo-router/src/configuration/metrics.rs +++ b/apollo-router/src/configuration/metrics.rs @@ -308,6 +308,12 @@ impl InstrumentData { "$..tracing.zipkin[?(@.enabled==true)]", opt.events, "$..events", + opt.events.router, + "$..events.router", + opt.events.supergraph, + "$..events.supergraph", + opt.events.subgraph, + "$..events.subgraph", opt.instruments, "$..instruments", opt.instruments.router, diff --git a/apollo-router/src/configuration/mod.rs b/apollo-router/src/configuration/mod.rs index 2b8eb42115..e3839b45bb 100644 --- a/apollo-router/src/configuration/mod.rs +++ b/apollo-router/src/configuration/mod.rs @@ -46,14 +46,9 @@ use crate::cache::DEFAULT_CACHE_CAPACITY; use crate::configuration::schema::Mode; use crate::graphql; use crate::notification::Notify; -#[cfg(not(test))] -use crate::notification::RouterBroadcasts; use crate::plugin::plugins; -#[cfg(not(test))] use crate::plugins::subscription::SubscriptionConfig; -#[cfg(not(test))] use crate::plugins::subscription::APOLLO_SUBSCRIPTION_PLUGIN; -#[cfg(not(test))] use crate::plugins::subscription::APOLLO_SUBSCRIPTION_PLUGIN_NAME; use crate::uplink::UplinkConfig; use crate::ApolloRouterError; @@ -71,7 +66,6 @@ mod upgrade; mod yaml; // TODO: Talk it through with the teams -#[cfg(not(test))] static HEARTBEAT_TIMEOUT_DURATION_SECONDS: u64 = 15; static SUPERGRAPH_ENDPOINT_REGEX: Lazy = Lazy::new(|| { @@ -172,6 +166,10 @@ pub struct Configuration { #[serde(default)] pub(crate) experimental_apollo_metrics_generation_mode: ApolloMetricsGenerationMode, + /// Set the query planner implementation to use. + #[serde(default)] + pub(crate) experimental_query_planner_mode: QueryPlannerMode, + /// Plugin configuration #[serde(default)] pub(crate) plugins: UserPlugins, @@ -191,6 +189,10 @@ pub struct Configuration { /// Batching configuration. #[serde(default)] pub(crate) batching: Batching, + + /// Type conditioned fetching configuration. + #[serde(default)] + pub(crate) experimental_type_conditioned_fetching: bool, } impl PartialEq for Configuration { @@ -229,6 +231,21 @@ pub(crate) enum ApolloMetricsGenerationMode { Both, } +/// Query planner modes. +#[derive(Clone, PartialEq, Eq, Default, Derivative, Serialize, Deserialize, JsonSchema)] +#[derivative(Debug)] +#[serde(rename_all = "lowercase")] +pub(crate) enum QueryPlannerMode { + /// Use the new Rust-based implementation. + New, + /// Use the old JavaScript-based implementation. + #[default] + Legacy, + /// Use Rust-based and Javascript-based implementations side by side, logging warnings if the + /// implementations disagree. + Both, +} + impl<'de> serde::Deserialize<'de> for Configuration { fn deserialize(deserializer: D) -> Result where @@ -250,35 +267,47 @@ impl<'de> serde::Deserialize<'de> for Configuration { tls: Tls, apq: Apq, persisted_queries: PersistedQueries, - #[serde(skip)] - uplink: UplinkConfig, limits: Limits, experimental_chaos: Chaos, batching: Batching, + experimental_type_conditioned_fetching: bool, experimental_apollo_metrics_generation_mode: ApolloMetricsGenerationMode, + experimental_api_schema_generation_mode: ApiSchemaMode, + experimental_query_planner_mode: QueryPlannerMode, } let ad_hoc: AdHocConfiguration = serde::Deserialize::deserialize(deserializer)?; - Configuration::builder() - .health_check(ad_hoc.health_check) - .sandbox(ad_hoc.sandbox) - .homepage(ad_hoc.homepage) - .supergraph(ad_hoc.supergraph) - .cors(ad_hoc.cors) - .plugins(ad_hoc.plugins.plugins.unwrap_or_default()) - .apollo_plugins(ad_hoc.apollo_plugins.plugins) - .tls(ad_hoc.tls) - .apq(ad_hoc.apq) - .persisted_query(ad_hoc.persisted_queries) - .operation_limits(ad_hoc.limits) - .chaos(ad_hoc.experimental_chaos) - .uplink(ad_hoc.uplink) - .batching(ad_hoc.batching) - .experimental_apollo_metrics_generation_mode( - ad_hoc.experimental_apollo_metrics_generation_mode, - ) - .build() - .map_err(|e| serde::de::Error::custom(e.to_string())) + let notify = Configuration::notify(&ad_hoc.apollo_plugins.plugins) + .map_err(|e| serde::de::Error::custom(e.to_string()))?; + + // Use a struct literal instead of a builder to ensure this is exhaustive + Configuration { + health_check: ad_hoc.health_check, + sandbox: ad_hoc.sandbox, + homepage: ad_hoc.homepage, + supergraph: ad_hoc.supergraph, + cors: ad_hoc.cors, + tls: ad_hoc.tls, + apq: ad_hoc.apq, + persisted_queries: ad_hoc.persisted_queries, + limits: ad_hoc.limits, + experimental_chaos: ad_hoc.experimental_chaos, + experimental_api_schema_generation_mode: ad_hoc.experimental_api_schema_generation_mode, + experimental_apollo_metrics_generation_mode: ad_hoc + .experimental_apollo_metrics_generation_mode, + experimental_type_conditioned_fetching: ad_hoc.experimental_type_conditioned_fetching, + experimental_query_planner_mode: ad_hoc.experimental_query_planner_mode, + plugins: ad_hoc.plugins, + apollo_plugins: ad_hoc.apollo_plugins, + batching: ad_hoc.batching, + + // serde(skip) + notify, + uplink: None, + validated_yaml: None, + } + .validate() + .map_err(|e| serde::de::Error::custom(e.to_string())) } } @@ -293,6 +322,7 @@ fn test_listen() -> ListenAddr { SocketAddr::from_str("127.0.0.1:0").unwrap().into() } +#[cfg(test)] #[buildstructor::buildstructor] impl Configuration { #[builder] @@ -305,28 +335,18 @@ impl Configuration { plugins: Map, apollo_plugins: Map, tls: Option, - notify: Option>, apq: Option, persisted_query: Option, operation_limits: Option, chaos: Option, uplink: Option, experimental_api_schema_generation_mode: Option, + experimental_type_conditioned_fetching: Option, batching: Option, experimental_apollo_metrics_generation_mode: Option, + experimental_query_planner_mode: Option, ) -> Result { - #[cfg(not(test))] - let notify_queue_cap = match apollo_plugins.get(APOLLO_SUBSCRIPTION_PLUGIN_NAME) { - Some(plugin_conf) => { - let conf = serde_json::from_value::(plugin_conf.clone()) - .map_err(|err| ConfigurationError::PluginConfiguration { - plugin: APOLLO_SUBSCRIPTION_PLUGIN.to_string(), - error: format!("{err:?}"), - })?; - conf.queue_capacity - } - None => None, - }; + let notify = Self::notify(&apollo_plugins)?; let conf = Self { validated_yaml: Default::default(), @@ -339,8 +359,11 @@ impl Configuration { persisted_queries: persisted_query.unwrap_or_default(), limits: operation_limits.unwrap_or_default(), experimental_chaos: chaos.unwrap_or_default(), - experimental_api_schema_generation_mode: experimental_api_schema_generation_mode.unwrap_or_default(), - experimental_apollo_metrics_generation_mode: experimental_apollo_metrics_generation_mode.unwrap_or_default(), + experimental_api_schema_generation_mode: experimental_api_schema_generation_mode + .unwrap_or_default(), + experimental_apollo_metrics_generation_mode: + experimental_apollo_metrics_generation_mode.unwrap_or_default(), + experimental_query_planner_mode: experimental_query_planner_mode.unwrap_or_default(), plugins: UserPlugins { plugins: Some(plugins), }, @@ -350,17 +373,49 @@ impl Configuration { tls: tls.unwrap_or_default(), uplink, batching: batching.unwrap_or_default(), - #[cfg(test)] - notify: notify.unwrap_or_default(), - #[cfg(not(test))] - notify: notify.map(|n| n.set_queue_size(notify_queue_cap)) - .unwrap_or_else(|| Notify::builder().and_queue_size(notify_queue_cap).ttl(Duration::from_secs(HEARTBEAT_TIMEOUT_DURATION_SECONDS)).router_broadcasts(Arc::new(RouterBroadcasts::new())).heartbeat_error_message(graphql::Response::builder().errors(vec![graphql::Error::builder().message("the connection has been closed because it hasn't heartbeat for a while").extension_code("SUBSCRIPTION_HEARTBEAT_ERROR").build()]).build()).build()), + experimental_type_conditioned_fetching: experimental_type_conditioned_fetching + .unwrap_or_default(), + notify, }; conf.validate() } } +impl Configuration { + fn notify( + apollo_plugins: &Map, + ) -> Result, ConfigurationError> { + if cfg!(test) { + return Ok(Notify::for_tests()); + } + let notify_queue_cap = match apollo_plugins.get(APOLLO_SUBSCRIPTION_PLUGIN_NAME) { + Some(plugin_conf) => { + let conf = serde_json::from_value::(plugin_conf.clone()) + .map_err(|err| ConfigurationError::PluginConfiguration { + plugin: APOLLO_SUBSCRIPTION_PLUGIN.to_string(), + error: format!("{err:?}"), + })?; + conf.queue_capacity + } + None => None, + }; + Ok(Notify::builder() + .and_queue_size(notify_queue_cap) + .ttl(Duration::from_secs(HEARTBEAT_TIMEOUT_DURATION_SECONDS)) + .heartbeat_error_message( + graphql::Response::builder() + .errors(vec![ + graphql::Error::builder() + .message("the connection has been closed because it hasn't heartbeat for a while") + .extension_code("SUBSCRIPTION_HEARTBEAT_ERROR") + .build() + ]) + .build() + ).build()) + } +} + impl Default for Configuration { fn default() -> Self { // We want to trigger all defaulting logic so don't use the raw builder. @@ -389,7 +444,9 @@ impl Configuration { uplink: Option, batching: Option, experimental_api_schema_generation_mode: Option, + experimental_type_conditioned_fetching: Option, experimental_apollo_metrics_generation_mode: Option, + experimental_query_planner_mode: Option, ) -> Result { let configuration = Self { validated_yaml: Default::default(), @@ -404,6 +461,7 @@ impl Configuration { .unwrap_or_default(), experimental_apollo_metrics_generation_mode: experimental_apollo_metrics_generation_mode.unwrap_or_default(), + experimental_query_planner_mode: experimental_query_planner_mode.unwrap_or_default(), plugins: UserPlugins { plugins: Some(plugins), }, @@ -415,6 +473,8 @@ impl Configuration { apq: apq.unwrap_or_default(), persisted_queries: persisted_query.unwrap_or_default(), uplink, + experimental_type_conditioned_fetching: experimental_type_conditioned_fetching + .unwrap_or_default(), batching: batching.unwrap_or_default(), }; @@ -502,6 +562,15 @@ impl Configuration { } } + if self.experimental_query_planner_mode == QueryPlannerMode::New + && self.experimental_apollo_metrics_generation_mode != ApolloMetricsGenerationMode::New + { + return Err(ConfigurationError::InvalidConfiguration { + message: "`experimental_query_planner_mode: new` requires `experimental_apollo_metrics_generation_mode: new`", + error: "either change to some other query planner mode, or change to new metrics generation".into() + }); + } + Ok(self) } } diff --git a/apollo-router/src/configuration/schema.rs b/apollo-router/src/configuration/schema.rs index 7bfc790fd8..4223c835de 100644 --- a/apollo-router/src/configuration/schema.rs +++ b/apollo-router/src/configuration/schema.rs @@ -3,6 +3,7 @@ use std::borrow::Cow; use std::cmp::Ordering; use std::fmt::Write; +use std::sync::OnceLock; use itertools::Itertools; use jsonschema::error::ValidationErrorKind; @@ -82,19 +83,17 @@ pub(crate) fn validate_yaml_configuration( error: e.to_string(), } })?; - let schema = serde_json::to_value(generate_config_schema()).map_err(|e| { - ConfigurationError::InvalidConfiguration { - message: "failed to parse schema", - error: e.to_string(), - } - })?; - let schema = JSONSchema::options() - .with_draft(Draft::Draft7) - .compile(&schema) - .map_err(|e| ConfigurationError::InvalidConfiguration { - message: "failed to compile schema", - error: e.to_string(), - })?; + + static SCHEMA: OnceLock = OnceLock::new(); + let schema = SCHEMA.get_or_init(|| { + let config_schema = serde_json::to_value(generate_config_schema()) + .expect("failed to parse configuration schema"); + + JSONSchema::options() + .with_draft(Draft::Draft7) + .compile(&config_schema) + .expect("failed to compile configuration schema") + }); if migration == Mode::Upgrade { let upgraded = upgrade_configuration(&yaml, true)?; @@ -251,6 +250,10 @@ pub(crate) fn validate_yaml_configuration( .collect(); if !unknown_fields.is_empty() { + // If you end up here while contributing, + // It might mean you forgot to update + // `impl<'de> serde::Deserialize<'de> for Configuration + // In `/apollo-router/src/configuration/mod.rs` return Err(ConfigurationError::InvalidConfiguration { message: "unknown fields", error: format!( diff --git a/apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@telemetry.router.yaml.snap b/apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@telemetry.router.yaml.snap index 842ddd0340..1431bd3f5a 100644 --- a/apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@telemetry.router.yaml.snap +++ b/apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@telemetry.router.yaml.snap @@ -7,7 +7,10 @@ expression: "&metrics.non_zero()" datapoints: - value: 1 attributes: - opt.events: false + opt.events: true + opt.events.router: true + opt.events.subgraph: true + opt.events.supergraph: true opt.instruments: true opt.instruments.default_attribute_requirement_level: false opt.instruments.router: true diff --git a/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap b/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap index 504605271e..2917751d0d 100644 --- a/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap +++ b/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap @@ -77,7 +77,6 @@ expression: "&schema" }, "redis": { "description": "Configures and activates the Redis cache", - "default": null, "type": "object", "required": [ "urls" @@ -105,24 +104,20 @@ expression: "&schema" }, "timeout": { "description": "Redis request timeout (default: 2ms)", - "default": null, "type": "string", "nullable": true }, "tls": { "description": "TLS client configuration", - "default": null, "type": "object", "properties": { "certificate_authorities": { "description": "list of certificate authorities in PEM format", - "default": null, "type": "string", "nullable": true }, "client_authentication": { "description": "client certificate authentication", - "default": null, "type": "object", "required": [ "certificate_chain", @@ -149,7 +144,6 @@ expression: "&schema" }, "ttl": { "description": "TTL for entries", - "default": null, "type": "string", "nullable": true }, @@ -251,6 +245,11 @@ expression: "&schema" "default": "Bearer", "type": "string" }, + "ignore_other_prefixes": { + "description": "Whether to ignore any mismatched prefixes", + "default": false, + "type": "boolean" + }, "jwks": { "description": "List of JWKS used to verify tokens", "type": "array", @@ -262,7 +261,6 @@ expression: "&schema" "properties": { "algorithms": { "description": "List of accepted algorithms. Possible values are `HS256`, `HS384`, `HS512`, `ES256`, `ES384`, `RS256`, `RS384`, `RS512`, `PS256`, `PS384`, `PS512`, `EdDSA`", - "default": null, "type": "array", "items": { "type": "string" @@ -1325,7 +1323,6 @@ expression: "&schema" }, "expose_headers": { "description": "Which response headers should be made available to scripts running in the browser, in response to a cross-origin request.", - "default": null, "type": "array", "items": { "type": "string" @@ -1334,7 +1331,6 @@ expression: "&schema" }, "match_origins": { "description": "`Regex`es you want to match the origins against to determine if they're allowed. Defaults to an empty list. Note that `origins` will be evaluated before `match_origins`", - "default": null, "type": "array", "items": { "type": "string" @@ -1343,7 +1339,6 @@ expression: "&schema" }, "max_age": { "description": "The `Access-Control-Max-Age` header value in time units", - "default": null, "type": "string" }, "methods": { @@ -1457,7 +1452,6 @@ expression: "&schema" "properties": { "force_reload": { "description": "Force a hot reload of the Router (as if the schema or configuration had changed) at a regular time interval.", - "default": null, "type": "string", "nullable": true } @@ -1468,29 +1462,129 @@ expression: "&schema" "description": "Demand control configuration", "type": "object", "required": [ - "algorithm", - "enabled" + "enabled", + "mode", + "strategy" ], "properties": { - "algorithm": { - "description": "The algorithm used to calculate the cost of an incoming request", + "enabled": { + "description": "Enable demand control", + "type": "boolean" + }, + "mode": { + "description": "The mode that the demand control plugin should operate in. - Measure: The plugin will measure the cost of incoming requests but not reject them. - Enforce: The plugin will enforce the cost of incoming requests and reject them if the algorithm indicates that they should be rejected.", + "type": "string", + "enum": [ + "measure", + "enforce" + ] + }, + "strategy": { + "description": "The strategy used to reject requests.", "oneOf": [ { "description": "A simple, statically-defined cost mapping for operations and types.\n\nOperation costs: - Mutation: 10 - Query: 0 - Subscription 0\n\nType costs: - Object: 1 - Interface: 1 - Union: 1 - Scalar: 0 - Enum: 0", - "type": "string", - "enum": [ - "basic" - ] + "type": "object", + "required": [ + "static_estimated" + ], + "properties": { + "static_estimated": { + "type": "object", + "required": [ + "list_size", + "max" + ], + "properties": { + "list_size": { + "description": "The assumed length of lists returned by the operation.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "max": { + "description": "The maximum cost of a query", + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "test" + ], + "properties": { + "test": { + "type": "object", + "required": [ + "error", + "stage" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "estimated_cost_too_expensive", + "actual_cost_too_expensive" + ] + }, + "stage": { + "type": "string", + "enum": [ + "execution_request", + "execution_response", + "subgraph_request", + "subgraph_response" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false } ] - }, - "enabled": { - "description": "Enable demand control", - "type": "boolean" } }, "additionalProperties": false }, + "experimental_query_planner_mode": { + "description": "Set the query planner implementation to use.", + "default": "legacy", + "oneOf": [ + { + "description": "Use the new Rust-based implementation.", + "type": "string", + "enum": [ + "new" + ] + }, + { + "description": "Use the old JavaScript-based implementation.", + "type": "string", + "enum": [ + "legacy" + ] + }, + { + "description": "Use Rust-based and Javascript-based implementations side by side, logging warnings if the implementations disagree.", + "type": "string", + "enum": [ + "both" + ] + } + ] + }, + "experimental_type_conditioned_fetching": { + "description": "Type conditioned fetching configuration.", + "default": false, + "type": "boolean" + }, "forbid_mutations": { "description": "Forbid mutations configuration", "type": "boolean" @@ -1933,7 +2027,6 @@ expression: "&schema" }, "graph_ref": { "description": "Graph reference This will allow you to redirect from the Apollo Router landing page back to Apollo Studio Explorer", - "default": null, "type": "string", "nullable": true } @@ -1983,7 +2076,6 @@ expression: "&schema" }, "max_aliases": { "description": "If set, requests with operations with more aliases than this maximum are rejected with a HTTP 400 Bad Request response and GraphQL error with `\"extensions\": {\"code\": \"MAX_ALIASES_LIMIT\"}`", - "default": null, "type": "integer", "format": "uint32", "minimum": 0.0, @@ -1991,7 +2083,6 @@ expression: "&schema" }, "max_depth": { "description": "If set, requests with operations deeper than this maximum are rejected with a HTTP 400 Bad Request response and GraphQL error with `\"extensions\": {\"code\": \"MAX_DEPTH_LIMIT\"}`\n\nCounts depth of an operation, looking at its selection sets, including fields in fragments and inline fragments. The following example has a depth of 3.\n\n```graphql query getProduct { book { # 1 ...bookDetails } }\n\nfragment bookDetails on Book { details { # 2 ... on ProductDetailsBook { country # 3 } } } ```", - "default": null, "type": "integer", "format": "uint32", "minimum": 0.0, @@ -1999,7 +2090,6 @@ expression: "&schema" }, "max_height": { "description": "If set, requests with operations higher than this maximum are rejected with a HTTP 400 Bad Request response and GraphQL error with `\"extensions\": {\"code\": \"MAX_DEPTH_LIMIT\"}`\n\nHeight is based on simple merging of fields using the same name or alias, but only within the same selection set. For example `name` here is only counted once and the query has height 3, not 4:\n\n```graphql query { name { first } name { last } } ```\n\nThis may change in a future version of Apollo Router to do [full field merging across fragments][merging] instead.\n\n[merging]: https://spec.graphql.org/October2021/#sec-Field-Selection-Merging]", - "default": null, "type": "integer", "format": "uint32", "minimum": 0.0, @@ -2007,7 +2097,6 @@ expression: "&schema" }, "max_root_fields": { "description": "If set, requests with operations with more root fields than this maximum are rejected with a HTTP 400 Bad Request response and GraphQL error with `\"extensions\": {\"code\": \"MAX_ROOT_FIELDS_LIMIT\"}`\n\nThis limit counts only the top level fields in a selection set, including fragments and inline fragments.", - "default": null, "type": "integer", "format": "uint32", "minimum": 0.0, @@ -2095,7 +2184,6 @@ expression: "&schema" }, "plugins": { "description": "Plugin configuration", - "default": null, "properties": { "experimental.broken": { "description": "This is a broken plugin for testing purposes only.", @@ -2184,7 +2272,6 @@ expression: "&schema" "properties": { "enabled": { "description": "activates caching for all subgraphs, unless overriden in subgraph specific configuration", - "default": null, "type": "boolean", "nullable": true }, @@ -2239,24 +2326,20 @@ expression: "&schema" }, "timeout": { "description": "Redis request timeout (default: 2ms)", - "default": null, "type": "string", "nullable": true }, "tls": { "description": "TLS client configuration", - "default": null, "type": "object", "properties": { "certificate_authorities": { "description": "list of certificate authorities in PEM format", - "default": null, "type": "string", "nullable": true }, "client_authentication": { "description": "client certificate authentication", - "default": null, "type": "object", "required": [ "certificate_chain", @@ -2283,7 +2366,6 @@ expression: "&schema" }, "ttl": { "description": "TTL for entries", - "default": null, "type": "string", "nullable": true }, @@ -2312,10 +2394,14 @@ expression: "&schema" "properties": { "enabled": { "description": "activates caching for this subgraph, overrides the global configuration", - "default": null, "type": "boolean", "nullable": true }, + "private_id": { + "description": "Context key used to separate cache sections per user", + "type": "string", + "nullable": true + }, "ttl": { "description": "expiration for all keys for this subgraph, unless overriden by the `Cache-Control` header in subgraph responses", "type": "string", @@ -2450,7 +2536,6 @@ expression: "&schema" }, "max_opened_subscriptions": { "description": "This is a limit to only have maximum X opened subscriptions at the same time. By default if it's not set there is no limit.", - "default": null, "type": "integer", "format": "uint", "minimum": 0.0, @@ -2539,7 +2624,6 @@ expression: "&schema" "properties": { "all": { "description": "Configuration for all subgraphs", - "default": null, "type": "object", "properties": { "heartbeat_interval": { @@ -2568,7 +2652,6 @@ expression: "&schema" }, "path": { "description": "Path on which WebSockets are listening", - "default": null, "type": "string", "nullable": true }, @@ -2619,7 +2702,6 @@ expression: "&schema" }, "path": { "description": "Path on which WebSockets are listening", - "default": null, "type": "string", "nullable": true }, @@ -2645,7 +2727,6 @@ expression: "&schema" }, "queue_capacity": { "description": "It represent the capacity of the in memory queue to know how many events we can keep in a buffer", - "default": null, "type": "integer", "format": "uint", "minimum": 0.0, @@ -2698,7 +2779,6 @@ expression: "&schema" }, "experimental_reuse_query_fragments": { "description": "Enable reuse of query fragments Default: depends on the federation version", - "default": null, "type": "boolean", "nullable": true }, @@ -2779,7 +2859,6 @@ expression: "&schema" }, "redis": { "description": "Configures and activates the Redis cache", - "default": null, "type": "object", "required": [ "urls" @@ -2807,24 +2886,20 @@ expression: "&schema" }, "timeout": { "description": "Redis request timeout (default: 2ms)", - "default": null, "type": "string", "nullable": true }, "tls": { "description": "TLS client configuration", - "default": null, "type": "object", "properties": { "certificate_authorities": { "description": "list of certificate authorities in PEM format", - "default": null, "type": "string", "nullable": true }, "client_authentication": { "description": "client certificate authentication", - "default": null, "type": "object", "required": [ "certificate_chain", @@ -2897,7 +2972,6 @@ expression: "&schema" }, "experimental_paths_limit": { "description": "Before creating query plans, for each path of fields in the query we compute all the possible options to traverse that path via the subgraphs. Multiple options can arise because fields in the path can be provided by multiple subgraphs, and abstract types (i.e. unions and interfaces) returned by fields sometimes require the query planner to traverse through each constituent object type. The number of options generated in this computation can grow large if the schema or query are sufficiently complex, and that will increase the time spent planning.\n\nThis config allows specifying a per-path limit to the number of options considered. If any path's options exceeds this limit, query planning will abort and the operation will fail.\n\nThe default value is None, which specifies no limit.", - "default": null, "type": "integer", "format": "uint32", "minimum": 0.0, @@ -2905,7 +2979,6 @@ expression: "&schema" }, "experimental_plans_limit": { "description": "Sets a limit to the number of generated query plans. The planning process generates many different query plans as it explores the graph, and the list can grow large. By using this limit, we prevent that growth and still get a valid query plan, but it may not be the optimal one.\n\nThe default limit is set to 10000, but it may change in the future", - "default": null, "type": "integer", "format": "uint32", "minimum": 0.0, @@ -2918,7 +2991,6 @@ expression: "&schema" }, "warmed_up_queries": { "description": "Warms up the cache on reloads by running the query plan over a list of the most used queries (from the in memory cache) Configures the number of queries warmed up. Defaults to 1/3 of the in memory cache", - "default": null, "type": "integer", "format": "uint", "minimum": 0.0, @@ -3274,13 +3346,11 @@ expression: "&schema" }, "service_name": { "description": "Set a service.name resource in your metrics", - "default": null, "type": "string", "nullable": true }, "service_namespace": { "description": "Set a service.namespace attribute in your metrics", - "default": null, "type": "string", "nullable": true } @@ -3958,7 +4028,6 @@ expression: "&schema" }, "include_messages": { "description": "Will include the error message in a \"message\" attribute", - "default": null, "type": "boolean", "nullable": true } @@ -4602,7 +4671,6 @@ expression: "&schema" }, "include_messages": { "description": "Will include the error message in a \"message\" attribute", - "default": null, "type": "boolean", "nullable": true } @@ -5247,7 +5315,6 @@ expression: "&schema" }, "include_messages": { "description": "Will include the error message in a \"message\" attribute", - "default": null, "type": "boolean", "nullable": true } @@ -5803,13 +5870,11 @@ expression: "&schema" }, "service_name": { "description": "Set a service.name resource in your metrics", - "default": null, "type": "string", "nullable": true }, "service_namespace": { "description": "Set a service.namespace attribute in your metrics", - "default": null, "type": "string", "nullable": true }, @@ -5955,25 +6020,21 @@ expression: "&schema" "properties": { "ca": { "description": "The optional certificate authority (CA) certificate to be used in TLS configuration.", - "default": null, "type": "string", "nullable": true }, "cert": { "description": "The optional cert for tls config", - "default": null, "type": "string", "nullable": true }, "domain_name": { "description": "The optional domain name for tls config. Note that domain name is will be defaulted to match the endpoint is not explicitly set.", - "default": null, "type": "string", "nullable": true }, "key": { "description": "The optional private key file for TLS configuration.", - "default": null, "type": "string", "nullable": true }, @@ -6210,13 +6271,11 @@ expression: "&schema" }, "service_name": { "description": "The trace service name", - "default": null, "type": "string", "nullable": true }, "service_namespace": { "description": "The trace service namespace", - "default": null, "type": "string", "nullable": true } @@ -6454,13 +6513,11 @@ expression: "&schema" }, "password": { "description": "The optional password", - "default": null, "type": "string", "nullable": true }, "username": { "description": "The optional username", - "default": null, "type": "string", "nullable": true } @@ -6547,25 +6604,21 @@ expression: "&schema" "properties": { "ca": { "description": "The optional certificate authority (CA) certificate to be used in TLS configuration.", - "default": null, "type": "string", "nullable": true }, "cert": { "description": "The optional cert for tls config", - "default": null, "type": "string", "nullable": true }, "domain_name": { "description": "The optional domain name for tls config. Note that domain name is will be defaulted to match the endpoint is not explicitly set.", - "default": null, "type": "string", "nullable": true }, "key": { "description": "The optional private key file for TLS configuration.", - "default": null, "type": "string", "nullable": true }, @@ -6750,465 +6803,1102 @@ expression: "&schema" "description": "Instrumentation configuration", "type": "object", "properties": { - "instruments": { - "description": "Instrument configuration", + "events": { + "description": "Event configuration", "type": "object", "properties": { - "default_requirement_level": { - "description": "The attributes and instruments to include by default in instruments based on their level as specified in the otel semantic conventions and Apollo documentation.", - "oneOf": [ - { - "description": "No default attributes set on spans, you have to set it one by one in the configuration to enable some attributes", + "router": { + "description": "Router service events", + "type": "object", + "properties": { + "error": { + "description": "Log the router error", "type": "string", "enum": [ - "none" + "info", + "warn", + "error", + "off" ] }, - { - "description": "Attributes that are marked as required in otel semantic conventions and apollo documentation will be included (default)", + "request": { + "description": "Log the router request", "type": "string", "enum": [ - "required" + "info", + "warn", + "error", + "off" ] }, - { - "description": "Attributes that are marked as required or recommended in otel semantic conventions and apollo documentation will be included", + "response": { + "description": "Log the router response", "type": "string", "enum": [ - "recommended" + "info", + "warn", + "error", + "off" ] } - ] - }, - "router": { - "description": "Router service instruments. For more information see documentation on Router lifecycle.", - "type": "object", - "properties": { - "http.server.active_requests": { - "description": "Counter of active requests", - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" + }, + "additionalProperties": { + "description": "An event that can be logged as part of a trace. The event has an implicit `type` attribute that matches the name of the event in the yaml and a message that can be used to provide additional information.", + "type": "object", + "required": [ + "level", + "message", + "on" + ], + "properties": { + "attributes": { + "description": "The event attributes.", + "type": "object", + "properties": { + "baggage": { + "description": "All key values from trace baggage.", + "type": "boolean", + "nullable": true + }, + "dd.trace_id": { + "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", + "type": "boolean", + "nullable": true + }, + "error.type": { + "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", + "type": "boolean", + "nullable": true + }, + "http.request.body.size": { + "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.request.method": { + "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "http.response.body.size": { + "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.response.status_code": { + "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "http.route": { + "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", + "type": "boolean", + "nullable": true + }, + "network.local.address": { + "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.local.port": { + "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.peer.address": { + "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.peer.port": { + "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.protocol.name": { + "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", + "type": "boolean", + "nullable": true + }, + "network.protocol.version": { + "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.transport": { + "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", + "type": "boolean", + "nullable": true + }, + "network.type": { + "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.address": { + "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.port": { + "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "trace_id": { + "description": "The OpenTelemetry trace ID. This can be output in logs.", + "type": "boolean", + "nullable": true + }, + "url.path": { + "description": "The URI path component Examples: * /search Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "url.query": { + "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "url.scheme": { + "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "user_agent.original": { + "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + } }, - { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { + "additionalProperties": { + "anyOf": [ + { + "description": "A header from the request", "type": "object", + "required": [ + "request_header" + ], "properties": { - "http.request.method": { - "default": false, - "type": "boolean" - }, - "server.address": { - "default": false, - "type": "boolean" - }, - "server.port": { - "default": false, - "type": "boolean" + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true }, - "url.scheme": { - "default": false, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", "type": "boolean" } }, "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "http.server.request.body.size": { - "description": "Histogram of server request body size", - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "description": "Common attributes for http server and client. See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes", + }, + { + "description": "A header from the response", "type": "object", + "required": [ + "response_header" + ], "properties": { - "baggage": { - "description": "All key values from trace baggage.", - "default": null, - "type": "boolean", - "nullable": true - }, - "dd.trace_id": { - "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", - "default": null, - "type": "boolean", - "nullable": true - }, - "error.type": { - "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.body.size": { - "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.method": { - "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.body.size": { - "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.status_code": { - "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.route": { - "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.address": { - "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.port": { - "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.address": { - "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.port": { - "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.name": { - "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.version": { - "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.transport": { - "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.type": { - "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.address": { - "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.port": { - "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", - "default": null, - "type": "boolean", + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], "nullable": true }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { "trace_id": { - "description": "The OpenTelemetry trace ID. This can be output in logs.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.path": { - "description": "The URI path component Examples: * /search Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.query": { - "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.scheme": { - "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "user_agent.original": { - "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] } }, - "additionalProperties": { - "anyOf": [ - { - "description": "A header from the request", - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "description": "The request method.", - "type": "object", - "required": [ - "request_method" - ], - "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" - } + { + "description": "i64 values", + "type": "integer", + "format": "int64" }, - "additionalProperties": false - }, - { - "description": "A header from the response", - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "condition": { + "description": "The event conditions.", + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { + }, + { + "description": "i64 values", "type": "integer", "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { + }, + { + "description": "f64 values", "type": "number", "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { + }, + { + "description": "String values", "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "response_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "The trace ID of the request.", - "type": "object", - "required": [ - "trace_id" - ], - "properties": { - "trace_id": { - "description": "The format of the trace ID.", - "oneOf": [ - { - "description": "Open Telemetry trace ID, a hex string.", - "type": "string", - "enum": [ - "open_telemetry" - ] + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } }, - { - "description": "Datadog trace ID, a u64.", - "type": "string", - "enum": [ - "datadog" - ] - } - ] - } - }, - "additionalProperties": false - }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ { - "description": "A value from context.", + "description": "A header from the request", "type": "object", "required": [ - "response_context" + "request_header" ], "properties": { "default": { @@ -7270,24 +7960,34 @@ expression: "&schema" ], "nullable": true }, - "response_context": { - "description": "The response context key.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { - "description": "A value from baggage.", + "description": "The request method.", "type": "object", "required": [ - "baggage" + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, "default": { "description": "Optional default value.", "anyOf": [ @@ -7346,385 +8046,39 @@ expression: "&schema" } ], "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" } }, "additionalProperties": false }, { - "description": "A value from an environment variable.", + "description": "A status from the response", "type": "object", "required": [ - "env" + "response_status" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } - ] - } - } - }, - "additionalProperties": false - } - ] - }, - "http.server.request.duration": { - "description": "Histogram of server request duration", - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "description": "Common attributes for http server and client. See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes", - "type": "object", - "properties": { - "baggage": { - "description": "All key values from trace baggage.", - "default": null, - "type": "boolean", - "nullable": true - }, - "dd.trace_id": { - "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", - "default": null, - "type": "boolean", - "nullable": true - }, - "error.type": { - "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.body.size": { - "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.method": { - "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.body.size": { - "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.status_code": { - "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.route": { - "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.address": { - "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.port": { - "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.address": { - "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.port": { - "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.name": { - "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.version": { - "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.transport": { - "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.type": { - "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.address": { - "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.port": { - "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "trace_id": { - "description": "The OpenTelemetry trace ID. This can be output in logs.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.path": { - "description": "The URI path component Examples: * /search Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.query": { - "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.scheme": { - "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "user_agent.original": { - "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - } - }, - "additionalProperties": { - "anyOf": [ - { - "description": "A header from the request", - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "The request method.", - "type": "object", - "required": [ - "request_method" - ], - "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" - } - }, - "additionalProperties": false - }, - { - "description": "A header from the response", - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "response_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] } }, "additionalProperties": false @@ -7925,742 +8279,455 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false } ] } - } + }, + "additionalProperties": false }, - "additionalProperties": false - } + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "level": { + "description": "The log level of the event.", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + }, + "message": { + "description": "The event message.", + "type": "string" + }, + "on": { + "description": "When to trigger the event.", + "oneOf": [ + { + "description": "Log the event on request", + "type": "string", + "enum": [ + "request" + ] + }, + { + "description": "Log the event on response", + "type": "string", + "enum": [ + "response" + ] + }, + { + "description": "Log the event on error", + "type": "string", + "enum": [ + "error" + ] + } + ] + } + } + } + }, + "subgraph": { + "description": "Supergraph service events", + "type": "object", + "properties": { + "error": { + "description": "Log the subgraph error", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" ] }, - "http.server.response.body.size": { - "description": "Histogram of server response body size", - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" + "request": { + "description": "Log the subgraph request", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + }, + "response": { + "description": "Log the subgraph response", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + } + }, + "additionalProperties": { + "description": "An event that can be logged as part of a trace. The event has an implicit `type` attribute that matches the name of the event in the yaml and a message that can be used to provide additional information.", + "type": "object", + "required": [ + "level", + "message", + "on" + ], + "properties": { + "attributes": { + "description": "The event attributes.", + "type": "object", + "properties": { + "subgraph.graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.name": { + "description": "The name of the subgraph Examples: * products Requirement level: Required", + "type": "boolean", + "nullable": true + } }, - { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "description": "Common attributes for http server and client. See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes", + "additionalProperties": { + "anyOf": [ + { "type": "object", - "properties": { - "baggage": { - "description": "All key values from trace baggage.", - "default": null, - "type": "boolean", - "nullable": true - }, - "dd.trace_id": { - "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", - "default": null, - "type": "boolean", - "nullable": true - }, - "error.type": { - "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.body.size": { - "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.method": { - "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.body.size": { - "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.status_code": { - "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.route": { - "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.address": { - "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.port": { - "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.address": { - "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.port": { - "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.name": { - "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.version": { - "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.transport": { - "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.type": { - "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.address": { - "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.port": { - "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "trace_id": { - "description": "The OpenTelemetry trace ID. This can be output in logs.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.path": { - "description": "The URI path component Examples: * /search Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.query": { - "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", "nullable": true }, - "url.scheme": { - "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", - "default": null, - "type": "boolean", + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", "nullable": true }, - "user_agent.original": { - "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] } }, - "additionalProperties": { - "anyOf": [ - { - "description": "A header from the request", - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "description": "The request method.", - "type": "object", - "required": [ - "request_method" - ], - "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" - } + { + "description": "i64 values", + "type": "integer", + "format": "int64" }, - "additionalProperties": false - }, - { - "description": "A header from the response", - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - }, - "response_header": { - "description": "The name of the request header.", - "type": "string" - } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "The trace ID of the request.", - "type": "object", - "required": [ - "trace_id" - ], - "properties": { - "trace_id": { - "description": "The format of the trace ID.", - "oneOf": [ - { - "description": "Open Telemetry trace ID, a hex string.", - "type": "string", - "enum": [ - "open_telemetry" - ] - }, - { - "description": "Datadog trace ID, a u64.", - "type": "string", - "enum": [ - "datadog" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "A value from context.", - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "response_context": { - "description": "The response context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A value from baggage.", - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "description": "A value from an environment variable.", - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } - ] - } - } - }, - "additionalProperties": false - } - ] - } - }, - "additionalProperties": { - "type": "object", - "required": [ - "description", - "type", - "unit", - "value" - ], - "properties": { - "attributes": { - "description": "Attributes to include on the instrument.", - "type": "object", - "properties": { - "baggage": { - "description": "All key values from trace baggage.", - "default": null, - "type": "boolean", - "nullable": true - }, - "dd.trace_id": { - "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", - "default": null, - "type": "boolean", - "nullable": true - }, - "error.type": { - "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.body.size": { - "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.method": { - "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.body.size": { - "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.status_code": { - "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.route": { - "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.address": { - "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.port": { - "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.address": { - "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.port": { - "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.name": { - "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.version": { - "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.transport": { - "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.type": { - "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.address": { - "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.port": { - "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "trace_id": { - "description": "The OpenTelemetry trace ID. This can be output in logs.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.path": { - "description": "The URI path component Examples: * /search Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.query": { - "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.scheme": { - "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "user_agent.original": { - "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - } - }, - "additionalProperties": { - "anyOf": [ - { - "description": "A header from the request", - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" + { + "description": "i64 values", + "type": "integer", + "format": "int64" }, { "description": "f64 values", @@ -8709,32 +8776,17 @@ expression: "&schema" ], "nullable": true }, - "request_header": { - "description": "The name of the request header.", + "subgraph_response_data": { + "description": "The subgraph response body json path.", "type": "string" } }, "additionalProperties": false }, { - "description": "The request method.", - "type": "object", - "required": [ - "request_method" - ], - "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" - } - }, - "additionalProperties": false - }, - { - "description": "A header from the response", "type": "object", "required": [ - "response_header" + "subgraph_response_errors" ], "properties": { "default": { @@ -8796,22 +8848,57 @@ expression: "&schema" ], "nullable": true }, - "response_header": { - "description": "The name of the request header.", + "subgraph_response_errors": { + "description": "The subgraph response body json path.", "type": "string" } }, "additionalProperties": false }, { - "description": "A status from the response", "type": "object", "required": [ - "response_status" + "subgraph_request_header" ], "properties": { - "response_status": { - "description": "The http response status code.", + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", "oneOf": [ { "description": "The http status code.", @@ -8833,27 +8920,31 @@ expression: "&schema" "additionalProperties": false }, { - "description": "The trace ID of the request.", "type": "object", "required": [ - "trace_id" + "supergraph_operation_name" ], "properties": { - "trace_id": { - "description": "The format of the trace ID.", + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", "oneOf": [ { - "description": "Open Telemetry trace ID, a hex string.", + "description": "The raw operation name.", "type": "string", "enum": [ - "open_telemetry" + "string" ] }, { - "description": "Datadog trace ID, a u64.", + "description": "A hash of the operation name.", "type": "string", "enum": [ - "datadog" + "hash" ] } ] @@ -8862,10 +8953,56 @@ expression: "&schema" "additionalProperties": false }, { - "description": "A value from context.", "type": "object", "required": [ - "response_context" + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" ], "properties": { "default": { @@ -8927,24 +9064,37 @@ expression: "&schema" ], "nullable": true }, - "response_context": { - "description": "The response context key.", + "supergraph_query_variable": { + "description": "The supergraph query variable name.", "type": "string" } }, "additionalProperties": false }, { - "description": "A value from baggage.", "type": "object", "required": [ - "baggage" + "supergraph_request_header" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { "default": { "description": "Optional default value.", "anyOf": [ @@ -9003,12 +9153,159 @@ expression: "&schema" } ], "nullable": true - } - }, - "additionalProperties": false + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false }, { - "description": "A value from an environment variable.", "type": "object", "required": [ "env" @@ -9028,12 +9325,25 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false } ] } }, "condition": { - "description": "The instrument conditions.", + "description": "The event conditions.", "oneOf": [ { "description": "A condition to check a selection against a value.", @@ -9108,10 +9418,89 @@ expression: "&schema" "description": "Selector to extract a value from the pipeline.", "anyOf": [ { - "description": "A header from the request", "type": "object", "required": [ - "request_header" + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" ], "properties": { "default": { @@ -9173,32 +9562,18 @@ expression: "&schema" ], "nullable": true }, - "request_header": { - "description": "The name of the request header.", + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", "type": "string" } }, "additionalProperties": false }, { - "description": "The request method.", - "type": "object", - "required": [ - "request_method" - ], - "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" - } - }, - "additionalProperties": false - }, - { - "description": "A header from the response", + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", "type": "object", "required": [ - "response_header" + "subgraph_response_body" ], "properties": { "default": { @@ -9260,76 +9635,17 @@ expression: "&schema" ], "nullable": true }, - "response_header": { - "description": "The name of the request header.", + "subgraph_response_body": { + "description": "The subgraph response body json path.", "type": "string" } }, "additionalProperties": false }, { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "The trace ID of the request.", - "type": "object", - "required": [ - "trace_id" - ], - "properties": { - "trace_id": { - "description": "The format of the trace ID.", - "oneOf": [ - { - "description": "Open Telemetry trace ID, a hex string.", - "type": "string", - "enum": [ - "open_telemetry" - ] - }, - { - "description": "Datadog trace ID, a u64.", - "type": "string", - "enum": [ - "datadog" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "A value from context.", "type": "object", "required": [ - "response_context" + "subgraph_response_data" ], "properties": { "default": { @@ -9391,24 +9707,19 @@ expression: "&schema" ], "nullable": true }, - "response_context": { - "description": "The response context key.", + "subgraph_response_data": { + "description": "The subgraph response body json path.", "type": "string" } }, "additionalProperties": false }, { - "description": "A value from baggage.", "type": "object", "required": [ - "baggage" + "subgraph_response_errors" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, "default": { "description": "Optional default value.", "anyOf": [ @@ -9467,15 +9778,18 @@ expression: "&schema" } ], "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" } }, "additionalProperties": false }, { - "description": "A value from an environment variable.", "type": "object", "required": [ - "env" + "subgraph_request_header" ], "properties": { "default": { @@ -9483,127 +9797,582 @@ expression: "&schema" "type": "string", "nullable": true }, - "env": { - "description": "The name of the environment variable", + "subgraph_request_header": { + "description": "The name of a subgraph request header.", "type": "string" } }, "additionalProperties": false }, { - "type": "string" - } - ] - } - ] - }, - "maxItems": 2, - "minItems": 2 - } - }, - "additionalProperties": false - }, - { - "description": "A condition to check a selection against a selector.", - "type": "object", - "required": [ - "exists" - ], - "properties": { - "exists": { - "anyOf": [ - { - "description": "A header from the request", - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } }, - { - "description": "String values", - "type": "string" + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] } - }, - { - "description": "Array of floats", - "type": "array", - "items": { + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", "type": "number", "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - }, - { - "description": "Array of strings", - "type": "array", - "items": { + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - } - ] - } - ], + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", "nullable": true }, - "request_header": { - "description": "The name of the request header.", - "type": "string" + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] } }, "additionalProperties": false }, { - "description": "The request method.", "type": "object", "required": [ - "request_method" + "subgraph_operation_kind" ], "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] } }, "additionalProperties": false }, { - "description": "A header from the response", "type": "object", "required": [ - "response_header" + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" ], "properties": { "default": { @@ -9665,64 +10434,287 @@ expression: "&schema" ], "nullable": true }, - "response_header": { - "description": "The name of the request header.", + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", "type": "string" } }, "additionalProperties": false }, { - "description": "A status from the response", + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", "type": "object", "required": [ - "response_status" + "subgraph_response_body" ], "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ + "default": { + "description": "Optional default value.", + "anyOf": [ { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] + "description": "bool values", + "type": "boolean" }, { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "The trace ID of the request.", - "type": "object", - "required": [ - "trace_id" - ], - "properties": { - "trace_id": { - "description": "The format of the trace ID.", - "oneOf": [ - { - "description": "Open Telemetry trace ID, a hex string.", + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", "type": "string", "enum": [ - "open_telemetry" + "code" ] }, { - "description": "Datadog trace ID, a u64.", + "description": "The http status reason.", "type": "string", "enum": [ - "datadog" + "reason" ] } ] @@ -9731,7 +10723,248 @@ expression: "&schema" "additionalProperties": false }, { - "description": "A value from context.", + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { "type": "object", "required": [ "response_context" @@ -9804,7 +11037,6 @@ expression: "&schema" "additionalProperties": false }, { - "description": "A value from baggage.", "type": "object", "required": [ "baggage" @@ -9877,7 +11109,6 @@ expression: "&schema" "additionalProperties": false }, { - "description": "A value from an environment variable.", "type": "object", "required": [ "env" @@ -9897,6 +11128,19 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false } ] } @@ -9913,7 +11157,7 @@ expression: "&schema" "all": { "type": "array", "items": { - "$ref": "#/definitions/Condition_for_RouterSelector" + "$ref": "#/definitions/Condition_for_SubgraphSelector" } } }, @@ -9929,7 +11173,7 @@ expression: "&schema" "any": { "type": "array", "items": { - "$ref": "#/definitions/Condition_for_RouterSelector" + "$ref": "#/definitions/Condition_for_SubgraphSelector" } } }, @@ -9943,7 +11187,7 @@ expression: "&schema" ], "properties": { "not": { - "$ref": "#/definitions/Condition_for_RouterSelector" + "$ref": "#/definitions/Condition_for_SubgraphSelector" } }, "additionalProperties": false @@ -9964,431 +11208,42 @@ expression: "&schema" } ] }, - "description": { - "description": "The description of the instrument.", + "level": { + "description": "The log level of the event.", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + }, + "message": { + "description": "The event message.", "type": "string" }, - "type": { - "description": "The type of instrument.", + "on": { + "description": "When to trigger the event.", "oneOf": [ { - "description": "A monotonic counter https://opentelemetry.io/docs/specs/otel/metrics/data-model/#sums", + "description": "Log the event on request", "type": "string", "enum": [ - "counter" + "request" ] }, { - "description": "A histogram https://opentelemetry.io/docs/specs/otel/metrics/data-model/#histogram", + "description": "Log the event on response", "type": "string", "enum": [ - "histogram" + "response" ] - } - ] - }, - "unit": { - "description": "The units of the instrument, e.g. \"ms\", \"bytes\", \"requests\".", - "type": "string" - }, - "value": { - "description": "The value of the instrument.", - "anyOf": [ + }, { + "description": "Log the event on error", "type": "string", "enum": [ - "duration", - "unit" - ] - }, - { - "anyOf": [ - { - "description": "A header from the request", - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "The request method.", - "type": "object", - "required": [ - "request_method" - ], - "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" - } - }, - "additionalProperties": false - }, - { - "description": "A header from the response", - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "response_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "The trace ID of the request.", - "type": "object", - "required": [ - "trace_id" - ], - "properties": { - "trace_id": { - "description": "The format of the trace ID.", - "oneOf": [ - { - "description": "Open Telemetry trace ID, a hex string.", - "type": "string", - "enum": [ - "open_telemetry" - ] - }, - { - "description": "Datadog trace ID, a u64.", - "type": "string", - "enum": [ - "datadog" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "A value from context.", - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "response_context": { - "description": "The response context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A value from baggage.", - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "description": "A value from an environment variable.", - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } + "error" ] } ] @@ -10396,492 +11251,1213 @@ expression: "&schema" } } }, - "subgraph": { - "description": "Subgraph service instruments. For more information see documentation on Router lifecycle.", + "supergraph": { + "description": "Subgraph service events", "type": "object", "properties": { - "http.client.request.body.size": { - "description": "Histogram of client request body size", - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" + "error": { + "description": "Log the supergraph error", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + }, + "request": { + "description": "Log the supergraph request", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + }, + "response": { + "description": "Log the supergraph response", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + } + }, + "additionalProperties": { + "description": "An event that can be logged as part of a trace. The event has an implicit `type` attribute that matches the name of the event in the yaml and a message that can be used to provide additional information.", + "type": "object", + "required": [ + "level", + "message", + "on" + ], + "properties": { + "attributes": { + "description": "The event attributes.", + "type": "object", + "properties": { + "cost.actual": { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.delta": { + "description": "The delta (estimated - actual) cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.estimated": { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.result": { + "description": "The cost result, this is an error code returned by the cost calculation or COST_OK", + "type": "boolean", + "nullable": true + }, + "graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + } }, - { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { + "additionalProperties": { + "anyOf": [ + { "type": "object", + "required": [ + "operation_name" + ], "properties": { - "subgraph.graphql.document": { - "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.graphql.operation.name": { - "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.graphql.operation.type": { - "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", - "default": null, - "type": "boolean", + "default": { + "description": "Optional default value.", + "type": "string", "nullable": true }, - "subgraph.name": { - "description": "The name of the subgraph Examples: * products Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] } }, - "additionalProperties": { - "anyOf": [ - { - "type": "object", - "required": [ - "subgraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_operation_kind" - ], - "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } + { + "description": "i64 values", + "type": "integer", + "format": "int64" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } + { + "description": "f64 values", + "type": "number", + "format": "double" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", - "type": "string" - } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] }, - "additionalProperties": false - }, - { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", - "type": "object", - "required": [ - "subgraph_response_body" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", - "type": "string" - } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_data" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", - "type": "string" - } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_errors" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "condition": { + "description": "The event conditions.", + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] } - }, - { - "description": "Array of integers", - "type": "array", - "items": { + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", "type": "integer", "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { + }, + { + "description": "f64 values", "type": "number", "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { + }, + { + "description": "String values", "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_status" - ], - "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ { "type": "object", "required": [ - "supergraph_operation_name" + "operation_name" ], "properties": { "default": { @@ -10889,8 +12465,8 @@ expression: "&schema" "type": "string", "nullable": true }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", + "operation_name": { + "description": "The operation name from the query.", "oneOf": [ { "description": "The raw operation name.", @@ -10914,11 +12490,11 @@ expression: "&schema" { "type": "object", "required": [ - "supergraph_operation_kind" + "operation_kind" ], "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", "oneOf": [ { "description": "The raw operation kind.", @@ -10935,7 +12511,7 @@ expression: "&schema" { "type": "object", "required": [ - "supergraph_query" + "query" ], "properties": { "default": { @@ -10943,8 +12519,8 @@ expression: "&schema" "type": "string", "nullable": true }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", + "query": { + "description": "The graphql query.", "oneOf": [ { "description": "The raw query kind.", @@ -10961,7 +12537,7 @@ expression: "&schema" { "type": "object", "required": [ - "supergraph_query_variable" + "query_variable" ], "properties": { "default": { @@ -11023,8 +12599,8 @@ expression: "&schema" ], "nullable": true }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", + "query_variable": { + "description": "The name of a graphql query variable.", "type": "string" } }, @@ -11033,7 +12609,7 @@ expression: "&schema" { "type": "object", "required": [ - "supergraph_request_header" + "request_header" ], "properties": { "default": { @@ -11041,13 +12617,60 @@ expression: "&schema" "type": "string", "nullable": true }, - "supergraph_request_header": { - "description": "The supergraph request header name.", + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", "type": "string" } }, "additionalProperties": false }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ @@ -11284,144 +12907,393 @@ expression: "&schema" }, { "type": "string" - } - ] - } - } - }, - "additionalProperties": false - } - ] - }, - "http.client.request.duration": { - "description": "Histogram of client request duration", - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "type": "object", - "properties": { - "subgraph.graphql.document": { - "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.graphql.operation.name": { - "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.graphql.operation.type": { - "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.name": { - "description": "The name of the subgraph Examples: * products Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - } - }, - "additionalProperties": { - "anyOf": [ + }, { "type": "object", "required": [ - "subgraph_operation_name" + "static" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] + "static": { + "description": "A static string value", + "type": "string" } }, "additionalProperties": false }, { + "description": "Cost attributes", "type": "object", "required": [ - "subgraph_operation_kind" + "cost" ], "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", "oneOf": [ { - "description": "The raw operation kind.", + "description": "The estimated cost of the operation using the currently configured cost model", "type": "string", "enum": [ - "string" + "estimated" ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ + }, { - "description": "The raw query kind.", + "description": "The actual cost of the operation using the currently configured cost model", "type": "string", "enum": [ - "string" + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" ] } ] } }, "additionalProperties": false - }, + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "level": { + "description": "The log level of the event.", + "type": "string", + "enum": [ + "info", + "warn", + "error", + "off" + ] + }, + "message": { + "description": "The event message.", + "type": "string" + }, + "on": { + "description": "When to trigger the event.", + "oneOf": [ + { + "description": "Log the event on request", + "type": "string", + "enum": [ + "request" + ] + }, + { + "description": "Log the event on response", + "type": "string", + "enum": [ + "response" + ] + }, + { + "description": "Log the event on error", + "type": "string", + "enum": [ + "error" + ] + } + ] + } + } + } + } + }, + "additionalProperties": false + }, + "instruments": { + "description": "Instrument configuration", + "type": "object", + "properties": { + "default_requirement_level": { + "description": "The attributes and instruments to include by default in instruments based on their level as specified in the otel semantic conventions and Apollo documentation.", + "oneOf": [ + { + "description": "No default attributes set on spans, you have to set it one by one in the configuration to enable some attributes", + "type": "string", + "enum": [ + "none" + ] + }, + { + "description": "Attributes that are marked as required in otel semantic conventions and apollo documentation will be included (default)", + "type": "string", + "enum": [ + "required" + ] + }, + { + "description": "Attributes that are marked as required or recommended in otel semantic conventions and apollo documentation will be included", + "type": "string", + "enum": [ + "recommended" + ] + } + ] + }, + "router": { + "description": "Router service instruments. For more information see documentation on Router lifecycle.", + "type": "object", + "properties": { + "http.server.active_requests": { + "description": "Counter of active requests", + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "type": "object", + "properties": { + "http.request.method": { + "default": false, + "type": "boolean" + }, + "server.address": { + "default": false, + "type": "boolean" + }, + "server.port": { + "default": false, + "type": "boolean" + }, + "url.scheme": { + "default": false, + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "http.server.request.body.size": { + "description": "Histogram of server request body size", + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "description": "Common attributes for http server and client. See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes", + "type": "object", + "properties": { + "baggage": { + "description": "All key values from trace baggage.", + "type": "boolean", + "nullable": true + }, + "dd.trace_id": { + "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", + "type": "boolean", + "nullable": true + }, + "error.type": { + "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", + "type": "boolean", + "nullable": true + }, + "http.request.body.size": { + "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.request.method": { + "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "http.response.body.size": { + "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.response.status_code": { + "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "http.route": { + "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", + "type": "boolean", + "nullable": true + }, + "network.local.address": { + "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.local.port": { + "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.peer.address": { + "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.peer.port": { + "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.protocol.name": { + "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", + "type": "boolean", + "nullable": true + }, + "network.protocol.version": { + "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.transport": { + "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", + "type": "boolean", + "nullable": true + }, + "network.type": { + "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.address": { + "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.port": { + "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "trace_id": { + "description": "The OpenTelemetry trace ID. This can be output in logs.", + "type": "boolean", + "nullable": true + }, + "url.path": { + "description": "The URI path component Examples: * /search Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "url.query": { + "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "url.scheme": { + "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "user_agent.original": { + "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ { + "description": "A header from the request", "type": "object", "required": [ - "subgraph_query_variable" + "request_header" ], "properties": { "default": { @@ -11483,18 +13355,32 @@ expression: "&schema" ], "nullable": true }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "description": "The request method.", "type": "object", "required": [ - "subgraph_response_body" + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" ], "properties": { "default": { @@ -11556,17 +13442,76 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", + "response_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "A status from the response", "type": "object", "required": [ - "subgraph_response_data" + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" ], "properties": { "default": { @@ -11628,19 +13573,24 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", + "response_context": { + "description": "The response context key.", "type": "string" } }, "additionalProperties": false }, { + "description": "A value from baggage.", "type": "object", "required": [ - "subgraph_response_errors" + "baggage" ], "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, "default": { "description": "Optional default value.", "anyOf": [ @@ -11699,18 +13649,15 @@ expression: "&schema" } ], "nullable": true - }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" } }, "additionalProperties": false }, { + "description": "A value from an environment variable.", "type": "object", "required": [ - "subgraph_request_header" + "env" ], "properties": { "default": { @@ -11718,26 +13665,24 @@ expression: "&schema" "type": "string", "nullable": true }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "subgraph_response_header" + "static" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", + "static": { + "description": "A static string value", "type": "string" } }, @@ -11746,115 +13691,166 @@ expression: "&schema" { "type": "object", "required": [ - "subgraph_response_status" - ], - "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_kind" - ], - "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query" + "on_graphql_error" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" } }, "additionalProperties": false - }, + } + ] + } + } + }, + "additionalProperties": false + } + ] + }, + "http.server.request.duration": { + "description": "Histogram of server request duration", + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "description": "Common attributes for http server and client. See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes", + "type": "object", + "properties": { + "baggage": { + "description": "All key values from trace baggage.", + "type": "boolean", + "nullable": true + }, + "dd.trace_id": { + "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", + "type": "boolean", + "nullable": true + }, + "error.type": { + "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", + "type": "boolean", + "nullable": true + }, + "http.request.body.size": { + "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.request.method": { + "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "http.response.body.size": { + "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.response.status_code": { + "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "http.route": { + "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", + "type": "boolean", + "nullable": true + }, + "network.local.address": { + "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.local.port": { + "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.peer.address": { + "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.peer.port": { + "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.protocol.name": { + "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", + "type": "boolean", + "nullable": true + }, + "network.protocol.version": { + "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.transport": { + "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", + "type": "boolean", + "nullable": true + }, + "network.type": { + "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.address": { + "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.port": { + "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "trace_id": { + "description": "The OpenTelemetry trace ID. This can be output in logs.", + "type": "boolean", + "nullable": true + }, + "url.path": { + "description": "The URI path component Examples: * /search Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "url.query": { + "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "url.scheme": { + "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "user_agent.original": { + "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ { + "description": "A header from the request", "type": "object", "required": [ - "supergraph_query_variable" + "request_header" ], "properties": { "default": { @@ -11916,35 +13912,32 @@ expression: "&schema" ], "nullable": true }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "The request method.", "type": "object", "required": [ - "supergraph_request_header" + "request_method" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_request_header": { - "description": "The supergraph request header name.", - "type": "string" + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" } }, "additionalProperties": false }, { + "description": "A header from the response", "type": "object", "required": [ - "request_context" + "response_header" ], "properties": { "default": { @@ -12006,14 +13999,73 @@ expression: "&schema" ], "nullable": true }, - "request_context": { - "description": "The request context key.", + "response_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", "type": "object", "required": [ "response_context" @@ -12086,6 +14138,7 @@ expression: "&schema" "additionalProperties": false }, { + "description": "A value from baggage.", "type": "object", "required": [ "baggage" @@ -12158,6 +14211,7 @@ expression: "&schema" "additionalProperties": false }, { + "description": "A value from an environment variable.", "type": "object", "required": [ "env" @@ -12177,6 +14231,32 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false } ] } @@ -12186,8 +14266,8 @@ expression: "&schema" } ] }, - "http.client.response.body.size": { - "description": "Histogram of client response body size", + "http.server.response.body.size": { + "description": "Histogram of server response body size", "anyOf": [ { "type": "null" @@ -12202,29 +14282,121 @@ expression: "&schema" ], "properties": { "attributes": { + "description": "Common attributes for http server and client. See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes", "type": "object", "properties": { - "subgraph.graphql.document": { - "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", - "default": null, + "baggage": { + "description": "All key values from trace baggage.", "type": "boolean", "nullable": true }, - "subgraph.graphql.operation.name": { - "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", - "default": null, + "dd.trace_id": { + "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", "type": "boolean", "nullable": true }, - "subgraph.graphql.operation.type": { - "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", - "default": null, + "error.type": { + "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", "type": "boolean", "nullable": true }, - "subgraph.name": { - "description": "The name of the subgraph Examples: * products Requirement level: Required", - "default": null, + "http.request.body.size": { + "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.request.method": { + "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "http.response.body.size": { + "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.response.status_code": { + "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "http.route": { + "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", + "type": "boolean", + "nullable": true + }, + "network.local.address": { + "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.local.port": { + "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.peer.address": { + "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.peer.port": { + "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.protocol.name": { + "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", + "type": "boolean", + "nullable": true + }, + "network.protocol.version": { + "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.transport": { + "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", + "type": "boolean", + "nullable": true + }, + "network.type": { + "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.address": { + "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.port": { + "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "trace_id": { + "description": "The OpenTelemetry trace ID. This can be output in logs.", + "type": "boolean", + "nullable": true + }, + "url.path": { + "description": "The URI path component Examples: * /search Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "url.query": { + "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "url.scheme": { + "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "user_agent.original": { + "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", "type": "boolean", "nullable": true } @@ -12232,170 +14404,18 @@ expression: "&schema" "additionalProperties": { "anyOf": [ { + "description": "A header from the request", "type": "object", "required": [ - "subgraph_operation_name" + "request_header" ], "properties": { "default": { "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ + "anyOf": [ { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_operation_kind" - ], - "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", - "type": "object", - "required": [ - "subgraph_response_body" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" + "description": "bool values", + "type": "boolean" }, { "description": "i64 values", @@ -12449,89 +14469,32 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "The request method.", "type": "object", "required": [ - "subgraph_response_data" + "request_method" ], "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", - "type": "string" + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" } }, "additionalProperties": false }, { + "description": "A header from the response", "type": "object", "required": [ - "subgraph_response_errors" + "response_header" ], "properties": { "default": { @@ -12593,57 +14556,22 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", + "response_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "A status from the response", "type": "object", "required": [ - "subgraph_response_status" + "response_status" ], "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", + "response_status": { + "description": "The http response status code.", "oneOf": [ { "description": "The http status code.", @@ -12665,78 +14593,27 @@ expression: "&schema" "additionalProperties": false }, { + "description": "The trace ID of the request.", "type": "object", "required": [ - "supergraph_operation_name" + "trace_id" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", + "trace_id": { + "description": "The format of the trace ID.", "oneOf": [ { - "description": "The raw operation name.", + "description": "Open Telemetry trace ID, a hex string.", "type": "string", "enum": [ - "string" + "open_telemetry" ] }, { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_kind" - ], - "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", + "description": "Datadog trace ID, a u64.", "type": "string", "enum": [ - "string" + "datadog" ] } ] @@ -12745,9 +14622,10 @@ expression: "&schema" "additionalProperties": false }, { + "description": "A value from context.", "type": "object", "required": [ - "supergraph_query_variable" + "response_context" ], "properties": { "default": { @@ -12809,37 +14687,24 @@ expression: "&schema" ], "nullable": true }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", + "response_context": { + "description": "The response context key.", "type": "string" } }, "additionalProperties": false }, { + "description": "A value from baggage.", "type": "object", "required": [ - "supergraph_request_header" + "baggage" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_request_header": { - "description": "The supergraph request header name.", + "baggage": { + "description": "The name of the baggage item.", "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { + }, "default": { "description": "Optional default value.", "anyOf": [ @@ -12898,154 +14763,41 @@ expression: "&schema" } ], "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" } }, "additionalProperties": false }, { + "description": "A value from an environment variable.", "type": "object", "required": [ - "response_context" + "env" ], "properties": { "default": { "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], + "type": "string", "nullable": true }, - "response_context": { - "description": "The response context key.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "baggage" + "static" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", + "static": { + "description": "A static string value", "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true } }, "additionalProperties": false @@ -13053,23 +14805,15 @@ expression: "&schema" { "type": "object", "required": [ - "env" + "on_graphql_error" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" } }, "additionalProperties": false - }, - { - "type": "string" } ] } @@ -13093,190 +14837,129 @@ expression: "&schema" "description": "Attributes to include on the instrument.", "type": "object", "properties": { - "subgraph.graphql.document": { - "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", - "default": null, + "baggage": { + "description": "All key values from trace baggage.", "type": "boolean", "nullable": true }, - "subgraph.graphql.operation.name": { - "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", - "default": null, + "dd.trace_id": { + "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", "type": "boolean", "nullable": true }, - "subgraph.graphql.operation.type": { - "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", - "default": null, + "error.type": { + "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", "type": "boolean", "nullable": true }, - "subgraph.name": { - "description": "The name of the subgraph Examples: * products Requirement level: Required", - "default": null, + "http.request.body.size": { + "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", "type": "boolean", "nullable": true - } - }, - "additionalProperties": { - "anyOf": [ - { - "type": "object", - "required": [ - "subgraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_operation_kind" - ], - "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, + }, + "http.request.method": { + "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "http.response.body.size": { + "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.response.status_code": { + "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "http.route": { + "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", + "type": "boolean", + "nullable": true + }, + "network.local.address": { + "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.local.port": { + "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.peer.address": { + "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.peer.port": { + "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.protocol.name": { + "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", + "type": "boolean", + "nullable": true + }, + "network.protocol.version": { + "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.transport": { + "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", + "type": "boolean", + "nullable": true + }, + "network.type": { + "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.address": { + "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.port": { + "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "trace_id": { + "description": "The OpenTelemetry trace ID. This can be output in logs.", + "type": "boolean", + "nullable": true + }, + "url.path": { + "description": "The URI path component Examples: * /search Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "url.query": { + "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "url.scheme": { + "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "user_agent.original": { + "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "description": "A header from the request", "type": "object", "required": [ - "subgraph_response_body" + "request_header" ], "properties": { "default": { @@ -13338,89 +15021,32 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "The request method.", "type": "object", "required": [ - "subgraph_response_data" + "request_method" ], "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", - "type": "string" + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" } }, "additionalProperties": false }, { + "description": "A header from the response", "type": "object", "required": [ - "subgraph_response_errors" + "response_header" ], "properties": { "default": { @@ -13482,57 +15108,22 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", + "response_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "A status from the response", "type": "object", "required": [ - "subgraph_response_status" + "response_status" ], "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", + "response_status": { + "description": "The http response status code.", "oneOf": [ { "description": "The http status code.", @@ -13554,78 +15145,27 @@ expression: "&schema" "additionalProperties": false }, { + "description": "The trace ID of the request.", "type": "object", "required": [ - "supergraph_operation_name" + "trace_id" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", + "trace_id": { + "description": "The format of the trace ID.", "oneOf": [ { - "description": "The raw operation name.", + "description": "Open Telemetry trace ID, a hex string.", "type": "string", "enum": [ - "string" + "open_telemetry" ] }, { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_kind" - ], - "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", + "description": "Datadog trace ID, a u64.", "type": "string", "enum": [ - "string" + "datadog" ] } ] @@ -13634,9 +15174,10 @@ expression: "&schema" "additionalProperties": false }, { + "description": "A value from context.", "type": "object", "required": [ - "supergraph_query_variable" + "response_context" ], "properties": { "default": { @@ -13698,37 +15239,24 @@ expression: "&schema" ], "nullable": true }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", + "response_context": { + "description": "The response context key.", "type": "string" } }, "additionalProperties": false }, { + "description": "A value from baggage.", "type": "object", "required": [ - "supergraph_request_header" + "baggage" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_request_header": { - "description": "The supergraph request header name.", + "baggage": { + "description": "The name of the baggage item.", "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { + }, "default": { "description": "Optional default value.", "anyOf": [ @@ -13787,154 +15315,41 @@ expression: "&schema" } ], "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" } }, "additionalProperties": false }, { + "description": "A value from an environment variable.", "type": "object", "required": [ - "response_context" + "env" ], "properties": { "default": { "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], + "type": "string", "nullable": true }, - "response_context": { - "description": "The response context key.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "baggage" + "static" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", + "static": { + "description": "A static string value", "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true } }, "additionalProperties": false @@ -13942,23 +15357,15 @@ expression: "&schema" { "type": "object", "required": [ - "env" + "on_graphql_error" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" } }, "additionalProperties": false - }, - { - "type": "string" } ] } @@ -14039,162 +15446,10 @@ expression: "&schema" "description": "Selector to extract a value from the pipeline.", "anyOf": [ { + "description": "A header from the request", "type": "object", "required": [ - "subgraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_operation_kind" - ], - "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", - "type": "object", - "required": [ - "subgraph_response_body" + "request_header" ], "properties": { "default": { @@ -14256,89 +15511,32 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "The request method.", "type": "object", "required": [ - "subgraph_response_data" + "request_method" ], "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", - "type": "string" + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" } }, "additionalProperties": false }, { + "description": "A header from the response", "type": "object", "required": [ - "subgraph_response_errors" + "response_header" ], "properties": { "default": { @@ -14400,57 +15598,22 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", + "response_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "A status from the response", "type": "object", "required": [ - "subgraph_response_status" + "response_status" ], "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", + "response_status": { + "description": "The http response status code.", "oneOf": [ { "description": "The http status code.", @@ -14472,78 +15635,27 @@ expression: "&schema" "additionalProperties": false }, { + "description": "The trace ID of the request.", "type": "object", "required": [ - "supergraph_operation_name" + "trace_id" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", + "trace_id": { + "description": "The format of the trace ID.", "oneOf": [ { - "description": "The raw operation name.", + "description": "Open Telemetry trace ID, a hex string.", "type": "string", "enum": [ - "string" + "open_telemetry" ] }, { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_kind" - ], - "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", + "description": "Datadog trace ID, a u64.", "type": "string", "enum": [ - "string" + "datadog" ] } ] @@ -14552,9 +15664,10 @@ expression: "&schema" "additionalProperties": false }, { + "description": "A value from context.", "type": "object", "required": [ - "supergraph_query_variable" + "response_context" ], "properties": { "default": { @@ -14616,37 +15729,24 @@ expression: "&schema" ], "nullable": true }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", + "response_context": { + "description": "The response context key.", "type": "string" } }, "additionalProperties": false }, { + "description": "A value from baggage.", "type": "object", "required": [ - "supergraph_request_header" + "baggage" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_request_header": { - "description": "The supergraph request header name.", + "baggage": { + "description": "The name of the baggage item.", "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { + }, "default": { "description": "Optional default value.", "anyOf": [ @@ -14705,154 +15805,41 @@ expression: "&schema" } ], "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" } }, "additionalProperties": false }, { + "description": "A value from an environment variable.", "type": "object", "required": [ - "response_context" + "env" ], "properties": { "default": { "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], + "type": "string", "nullable": true }, - "response_context": { - "description": "The response context key.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "baggage" + "static" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", + "static": { + "description": "A static string value", "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true } }, "additionalProperties": false @@ -14860,23 +15847,15 @@ expression: "&schema" { "type": "object", "required": [ - "env" + "on_graphql_error" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" } }, "additionalProperties": false - }, - { - "type": "string" } ] } @@ -14898,162 +15877,10 @@ expression: "&schema" "exists": { "anyOf": [ { + "description": "A header from the request", "type": "object", "required": [ - "subgraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_operation_kind" - ], - "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", - "type": "object", - "required": [ - "subgraph_response_body" + "request_header" ], "properties": { "default": { @@ -15115,89 +15942,32 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "The request method.", "type": "object", "required": [ - "subgraph_response_data" + "request_method" ], "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", - "type": "string" + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" } }, "additionalProperties": false }, { + "description": "A header from the response", "type": "object", "required": [ - "subgraph_response_errors" + "response_header" ], "properties": { "default": { @@ -15259,57 +16029,22 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", + "response_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "A status from the response", "type": "object", "required": [ - "subgraph_response_status" + "response_status" ], "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", + "response_status": { + "description": "The http response status code.", "oneOf": [ { "description": "The http status code.", @@ -15331,78 +16066,27 @@ expression: "&schema" "additionalProperties": false }, { + "description": "The trace ID of the request.", "type": "object", "required": [ - "supergraph_operation_name" + "trace_id" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", + "trace_id": { + "description": "The format of the trace ID.", "oneOf": [ { - "description": "The raw operation name.", + "description": "Open Telemetry trace ID, a hex string.", "type": "string", "enum": [ - "string" + "open_telemetry" ] }, { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_kind" - ], - "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", + "description": "Datadog trace ID, a u64.", "type": "string", "enum": [ - "string" + "datadog" ] } ] @@ -15411,9 +16095,10 @@ expression: "&schema" "additionalProperties": false }, { + "description": "A value from context.", "type": "object", "required": [ - "supergraph_query_variable" + "response_context" ], "properties": { "default": { @@ -15475,37 +16160,24 @@ expression: "&schema" ], "nullable": true }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", + "response_context": { + "description": "The response context key.", "type": "string" } }, "additionalProperties": false }, { + "description": "A value from baggage.", "type": "object", "required": [ - "supergraph_request_header" + "baggage" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_request_header": { - "description": "The supergraph request header name.", + "baggage": { + "description": "The name of the baggage item.", "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { + }, "default": { "description": "Optional default value.", "anyOf": [ @@ -15564,154 +16236,41 @@ expression: "&schema" } ], "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" } }, "additionalProperties": false }, { + "description": "A value from an environment variable.", "type": "object", "required": [ - "response_context" + "env" ], "properties": { "default": { "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], + "type": "string", "nullable": true }, - "response_context": { - "description": "The response context key.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "baggage" + "static" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", + "static": { + "description": "A static string value", "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true } }, "additionalProperties": false @@ -15719,23 +16278,15 @@ expression: "&schema" { "type": "object", "required": [ - "env" + "on_graphql_error" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" } }, "additionalProperties": false - }, - { - "type": "string" } ] } @@ -15752,7 +16303,7 @@ expression: "&schema" "all": { "type": "array", "items": { - "$ref": "#/definitions/Condition_for_SubgraphSelector" + "$ref": "#/definitions/Condition_for_RouterSelector" } } }, @@ -15768,7 +16319,7 @@ expression: "&schema" "any": { "type": "array", "items": { - "$ref": "#/definitions/Condition_for_SubgraphSelector" + "$ref": "#/definitions/Condition_for_RouterSelector" } } }, @@ -15782,7 +16333,7 @@ expression: "&schema" ], "properties": { "not": { - "$ref": "#/definitions/Condition_for_SubgraphSelector" + "$ref": "#/definitions/Condition_for_RouterSelector" } }, "additionalProperties": false @@ -15843,162 +16394,10 @@ expression: "&schema" { "anyOf": [ { + "description": "A header from the request", "type": "object", "required": [ - "subgraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_operation_kind" - ], - "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", - "type": "object", - "required": [ - "subgraph_response_body" + "request_header" ], "properties": { "default": { @@ -16060,89 +16459,32 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", + "request_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "The request method.", "type": "object", "required": [ - "subgraph_response_data" + "request_method" ], "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", - "type": "string" + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" } }, "additionalProperties": false }, { + "description": "A header from the response", "type": "object", "required": [ - "subgraph_response_errors" + "response_header" ], "properties": { "default": { @@ -16204,57 +16546,22 @@ expression: "&schema" ], "nullable": true }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", + "response_header": { + "description": "The name of the request header.", "type": "string" } }, "additionalProperties": false }, { + "description": "A status from the response", "type": "object", "required": [ - "subgraph_response_status" + "response_status" ], "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", + "response_status": { + "description": "The http response status code.", "oneOf": [ { "description": "The http status code.", @@ -16276,78 +16583,27 @@ expression: "&schema" "additionalProperties": false }, { + "description": "The trace ID of the request.", "type": "object", "required": [ - "supergraph_operation_name" + "trace_id" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", + "trace_id": { + "description": "The format of the trace ID.", "oneOf": [ { - "description": "The raw operation name.", + "description": "Open Telemetry trace ID, a hex string.", "type": "string", "enum": [ - "string" + "open_telemetry" ] }, { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_kind" - ], - "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", + "description": "Datadog trace ID, a u64.", "type": "string", "enum": [ - "string" + "datadog" ] } ] @@ -16356,9 +16612,10 @@ expression: "&schema" "additionalProperties": false }, { + "description": "A value from context.", "type": "object", "required": [ - "supergraph_query_variable" + "response_context" ], "properties": { "default": { @@ -16420,37 +16677,24 @@ expression: "&schema" ], "nullable": true }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", + "response_context": { + "description": "The response context key.", "type": "string" } }, "additionalProperties": false }, { + "description": "A value from baggage.", "type": "object", "required": [ - "supergraph_request_header" + "baggage" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "supergraph_request_header": { - "description": "The supergraph request header name.", + "baggage": { + "description": "The name of the baggage item.", "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { + }, "default": { "description": "Optional default value.", "anyOf": [ @@ -16509,154 +16753,41 @@ expression: "&schema" } ], "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" } }, "additionalProperties": false }, { + "description": "A value from an environment variable.", "type": "object", "required": [ - "response_context" + "env" ], "properties": { "default": { "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], + "type": "string", "nullable": true }, - "response_context": { - "description": "The response context key.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "baggage" + "static" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", + "static": { + "description": "A static string value", "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true } }, "additionalProperties": false @@ -16664,23 +16795,15 @@ expression: "&schema" { "type": "object", "required": [ - "env" + "on_graphql_error" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" } }, "additionalProperties": false - }, - { - "type": "string" } ] } @@ -16689,1098 +16812,722 @@ expression: "&schema" } } }, - "supergraph": { - "description": "Supergraph service instruments. For more information see documentation on Router lifecycle.", + "subgraph": { + "description": "Subgraph service instruments. For more information see documentation on Router lifecycle.", "type": "object", - "additionalProperties": { - "type": "object", - "required": [ - "description", - "type", - "unit", - "value" - ], - "properties": { - "attributes": { - "description": "Attributes to include on the instrument.", - "type": "object", - "properties": { - "graphql.document": { - "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "graphql.operation.name": { - "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "graphql.operation.type": { - "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - } + "properties": { + "http.client.request.body.size": { + "description": "Histogram of client request body size", + "anyOf": [ + { + "type": "null" }, - "additionalProperties": { - "anyOf": [ - { + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { "type": "object", - "required": [ - "operation_name" - ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", + "subgraph.graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", "nullable": true }, - "operation_name": { - "description": "The operation name from the query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "operation_kind" - ], - "properties": { - "operation_kind": { - "description": "The operation kind from the query (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", + "subgraph.graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", "nullable": true }, - "query": { - "description": "The graphql query.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] + "subgraph.graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.name": { + "description": "The name of the subgraph Examples: * products Requirement level: Required", + "type": "boolean", + "nullable": true } }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } }, - { - "description": "f64 values", - "type": "number", - "format": "double" + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } }, - { - "description": "String values", - "type": "string" + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { + }, + { + "description": "i64 values", "type": "integer", "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { + }, + { + "description": "f64 values", "type": "number", "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { + }, + { + "description": "String values", "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - } - ] - } - ], - "nullable": true - }, - "query_variable": { - "description": "The name of a graphql query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "response_header": { - "description": "The name of the response header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { + }, + { + "description": "i64 values", "type": "integer", "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { + }, + { + "description": "f64 values", "type": "number", "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { + }, + { + "description": "String values", "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - } - ] - } - ], - "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { + }, + { + "description": "i64 values", "type": "integer", "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { + }, + { + "description": "f64 values", "type": "number", "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { + }, + { + "description": "String values", "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - } - ] - } - ], - "nullable": true - }, - "response_context": { - "description": "The response context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { + }, + { + "description": "i64 values", "type": "integer", "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { + }, + { + "description": "f64 values", "type": "number", "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { + }, + { + "description": "String values", "type": "string" - } - } - ] - } - ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } - ] - } - }, - "condition": { - "description": "The instrument conditions.", - "oneOf": [ - { - "description": "A condition to check a selection against a value.", - "type": "object", - "required": [ - "eq" - ], - "properties": { - "eq": { - "type": "array", - "items": { - "anyOf": [ - { - "description": "A constant value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } } - } - ] - } - ] + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } }, - { - "description": "Selector to extract a value from the pipeline.", - "anyOf": [ - { - "type": "object", - "required": [ - "operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "operation_name": { - "description": "The operation name from the query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "operation_kind" - ], - "properties": { - "operation_kind": { - "description": "The operation kind from the query (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "query": { - "description": "The graphql query.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - }, - "query_variable": { - "description": "The name of a graphql query variable.", - "type": "string" - } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } + { + "description": "i64 values", + "type": "integer", + "format": "int64" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "response_header": { - "description": "The name of the response header.", - "type": "string" - } + { + "description": "f64 values", + "type": "number", + "format": "double" }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } + { + "description": "String values", + "type": "string" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { "type": "boolean" - }, - { - "description": "i64 values", + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { "type": "integer", "format": "int64" - }, - { - "description": "f64 values", + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { "type": "number", "format": "double" - }, - { - "description": "String values", + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "response_context": { - "description": "The response context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] } - ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } - ] - } - ] - }, - "maxItems": 2, - "minItems": 2 - } - }, - "additionalProperties": false - }, - { - "description": "A condition to check a selection against a selector.", - "type": "object", - "required": [ - "exists" - ], - "properties": { - "exists": { - "anyOf": [ - { - "type": "object", - "required": [ - "operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "operation_name": { - "description": "The operation name from the query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "operation_kind" - ], - "properties": { - "operation_kind": { - "description": "The operation kind from the query (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" + } ] } - ] + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" } }, "additionalProperties": false @@ -17788,25 +17535,71 @@ expression: "&schema" { "type": "object", "required": [ - "query" + "response_context" ], "properties": { "default": { "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "query": { - "description": "The graphql query.", - "oneOf": [ + "anyOf": [ { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } ] } - ] + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" } }, "additionalProperties": false @@ -17814,9 +17607,13 @@ expression: "&schema" { "type": "object", "required": [ - "query_variable" + "baggage" ], "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, "default": { "description": "Optional default value.", "anyOf": [ @@ -17875,10 +17672,6 @@ expression: "&schema" } ], "nullable": true - }, - "query_variable": { - "description": "The name of a graphql query variable.", - "type": "string" } }, "additionalProperties": false @@ -17886,7 +17679,7 @@ expression: "&schema" { "type": "object", "required": [ - "request_header" + "env" ], "properties": { "default": { @@ -17894,17 +17687,82 @@ expression: "&schema" "type": "string", "nullable": true }, - "request_header": { - "description": "The name of the request header.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "response_header" + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } + }, + "additionalProperties": false + } + ] + }, + "http.client.request.duration": { + "description": "Histogram of client request duration", + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "type": "object", + "properties": { + "subgraph.graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.name": { + "description": "The name of the subgraph Examples: * products Requirement level: Required", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" ], "properties": { "default": { @@ -17912,35 +17770,68 @@ expression: "&schema" "type": "string", "nullable": true }, - "response_header": { - "description": "The name of the response header.", - "type": "string" + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] } }, "additionalProperties": false }, { - "description": "A status from the response", "type": "object", "required": [ - "response_status" + "subgraph_operation_kind" ], "properties": { - "response_status": { - "description": "The http response status code.", + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", "oneOf": [ { - "description": "The http status code.", + "description": "The raw operation kind.", "type": "string", "enum": [ - "code" + "string" ] - }, + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ { - "description": "The http status reason.", + "description": "The raw query kind.", "type": "string", "enum": [ - "reason" + "string" ] } ] @@ -17951,7 +17842,7 @@ expression: "&schema" { "type": "object", "required": [ - "request_context" + "subgraph_query_variable" ], "properties": { "default": { @@ -18013,17 +17904,18 @@ expression: "&schema" ], "nullable": true }, - "request_context": { - "description": "The request context key.", + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", "type": "string" } }, "additionalProperties": false }, { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", "type": "object", "required": [ - "response_context" + "subgraph_response_body" ], "properties": { "default": { @@ -18085,8 +17977,8 @@ expression: "&schema" ], "nullable": true }, - "response_context": { - "description": "The response context key.", + "subgraph_response_body": { + "description": "The subgraph response body json path.", "type": "string" } }, @@ -18095,13 +17987,9 @@ expression: "&schema" { "type": "object", "required": [ - "baggage" + "subgraph_response_data" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, "default": { "description": "Optional default value.", "anyOf": [ @@ -18160,6 +18048,10 @@ expression: "&schema" } ], "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" } }, "additionalProperties": false @@ -18167,2554 +18059,73655 @@ expression: "&schema" { "type": "object", "required": [ - "env" + "subgraph_response_errors" ], "properties": { "default": { "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "All sub-conditions must be true.", - "type": "object", - "required": [ - "all" - ], - "properties": { - "all": { - "type": "array", - "items": { - "$ref": "#/definitions/Condition_for_SupergraphSelector" - } - } - }, - "additionalProperties": false - }, - { - "description": "At least one sub-conditions must be true.", - "type": "object", - "required": [ - "any" - ], - "properties": { - "any": { - "type": "array", - "items": { - "$ref": "#/definitions/Condition_for_SupergraphSelector" - } - } - }, - "additionalProperties": false - }, - { - "description": "The sub-condition must not be true", - "type": "object", - "required": [ - "not" - ], - "properties": { - "not": { - "$ref": "#/definitions/Condition_for_SupergraphSelector" - } - }, - "additionalProperties": false - }, - { - "description": "Static true condition", - "type": "string", - "enum": [ - "true" - ] - }, - { - "description": "Static false condition", - "type": "string", - "enum": [ - "false" - ] - } - ] - }, - "description": { - "description": "The description of the instrument.", - "type": "string" - }, - "type": { - "description": "The type of instrument.", - "oneOf": [ - { - "description": "A monotonic counter https://opentelemetry.io/docs/specs/otel/metrics/data-model/#sums", - "type": "string", - "enum": [ - "counter" - ] - }, - { - "description": "A histogram https://opentelemetry.io/docs/specs/otel/metrics/data-model/#histogram", - "type": "string", - "enum": [ - "histogram" - ] - } - ] - }, - "unit": { - "description": "The units of the instrument, e.g. \"ms\", \"bytes\", \"requests\".", - "type": "string" - }, - "value": { - "description": "The value of the instrument.", - "anyOf": [ - { - "type": "string", - "enum": [ - "duration", - "unit" - ] - }, - { - "anyOf": [ - { - "type": "object", - "required": [ - "operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "operation_name": { - "description": "The operation name from the query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "operation_kind" - ], - "properties": { - "operation_kind": { - "description": "The operation kind from the query (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "query": { - "description": "The graphql query.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", "anyOf": [ { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } + "description": "bool values", + "type": "boolean" }, { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } + "description": "i64 values", + "type": "integer", + "format": "int64" }, { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "description": "f64 values", + "type": "number", + "format": "double" }, { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - ] + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" } - ], - "nullable": true - }, - "query_variable": { - "description": "The name of a graphql query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true + }, + "additionalProperties": false }, - "response_header": { - "description": "The name of the response header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", "type": "string", - "enum": [ - "code" - ] + "nullable": true }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true }, - { - "description": "String values", + "subgraph_response_header": { + "description": "The name of a subgraph response header.", "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] }, { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] }, { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] } ] } - ], - "nullable": true + }, + "additionalProperties": false }, - "request_context": { - "description": "The request context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true }, - { - "description": "f64 values", - "type": "number", - "format": "double" + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true }, - { - "description": "String values", + "supergraph_query_variable": { + "description": "The supergraph query variable name.", "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true }, - { - "description": "Array of homogeneous values", + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", "anyOf": [ { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } + "description": "bool values", + "type": "boolean" }, { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } + "description": "i64 values", + "type": "integer", + "format": "int64" }, { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "description": "f64 values", + "type": "number", + "format": "double" }, { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - ] + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" } - ], - "nullable": true - }, - "response_context": { - "description": "The response context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" + }, + "additionalProperties": false }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true }, - { - "description": "String values", + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", "type": "string" }, - { - "description": "Array of homogeneous values", + "default": { + "description": "Optional default value.", "anyOf": [ { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } + "description": "bool values", + "type": "boolean" }, { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } + "description": "i64 values", + "type": "integer", + "format": "int64" }, { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "description": "f64 values", + "type": "number", + "format": "double" }, { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] } - ] + ], + "nullable": true } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false }, - "env": { - "description": "The name of the environment variable", + { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false } - }, - "additionalProperties": false - }, - { - "type": "string" + ] } - ] - } - ] - } - } - } - } - }, - "additionalProperties": false - }, - "spans": { - "description": "Span configuration", - "type": "object", - "properties": { - "default_attribute_requirement_level": { - "description": "The attributes to include by default in spans based on their level as specified in the otel semantic conventions and Apollo documentation.", - "oneOf": [ - { - "description": "No default attributes set on spans, you have to set it one by one in the configuration to enable some attributes", - "type": "string", - "enum": [ - "none" - ] - }, - { - "description": "Attributes that are marked as required in otel semantic conventions and apollo documentation will be included (default)", - "type": "string", - "enum": [ - "required" + } + }, + "additionalProperties": false + } ] }, - { - "description": "Attributes that are marked as required or recommended in otel semantic conventions and apollo documentation will be included", - "type": "string", - "enum": [ - "recommended" - ] - } - ] - }, - "mode": { - "description": "Use new OpenTelemetry spec compliant span attributes or preserve existing. This will be defaulted in future to `spec_compliant`, eventually removed in future.", - "oneOf": [ - { - "description": "Keep the request span as root span and deprecated attributes. This option will eventually removed.", - "type": "string", - "enum": [ - "deprecated" - ] - }, - { - "description": "Use new OpenTelemetry spec compliant span attributes or preserve existing. This will be the default in future.", - "type": "string", - "enum": [ - "spec_compliant" - ] - } - ] - }, - "router": { - "description": "Configuration of router spans. Log events inherit attributes from the containing span, so attributes configured here will be included on log events for a request. Router spans contain http request and response information and therefore contain http specific attributes.", - "type": "object", - "properties": { - "attributes": { - "description": "Custom attributes that are attached to the router span.", - "type": "object", - "properties": { - "baggage": { - "description": "All key values from trace baggage.", - "default": null, - "type": "boolean", - "nullable": true - }, - "dd.trace_id": { - "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", - "default": null, - "type": "boolean", - "nullable": true - }, - "error.type": { - "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.body.size": { - "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.request.method": { - "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.body.size": { - "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.response.status_code": { - "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true - }, - "http.route": { - "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.address": { - "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.local.port": { - "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.address": { - "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.peer.port": { - "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.name": { - "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.protocol.version": { - "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.transport": { - "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "network.type": { - "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.address": { - "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "server.port": { - "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "trace_id": { - "description": "The OpenTelemetry trace ID. This can be output in logs.", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.path": { - "description": "The URI path component Examples: * /search Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - }, - "url.query": { - "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", - "default": null, - "type": "boolean", - "nullable": true + "http.client.response.body.size": { + "description": "Histogram of client response body size", + "anyOf": [ + { + "type": "null" }, - "url.scheme": { - "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true + { + "type": "boolean" }, - "user_agent.original": { - "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - } - }, - "additionalProperties": { - "anyOf": [ - { - "description": "A header from the request", - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "type": "object", + "properties": { + "subgraph.graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.name": { + "description": "The name of the subgraph Examples: * products Requirement level: Required", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { "anyOf": [ { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] } - ] - } - ], - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "The request method.", - "type": "object", - "required": [ - "request_method" - ], - "properties": { - "request_method": { - "description": "The request method enabled or not", - "type": "boolean" - } - }, - "additionalProperties": false - }, - { - "description": "A header from the response", - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" + }, + "additionalProperties": false }, { - "description": "f64 values", - "type": "number", - "format": "double" + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false }, { - "description": "String values", - "type": "string" + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false }, { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" } - ] - } - ], - "nullable": true - }, - "response_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] + }, + "additionalProperties": false }, { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "The trace ID of the request.", - "type": "object", - "required": [ - "trace_id" - ], - "properties": { - "trace_id": { - "description": "The format of the trace ID.", - "oneOf": [ - { - "description": "Open Telemetry trace ID, a hex string.", - "type": "string", - "enum": [ - "open_telemetry" - ] - }, - { - "description": "Datadog trace ID, a u64.", - "type": "string", - "enum": [ - "datadog" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "description": "A value from context.", - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "i64 values", - "type": "integer", - "format": "int64" + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "f64 values", - "type": "number", - "format": "double" + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "String values", - "type": "string" + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" } - ] - } - ], - "nullable": true - }, - "response_context": { - "description": "The response context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A value from baggage.", - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" + }, + "additionalProperties": false }, { - "description": "i64 values", - "type": "integer", - "format": "int64" + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false }, { - "description": "f64 values", - "type": "number", - "format": "double" + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false }, { - "description": "String values", - "type": "string" + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false }, { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] } - ] - } - ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "description": "A value from an environment variable.", - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } - ] - } - } - }, - "additionalProperties": false - }, - "subgraph": { - "description": "Attributes to include on the subgraph span. Subgraph spans contain information about the subgraph request and response and therefore contain subgraph specific attributes.", - "type": "object", - "properties": { - "attributes": { - "description": "Custom attributes that are attached to the subgraph span.", - "type": "object", - "properties": { - "subgraph.graphql.document": { - "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.graphql.operation.name": { - "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.graphql.operation.type": { - "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "subgraph.name": { - "description": "The name of the subgraph Examples: * products Requirement level: Required", - "default": null, - "type": "boolean", - "nullable": true - } - }, - "additionalProperties": { - "anyOf": [ - { - "type": "object", - "required": [ - "subgraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_operation_name": { - "description": "The operation name from the subgraph query.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_operation_kind" - ], - "properties": { - "subgraph_operation_kind": { - "description": "The kind of the subgraph operation (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_query": { - "description": "The graphql query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" + }, + "additionalProperties": false }, { - "description": "i64 values", - "type": "integer", - "format": "int64" + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "f64 values", - "type": "number", - "format": "double" + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "String values", - "type": "string" + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "response_context": { + "description": "The response context key.", + "type": "string" } - ] - } - ], - "nullable": true - }, - "subgraph_query_variable": { - "description": "The name of a subgraph query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", - "type": "object", - "required": [ - "subgraph_response_body" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" + }, + "additionalProperties": false }, { - "description": "i64 values", - "type": "integer", - "format": "int64" + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false }, { - "description": "f64 values", - "type": "number", - "format": "double" + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false }, { - "description": "String values", "type": "string" }, { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" } - ] + }, + "additionalProperties": false } - ], - "nullable": true - }, - "subgraph_response_body": { - "description": "The subgraph response body json path.", - "type": "string" + ] } - }, - "additionalProperties": false + } }, - { - "type": "object", - "required": [ - "subgraph_response_data" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_data": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false + "additionalProperties": false + } + ] + } + }, + "additionalProperties": { + "type": "object", + "required": [ + "description", + "type", + "unit", + "value" + ], + "properties": { + "attributes": { + "description": "Attributes to include on the instrument.", + "type": "object", + "properties": { + "subgraph.graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true }, - { - "type": "object", - "required": [ - "subgraph_response_errors" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "subgraph_response_errors": { - "description": "The subgraph response body json path.", - "type": "string" - } - }, - "additionalProperties": false + "subgraph.graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true }, - { - "type": "object", - "required": [ - "subgraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "subgraph_request_header": { - "description": "The name of a subgraph request header.", - "type": "string" - } - }, - "additionalProperties": false + "subgraph.graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true }, - { - "type": "object", - "required": [ - "subgraph_response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true + "subgraph.name": { + "description": "The name of the subgraph Examples: * products Requirement level: Required", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } }, - "subgraph_response_header": { - "description": "The name of a subgraph response header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "subgraph_response_status" - ], - "properties": { - "subgraph_response_status": { - "description": "The subgraph http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } }, - "supergraph_operation_name": { - "description": "The supergraph query operation name.", - "oneOf": [ - { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] - }, - { - "description": "A hash of the operation name.", - "type": "string", - "enum": [ - "hash" - ] - } - ] - } + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_operation_kind" - ], - "properties": { - "supergraph_operation_kind": { - "description": "The supergraph query operation kind (query|mutation|subscription).", - "oneOf": [ - { - "description": "The raw operation kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } }, - "supergraph_query": { - "description": "The supergraph query to the subgraph.", - "oneOf": [ - { - "description": "The raw query kind.", - "type": "string", - "enum": [ - "string" - ] - } - ] - } + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } } - } - ] - } - ], - "nullable": true + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } }, - "supergraph_query_variable": { - "description": "The supergraph query variable name.", - "type": "string" - } + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "supergraph_request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } }, - "supergraph_request_header": { - "description": "The supergraph request header name.", - "type": "string" - } + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } } - } - ] - } - ], - "nullable": true + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } }, - "request_context": { - "description": "The request context key.", - "type": "string" - } + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } }, - "response_context": { - "description": "The response context key.", - "type": "string" - } + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "condition": { + "description": "The instrument conditions.", + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "description": { + "description": "The description of the instrument.", + "type": "string" + }, + "type": { + "description": "The type of instrument.", + "oneOf": [ + { + "description": "A monotonic counter https://opentelemetry.io/docs/specs/otel/metrics/data-model/#sums", + "type": "string", + "enum": [ + "counter" + ] + }, + { + "description": "A histogram https://opentelemetry.io/docs/specs/otel/metrics/data-model/#histogram", + "type": "string", + "enum": [ + "histogram" + ] + } + ] + }, + "unit": { + "description": "The units of the instrument, e.g. \"ms\", \"bytes\", \"requests\".", + "type": "string" + }, + "value": { + "description": "The value of the instrument.", + "anyOf": [ + { + "type": "string", + "enum": [ + "duration", + "unit" + ] + }, + { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + } + } + } + }, + "supergraph": { + "description": "Supergraph service instruments. For more information see documentation on Router lifecycle.", + "type": "object", + "properties": { + "cost.actual": { + "description": "A histogram of the actual cost of the operation using the currently configured cost model", + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "description": "Attributes for Cost", + "type": "object", + "properties": { + "cost.actual": { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.delta": { + "description": "The delta (estimated - actual) cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.estimated": { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.result": { + "description": "The cost result, this is an error code returned by the cost calculation or COST_OK", + "type": "boolean", + "nullable": true + }, + "graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + } + }, + "additionalProperties": false + } + ] + }, + "cost.delta": { + "description": "A histogram of the delta between the estimated and actual cost of the operation using the currently configured cost model", + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "description": "Attributes for Cost", + "type": "object", + "properties": { + "cost.actual": { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.delta": { + "description": "The delta (estimated - actual) cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.estimated": { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.result": { + "description": "The cost result, this is an error code returned by the cost calculation or COST_OK", + "type": "boolean", + "nullable": true + }, + "graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + } + }, + "additionalProperties": false + } + ] + }, + "cost.estimated": { + "description": "A histogram of the estimated cost of the operation using the currently configured cost model", + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "description": "Attributes for Cost", + "type": "object", + "properties": { + "cost.actual": { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.delta": { + "description": "The delta (estimated - actual) cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.estimated": { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.result": { + "description": "The cost result, this is an error code returned by the cost calculation or COST_OK", + "type": "boolean", + "nullable": true + }, + "graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": { + "type": "object", + "required": [ + "description", + "type", + "unit", + "value" + ], + "properties": { + "attributes": { + "description": "Attributes to include on the instrument.", + "type": "object", + "properties": { + "cost.actual": { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.delta": { + "description": "The delta (estimated - actual) cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.estimated": { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.result": { + "description": "The cost result, this is an error code returned by the cost calculation or COST_OK", + "type": "boolean", + "nullable": true + }, + "graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "condition": { + "description": "The instrument conditions.", + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "description": { + "description": "The description of the instrument.", + "type": "string" + }, + "type": { + "description": "The type of instrument.", + "oneOf": [ + { + "description": "A monotonic counter https://opentelemetry.io/docs/specs/otel/metrics/data-model/#sums", + "type": "string", + "enum": [ + "counter" + ] + }, + { + "description": "A histogram https://opentelemetry.io/docs/specs/otel/metrics/data-model/#histogram", + "type": "string", + "enum": [ + "histogram" + ] + } + ] + }, + "unit": { + "description": "The units of the instrument, e.g. \"ms\", \"bytes\", \"requests\".", + "type": "string" + }, + "value": { + "description": "The value of the instrument.", + "anyOf": [ + { + "type": "string", + "enum": [ + "duration", + "unit" + ] + }, + { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + } + } + } + } + }, + "additionalProperties": false + }, + "spans": { + "description": "Span configuration", + "type": "object", + "properties": { + "default_attribute_requirement_level": { + "description": "The attributes to include by default in spans based on their level as specified in the otel semantic conventions and Apollo documentation.", + "oneOf": [ + { + "description": "No default attributes set on spans, you have to set it one by one in the configuration to enable some attributes", + "type": "string", + "enum": [ + "none" + ] + }, + { + "description": "Attributes that are marked as required in otel semantic conventions and apollo documentation will be included (default)", + "type": "string", + "enum": [ + "required" + ] + }, + { + "description": "Attributes that are marked as required or recommended in otel semantic conventions and apollo documentation will be included", + "type": "string", + "enum": [ + "recommended" + ] + } + ] + }, + "mode": { + "description": "Use new OpenTelemetry spec compliant span attributes or preserve existing. This will be defaulted in future to `spec_compliant`, eventually removed in future.", + "oneOf": [ + { + "description": "Keep the request span as root span and deprecated attributes. This option will eventually removed.", + "type": "string", + "enum": [ + "deprecated" + ] + }, + { + "description": "Use new OpenTelemetry spec compliant span attributes or preserve existing. This will be the default in future.", + "type": "string", + "enum": [ + "spec_compliant" + ] + } + ] + }, + "router": { + "description": "Configuration of router spans. Log events inherit attributes from the containing span, so attributes configured here will be included on log events for a request. Router spans contain http request and response information and therefore contain http specific attributes.", + "type": "object", + "properties": { + "attributes": { + "description": "Custom attributes that are attached to the router span.", + "type": "object", + "properties": { + "baggage": { + "description": "All key values from trace baggage.", + "type": "boolean", + "nullable": true + }, + "dd.trace_id": { + "description": "The datadog trace ID. This can be output in logs and used to correlate traces in Datadog.", + "type": "boolean", + "nullable": true + }, + "error.type": { + "description": "Describes a class of error the operation ended with. Examples: * timeout * name_resolution_error * 500 Requirement level: Conditionally Required: If request has ended with an error.", + "type": "boolean", + "nullable": true + }, + "http.request.body.size": { + "description": "The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.request.method": { + "description": "HTTP request method. Examples: * GET * POST * HEAD Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "http.response.body.size": { + "description": "The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. Examples: * 3495 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "http.response.status_code": { + "description": "HTTP response status code. Examples: * 200 Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "http.route": { + "description": "The matched route (path template in the format used by the respective server framework). Examples: * /graphql Requirement level: Conditionally Required: If and only if itโ€™s available", + "type": "boolean", + "nullable": true + }, + "network.local.address": { + "description": "Local socket address. Useful in case of a multi-IP host. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.local.port": { + "description": "Local socket port. Useful in case of a multi-port host. Examples: * 65123 Requirement level: Opt-In", + "type": "boolean", + "nullable": true + }, + "network.peer.address": { + "description": "Peer address of the network connection - IP address or Unix domain socket name. Examples: * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.peer.port": { + "description": "Peer port number of the network connection. Examples: * 65123 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.protocol.name": { + "description": "OSI application layer or non-OSI equivalent. Examples: * http * spdy Requirement level: Recommended: if not default (http).", + "type": "boolean", + "nullable": true + }, + "network.protocol.version": { + "description": "Version of the protocol specified in network.protocol.name. Examples: * 1.0 * 1.1 * 2 * 3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "network.transport": { + "description": "OSI transport layer. Examples: * tcp * udp Requirement level: Conditionally Required", + "type": "boolean", + "nullable": true + }, + "network.type": { + "description": "OSI network layer or non-OSI equivalent. Examples: * ipv4 * ipv6 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.address": { + "description": "Name of the local HTTP server that received the request. Examples: * example.com * 10.1.2.80 * /tmp/my.sock Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "server.port": { + "description": "Port of the local HTTP server that received the request. Examples: * 80 * 8080 * 443 Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "trace_id": { + "description": "The OpenTelemetry trace ID. This can be output in logs.", + "type": "boolean", + "nullable": true + }, + "url.path": { + "description": "The URI path component Examples: * /search Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "url.query": { + "description": "The URI query component Examples: * q=OpenTelemetry Requirement level: Conditionally Required: If and only if one was received/sent.", + "type": "boolean", + "nullable": true + }, + "url.scheme": { + "description": "The URI scheme component identifying the used protocol. Examples: * http * https Requirement level: Required", + "type": "boolean", + "nullable": true + }, + "user_agent.original": { + "description": "Value of the HTTP User-Agent header sent by the client. Examples: * CERN-LineMode/2.15 * libwww/2.17b3 Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "description": "A header from the request", + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "The request method.", + "type": "object", + "required": [ + "request_method" + ], + "properties": { + "request_method": { + "description": "The request method enabled or not", + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "description": "A header from the response", + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "The trace ID of the request.", + "type": "object", + "required": [ + "trace_id" + ], + "properties": { + "trace_id": { + "description": "The format of the trace ID.", + "oneOf": [ + { + "description": "Open Telemetry trace ID, a hex string.", + "type": "string", + "enum": [ + "open_telemetry" + ] + }, + { + "description": "Datadog trace ID, a u64.", + "type": "string", + "enum": [ + "datadog" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "A value from context.", + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A value from baggage.", + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "description": "A value from an environment variable.", + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_RouterSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + } + } + }, + "additionalProperties": false + }, + "subgraph": { + "description": "Attributes to include on the subgraph span. Subgraph spans contain information about the subgraph request and response and therefore contain subgraph specific attributes.", + "type": "object", + "properties": { + "attributes": { + "description": "Custom attributes that are attached to the subgraph span.", + "type": "object", + "properties": { + "subgraph.graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "subgraph.name": { + "description": "The name of the subgraph Examples: * products Requirement level: Required", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "subgraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_operation_name": { + "description": "The operation name from the subgraph query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_operation_kind" + ], + "properties": { + "subgraph_operation_kind": { + "description": "The kind of the subgraph operation (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_query": { + "description": "The graphql query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_query_variable": { + "description": "The name of a subgraph query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated, use SubgraphResponseData and SubgraphResponseError instead", + "type": "object", + "required": [ + "subgraph_response_body" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_body": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_data" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_data": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_errors" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "subgraph_response_errors": { + "description": "The subgraph response body json path.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_request_header": { + "description": "The name of a subgraph request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "subgraph_response_header": { + "description": "The name of a subgraph response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "subgraph_response_status" + ], + "properties": { + "subgraph_response_status": { + "description": "The subgraph http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_operation_name": { + "description": "The supergraph query operation name.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_operation_kind" + ], + "properties": { + "supergraph_operation_kind": { + "description": "The supergraph query operation kind (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_query": { + "description": "The supergraph query to the subgraph.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "supergraph_query_variable": { + "description": "The supergraph query variable name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "supergraph_request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "supergraph_request_header": { + "description": "The supergraph request header name.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SubgraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } + }, + "additionalProperties": false + }, + "supergraph": { + "description": "Configuration of supergraph spans. Supergraph spans contain information about the graphql request and response and therefore contain graphql specific attributes.", + "type": "object", + "properties": { + "attributes": { + "description": "Custom attributes that are attached to the supergraph span.", + "type": "object", + "properties": { + "cost.actual": { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.delta": { + "description": "The delta (estimated - actual) cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.estimated": { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "boolean", + "nullable": true + }, + "cost.result": { + "description": "The cost result, this is an error code returned by the cost calculation or COST_OK", + "type": "boolean", + "nullable": true + }, + "graphql.document": { + "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.name": { + "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", + "type": "boolean", + "nullable": true + }, + "graphql.operation.type": { + "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "type": "array", + "items": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + } + }, + "additionalProperties": false + }, + { + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false + }, + { + "description": "Static true condition", + "type": "string", + "enum": [ + "true" + ] + }, + { + "description": "Static false condition", + "type": "string", + "enum": [ + "false" + ] + } + ] + }, + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "condition": { + "oneOf": [ + { + "description": "A condition to check a selection against a value.", + "type": "object", + "required": [ + "eq" + ], + "properties": { + "eq": { + "type": "array", + "items": { + "anyOf": [ + { + "description": "A constant value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ] + }, + { + "description": "Selector to extract a value from the pipeline.", + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + ] + }, + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "description": "A condition to check a selection against a selector.", + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "anyOf": [ + { + "type": "object", + "required": [ + "operation_name" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "operation_name": { + "description": "The operation name from the query.", + "oneOf": [ + { + "description": "The raw operation name.", + "type": "string", + "enum": [ + "string" + ] + }, + { + "description": "A hash of the operation name.", + "type": "string", + "enum": [ + "hash" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "operation_kind" + ], + "properties": { + "operation_kind": { + "description": "The operation kind from the query (query|mutation|subscription).", + "oneOf": [ + { + "description": "The raw operation kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "query": { + "description": "The graphql query.", + "oneOf": [ + { + "description": "The raw query kind.", + "type": "string", + "enum": [ + "string" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "query_variable" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "baggage" + ], + "properties": { + "baggage": { + "description": "The name of the baggage item.", + "type": "string" + }, + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "env" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "env": { + "description": "The name of the environment variable", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "description": "All sub-conditions must be true.", + "type": "object", + "required": [ + "all" + ], + "properties": { + "all": { "type": "array", "items": { - "type": "number", - "format": "double" + "$ref": "#/definitions/Condition_for_SupergraphSelector" } - }, - { - "description": "Array of strings", + } + }, + "additionalProperties": false + }, + { + "description": "At least one sub-conditions must be true.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/Condition_for_SupergraphSelector" } } - ] - } - ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "string" - } - ] - } - } - }, - "additionalProperties": false - }, - "supergraph": { - "description": "Configuration of supergraph spans. Supergraph spans contain information about the graphql request and response and therefore contain graphql specific attributes.", - "type": "object", - "properties": { - "attributes": { - "description": "Custom attributes that are attached to the supergraph span.", - "default": { - "attributes": { - "graphql.document": null, - "graphql.operation.name": null, - "graphql.operation.type": null - }, - "custom": {} - }, - "type": "object", - "properties": { - "graphql.document": { - "description": "The GraphQL document being executed. Examples: * query findBookById { bookById(id: ?) { name } } Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "graphql.operation.name": { - "description": "The name of the operation being executed. Examples: * findBookById Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - }, - "graphql.operation.type": { - "description": "The type of the operation being executed. Examples: * query * subscription * mutation Requirement level: Recommended", - "default": null, - "type": "boolean", - "nullable": true - } - }, - "additionalProperties": { - "anyOf": [ - { - "type": "object", - "required": [ - "operation_name" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "operation_name": { - "description": "The operation name from the query.", - "oneOf": [ + }, + "additionalProperties": false + }, { - "description": "The raw operation name.", - "type": "string", - "enum": [ - "string" - ] + "description": "The sub-condition must not be true", + "type": "object", + "required": [ + "not" + ], + "properties": { + "not": { + "$ref": "#/definitions/Condition_for_SupergraphSelector" + } + }, + "additionalProperties": false }, { - "description": "A hash of the operation name.", + "description": "Static true condition", "type": "string", "enum": [ - "hash" + "true" ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "operation_kind" - ], - "properties": { - "operation_kind": { - "description": "The operation kind from the query (query|mutation|subscription).", - "oneOf": [ + }, { - "description": "The raw operation kind.", + "description": "Static false condition", "type": "string", "enum": [ - "string" + "false" ] } ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true }, - "query": { - "description": "The graphql query.", + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", "oneOf": [ { - "description": "The raw query kind.", + "description": "The estimated cost of the operation using the currently configured cost model", "type": "string", "enum": [ - "string" + "estimated" ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "query_variable" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" }, { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "query_variable": { - "description": "The name of a graphql query variable.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "response_header": { - "description": "The name of the response header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", + "description": "The actual cost of the operation using the currently configured cost model", "type": "string", "enum": [ - "code" + "actual" ] }, { - "description": "The http status reason.", + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", "type": "string", "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_context" - ], - "properties": { - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } + "delta" ] - } - ], - "nullable": true - }, - "response_context": { - "description": "The response context key.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "baggage" - ], - "properties": { - "baggage": { - "description": "The name of the baggage item.", - "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" }, { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" ] } - ], - "nullable": true - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "env" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" + ] } }, "additionalProperties": false - }, - { - "type": "string" } ] } @@ -20766,13 +91759,11 @@ expression: "&schema" "properties": { "certificate_authorities": { "description": "list of certificate authorities in PEM format", - "default": null, "type": "string", "nullable": true }, "client_authentication": { "description": "client certificate authentication", - "default": null, "type": "object", "required": [ "certificate_chain", @@ -20806,13 +91797,11 @@ expression: "&schema" "properties": { "certificate_authorities": { "description": "list of certificate authorities in PEM format", - "default": null, "type": "string", "nullable": true }, "client_authentication": { "description": "client certificate authentication", - "default": null, "type": "object", "required": [ "certificate_chain", @@ -20841,7 +91830,6 @@ expression: "&schema" }, "supergraph": { "description": "TLS server configuration\n\nthis will affect the GraphQL endpoint and any other endpoint targeting the same listen address", - "default": null, "type": "object", "required": [ "certificate", @@ -20969,7 +91957,6 @@ expression: "&schema" }, "ttl": { "description": "how long a single deposit should be considered. Must be between 1 and 60 seconds, default value is 10 seconds", - "default": null, "type": "string" } }, @@ -21000,7 +91987,6 @@ expression: "&schema" }, "timeout": { "description": "Enable timeout for incoming requests", - "default": null, "type": "string" } }, @@ -21009,7 +91995,6 @@ expression: "&schema" }, "deduplicate_variables": { "description": "DEPRECATED, now always enabled: Enable variable deduplication optimization when sending requests to subgraphs (https://github.com/apollographql/router/issues/87)", - "default": null, "type": "boolean", "nullable": true }, @@ -21041,7 +92026,6 @@ expression: "&schema" }, "timeout": { "description": "Enable timeout for incoming requests", - "default": null, "type": "string" } }, @@ -21145,7 +92129,6 @@ expression: "&schema" }, "ttl": { "description": "how long a single deposit should be considered. Must be between 1 and 60 seconds, default value is 10 seconds", - "default": null, "type": "string" } }, @@ -21176,7 +92159,6 @@ expression: "&schema" }, "timeout": { "description": "Enable timeout for incoming requests", - "default": null, "type": "string" } }, @@ -21647,6 +92629,32 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false } ] } @@ -22052,6 +93060,32 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "on_graphql_error" + ], + "properties": { + "on_graphql_error": { + "description": "Boolean set to true if the response body contains graphql error", + "type": "boolean" + } + }, + "additionalProperties": false } ] } @@ -23032,6 +94066,19 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false } ] } @@ -23891,6 +94938,19 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false } ] } @@ -24177,8 +95237,217 @@ expression: "&schema" ], "nullable": true }, - "query_variable": { - "description": "The name of a graphql query variable.", + "query_variable": { + "description": "The name of a graphql query variable.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "request_header": { + "description": "The name of the request header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_header" + ], + "properties": { + "default": { + "description": "Optional default value.", + "type": "string", + "nullable": true + }, + "response_header": { + "description": "The name of the response header.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "A status from the response", + "type": "object", + "required": [ + "response_status" + ], + "properties": { + "response_status": { + "description": "The http response status code.", + "oneOf": [ + { + "description": "The http status code.", + "type": "string", + "enum": [ + "code" + ] + }, + { + "description": "The http status reason.", + "type": "string", + "enum": [ + "reason" + ] + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "request_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "request_context": { + "description": "The request context key.", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "response_context" + ], + "properties": { + "default": { + "description": "Optional default value.", + "anyOf": [ + { + "description": "bool values", + "type": "boolean" + }, + { + "description": "i64 values", + "type": "integer", + "format": "int64" + }, + { + "description": "f64 values", + "type": "number", + "format": "double" + }, + { + "description": "String values", + "type": "string" + }, + { + "description": "Array of homogeneous values", + "anyOf": [ + { + "description": "Array of bools", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "Array of integers", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "Array of floats", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "Array of strings", + "type": "array", + "items": { + "type": "string" + } + } + ] + } + ], + "nullable": true + }, + "response_context": { + "description": "The response context key.", "type": "string" } }, @@ -24187,74 +95456,13 @@ expression: "&schema" { "type": "object", "required": [ - "request_header" + "baggage" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "request_header": { - "description": "The name of the request header.", + "baggage": { + "description": "The name of the baggage item.", "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "response_header" - ], - "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true }, - "response_header": { - "description": "The name of the response header.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A status from the response", - "type": "object", - "required": [ - "response_status" - ], - "properties": { - "response_status": { - "description": "The http response status code.", - "oneOf": [ - { - "description": "The http status code.", - "type": "string", - "enum": [ - "code" - ] - }, - { - "description": "The http status reason.", - "type": "string", - "enum": [ - "reason" - ] - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "request_context" - ], - "properties": { "default": { "description": "Optional default value.", "anyOf": [ @@ -24313,10 +95521,6 @@ expression: "&schema" } ], "nullable": true - }, - "request_context": { - "description": "The request context key.", - "type": "string" } }, "additionalProperties": false @@ -24324,167 +95528,79 @@ expression: "&schema" { "type": "object", "required": [ - "response_context" + "env" ], "properties": { "default": { "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], + "type": "string", "nullable": true }, - "response_context": { - "description": "The response context key.", + "env": { + "description": "The name of the environment variable", "type": "string" } }, "additionalProperties": false }, + { + "type": "string" + }, { "type": "object", "required": [ - "baggage" + "static" ], "properties": { - "baggage": { - "description": "The name of the baggage item.", + "static": { + "description": "A static string value", "type": "string" - }, - "default": { - "description": "Optional default value.", - "anyOf": [ - { - "description": "bool values", - "type": "boolean" - }, - { - "description": "i64 values", - "type": "integer", - "format": "int64" - }, - { - "description": "f64 values", - "type": "number", - "format": "double" - }, - { - "description": "String values", - "type": "string" - }, - { - "description": "Array of homogeneous values", - "anyOf": [ - { - "description": "Array of bools", - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "description": "Array of integers", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - { - "description": "Array of floats", - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - { - "description": "Array of strings", - "type": "array", - "items": { - "type": "string" - } - } - ] - } - ], - "nullable": true } }, "additionalProperties": false }, { + "description": "Cost attributes", "type": "object", "required": [ - "env" + "cost" ], "properties": { - "default": { - "description": "Optional default value.", - "type": "string", - "nullable": true - }, - "env": { - "description": "The name of the environment variable", - "type": "string" + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] } }, "additionalProperties": false - }, - { - "type": "string" } ] } @@ -24958,6 +96074,62 @@ expression: "&schema" }, { "type": "string" + }, + { + "type": "object", + "required": [ + "static" + ], + "properties": { + "static": { + "description": "A static string value", + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Cost attributes", + "type": "object", + "required": [ + "cost" + ], + "properties": { + "cost": { + "description": "The cost value to select, one of: estimated, actual, delta.", + "oneOf": [ + { + "description": "The estimated cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "estimated" + ] + }, + { + "description": "The actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "actual" + ] + }, + { + "description": "The delta between the estimated and actual cost of the operation using the currently configured cost model", + "type": "string", + "enum": [ + "delta" + ] + }, + { + "description": "The result of the cost calculation. This is the error code returned by the cost calculation.", + "type": "string", + "enum": [ + "result" + ] + } + ] + } + }, + "additionalProperties": false } ] } diff --git a/apollo-router/src/configuration/testdata/metrics/telemetry.router.yaml b/apollo-router/src/configuration/testdata/metrics/telemetry.router.yaml index b67bf4fc3b..b7942cf3de 100644 --- a/apollo-router/src/configuration/testdata/metrics/telemetry.router.yaml +++ b/apollo-router/src/configuration/testdata/metrics/telemetry.router.yaml @@ -98,4 +98,77 @@ telemetry: exists: subgraph_response_data: "$.products[*].price1" attributes: - subgraph.name: true \ No newline at end of file + subgraph.name: true + events: + router: + # Standard events + request: info + response: info + error: info + + # Custom events + my.request_event: + message: "my event message" + level: info + on: request + attributes: + http.request.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: info + on: response + attributes: + http.response.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - response_header: "x-log-request" + supergraph: + # Standard events + request: info + response: info + error: info + + # Custom events + my.request.event: + message: "my event message" + level: info + on: request + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: warn + on: response + condition: + eq: + - "log" + - response_header: "x-log-request" + subgraph: + # Standard events + request: info + response: warn + error: error + + # Custom events + my.request.event: + message: "my event message" + level: info + on: request + my.response.event: + message: "my response event message" + level: error + on: response + attributes: + subgraph.name: true + response_status: + subgraph_response_status: code \ No newline at end of file diff --git a/apollo-router/src/configuration/tests.rs b/apollo-router/src/configuration/tests.rs index ffefd4ad54..49979be1de 100644 --- a/apollo-router/src/configuration/tests.rs +++ b/apollo-router/src/configuration/tests.rs @@ -55,7 +55,7 @@ fn routing_url_in_schema() { REVIEWS @join__graph(name: "reviews" url: "http://localhost:4004/graphql") } "#; - let schema = crate::spec::Schema::parse(schema).unwrap(); + let schema = crate::spec::Schema::parse_test(schema, &Default::default()).unwrap(); let subgraphs: HashMap<&String, &Uri> = schema.subgraphs().collect(); @@ -107,7 +107,7 @@ fn missing_subgraph_url() { PRODUCTS @join__graph(name: "products" url: "http://localhost:4003/graphql") REVIEWS @join__graph(name: "reviews" url: "") }"#; - let schema_error = crate::spec::Schema::parse(schema_error) + let schema_error = crate::spec::Schema::parse_test(schema_error, &Default::default()) .expect_err("Must have an error because we have one missing subgraph routing url"); if let SchemaError::MissingSubgraphUrl(subgraph) = schema_error { diff --git a/apollo-router/src/context/extensions/mod.rs b/apollo-router/src/context/extensions/mod.rs index cbee53db86..84274eeccd 100644 --- a/apollo-router/src/context/extensions/mod.rs +++ b/apollo-router/src/context/extensions/mod.rs @@ -85,6 +85,18 @@ impl Extensions { .and_then(|boxed| (&mut **boxed as &mut (dyn Any + 'static)).downcast_mut()) } + /// Get a mutable reference to a type or insert and return the value if it does not exist + pub fn get_or_default_mut(&mut self) -> &mut T { + let map = self.map.get_or_insert_with(Box::default); + let value = map + .entry(TypeId::of::()) + .or_insert_with(|| Box::::default()); + // It should be impossible for the entry to be the wrong type as we don't allow direct access to the map. + value + .downcast_mut() + .expect("default value should be inserted and we should be able to downcast it") + } + /// Returns `true` type has been stored in `Extensions`. pub fn contains_key(&self) -> bool { self.map diff --git a/apollo-router/src/context/mod.rs b/apollo-router/src/context/mod.rs index 224ffc69d2..d9548b6d88 100644 --- a/apollo-router/src/context/mod.rs +++ b/apollo-router/src/context/mod.rs @@ -28,6 +28,8 @@ pub(crate) mod extensions; pub(crate) const OPERATION_NAME: &str = "operation_name"; /// The key of the resolved operation kind. This is subject to change and should not be relied on. pub(crate) const OPERATION_KIND: &str = "operation_kind"; +/// The key to know if the response body contains at least 1 GraphQL error +pub(crate) const CONTAINS_GRAPHQL_ERROR: &str = "apollo::telemetry::contains_graphql_error"; /// Holds [`Context`] entries. pub(crate) type Entries = Arc>; diff --git a/apollo-router/src/error.rs b/apollo-router/src/error.rs index 7fd226c12c..f99c633aed 100644 --- a/apollo-router/src/error.rs +++ b/apollo-router/src/error.rs @@ -314,6 +314,10 @@ pub(crate) enum QueryPlannerError { /// Query planner pool error: {0} PoolProcessing(String), + + /// Federation error: {0} + // TODO: make `FederationError` serializable and store it as-is? + FederationError(String), } impl IntoGraphQLErrors for Vec { @@ -538,18 +542,22 @@ impl std::fmt::Display for PlanErrors { } /// Error in the schema. -#[derive(Debug, Error, Display)] +#[derive(Debug, Error, Display, derive_more::From)] #[non_exhaustive] pub(crate) enum SchemaError { /// URL parse error for subgraph {0}: {1} UrlParse(String, http::uri::InvalidUri), /// Could not find an URL for subgraph {0} + #[from(ignore)] MissingSubgraphUrl(String), /// GraphQL parser error: {0} Parse(ParseErrors), /// GraphQL validation error: {0} Validate(ValidationErrors), + /// Federation error: {0} + FederationError(apollo_federation::error::FederationError), /// Api error(s): {0} + #[from(ignore)] Api(String), } @@ -608,10 +616,9 @@ pub(crate) struct ValidationErrors { pub(crate) errors: Vec, } -impl IntoGraphQLErrors for ValidationErrors { - fn into_graphql_errors(self) -> Result, Self> { - Ok(self - .errors +impl ValidationErrors { + pub(crate) fn into_graphql_errors_infallible(self) -> Vec { + self.errors .iter() .map(|diagnostic| { Error::builder() @@ -629,7 +636,12 @@ impl IntoGraphQLErrors for ValidationErrors { .extension_code("GRAPHQL_VALIDATION_FAILED") .build() }) - .collect()) + .collect() + } +} +impl IntoGraphQLErrors for ValidationErrors { + fn into_graphql_errors(self) -> Result, Self> { + Ok(self.into_graphql_errors_infallible()) } } diff --git a/apollo-router/src/executable.rs b/apollo-router/src/executable.rs index 2345a8a88b..873409da62 100644 --- a/apollo-router/src/executable.rs +++ b/apollo-router/src/executable.rs @@ -1,5 +1,6 @@ //! Main entry point for CLI command to start server. +use std::cell::Cell; use std::env; use std::ffi::OsStr; use std::fmt; @@ -712,16 +713,24 @@ fn setup_panic_handler() { std::panic::set_hook(Box::new(move |e| { if show_backtraces { let backtrace = std::backtrace::Backtrace::capture(); - tracing::error!("{}\n{:?}", e, backtrace) + tracing::error!("{}\n{}", e, backtrace) } else { tracing::error!("{}", e) } - // Once we've panic'ed the behaviour of the router is non-deterministic - // We've logged out the panic details. Terminate with an error code - std::process::exit(1); + if !USING_CATCH_UNWIND.get() { + // Once we've panic'ed the behaviour of the router is non-deterministic + // We've logged out the panic details. Terminate with an error code + std::process::exit(1); + } })); } +// TODO: once the Rust query planner does not use `todo!()` anymore, +// remove this and the use of `catch_unwind` to call it. +thread_local! { + pub(crate) static USING_CATCH_UNWIND: Cell = const { Cell::new(false) }; +} + static COPIED: AtomicBool = AtomicBool::new(false); fn copy_args_to_env() { diff --git a/apollo-router/src/introspection.rs b/apollo-router/src/introspection.rs index 7cf4b6ca13..ae575fe9b9 100644 --- a/apollo-router/src/introspection.rs +++ b/apollo-router/src/introspection.rs @@ -114,6 +114,7 @@ mod introspection_tests { reuse_query_fragments: Some(false), generate_query_fragments: None, debug: None, + type_conditioned_fetching: false, }, ) .await diff --git a/apollo-router/src/json_ext.rs b/apollo-router/src/json_ext.rs index b8cf588187..e0b29f9ed4 100644 --- a/apollo-router/src/json_ext.rs +++ b/apollo-router/src/json_ext.rs @@ -5,6 +5,9 @@ use std::cmp::min; use std::fmt; +use once_cell::sync::Lazy; +use regex::Captures; +use regex::Regex; use serde::Deserialize; use serde::Serialize; use serde_json_bytes::ByteString; @@ -21,6 +24,11 @@ pub(crate) type Object = Map; const FRAGMENT_PREFIX: &str = "... on "; +static TYPE_CONDITIONS_REGEX: Lazy = Lazy::new(|| { + Regex::new(r"(?:\|\[)(?.+?)(?:,\s*|)(?:\])") + .expect("this regex to check for type conditions is valid") +}); + macro_rules! extract_key_value_from_object { ($object:expr, $key:literal, $pattern:pat => $var:ident) => {{ match $object.remove($key) { @@ -245,7 +253,8 @@ impl ValueExt for Value { for p in path.iter() { match p { - PathElement::Flatten => { + // Type conditions don't matter here since we're just creating a default value. + PathElement::Flatten(_) => { return res_value; } @@ -275,7 +284,8 @@ impl ValueExt for Value { } other => unreachable!("unreachable node: {:?}", other), }, - PathElement::Key(k) => { + // Type conditions don't matter here since we're just creating a default value. + PathElement::Key(k, _) => { let mut m = Map::new(); m.insert(k.as_str(), Value::default()); @@ -296,12 +306,13 @@ impl ValueExt for Value { /// Insert a `Value` at a `Path` #[track_caller] - fn insert(&mut self, path: &Path, value: Value) -> Result<(), FetchError> { + fn insert(&mut self, path: &Path, mut value: Value) -> Result<(), FetchError> { let mut current_node = self; for p in path.iter() { match p { - PathElement::Flatten => { + PathElement::Flatten(type_conditions) => { + value = filter_type_conditions(value, type_conditions); if current_node.is_null() { let a = Vec::new(); *current_node = Value::Array(a); @@ -341,29 +352,32 @@ impl ValueExt for Value { }) } }, - PathElement::Key(k) => match current_node { - Value::Object(o) => { - current_node = o - .get_mut(k.as_str()) - .expect("the value at that key was just inserted"); - } - Value::Null => { - let mut m = Map::new(); - m.insert(k.as_str(), Value::default()); - - *current_node = Value::Object(m); - current_node = current_node - .as_object_mut() - .expect("current_node was just set to a Value::Object") - .get_mut(k.as_str()) - .expect("the value at that key was just inserted"); - } - _other => { - return Err(FetchError::ExecutionPathNotFound { - reason: "expected an object".to_string(), - }) + PathElement::Key(k, type_conditions) => { + value = filter_type_conditions(value, type_conditions); + match current_node { + Value::Object(o) => { + current_node = o + .get_mut(k.as_str()) + .expect("the value at that key was just inserted"); + } + Value::Null => { + let mut m = Map::new(); + m.insert(k.as_str(), Value::default()); + + *current_node = Value::Object(m); + current_node = current_node + .as_object_mut() + .expect("current_node was just set to a Value::Object") + .get_mut(k.as_str()) + .expect("the value at that key was just inserted"); + } + _other => { + return Err(FetchError::ExecutionPathNotFound { + reason: "expected an object".to_string(), + }) + } } - }, + } PathElement::Fragment(_) => {} } } @@ -452,6 +466,29 @@ impl ValueExt for Value { } } +fn filter_type_conditions(value: Value, type_conditions: &Option) -> Value { + if let Some(tc) = type_conditions { + match value { + Value::Object(ref o) => { + if let Some(Value::String(type_name)) = &o.get("__typename") { + if !tc.iter().any(|tc| tc.as_str() == type_name.as_str()) { + return Value::Null; + } + } + } + Value::Array(v) => { + return Value::Array( + v.into_iter() + .map(|v| filter_type_conditions(v, type_conditions)) + .collect(), + ); + } + _ => {} + } + } + value +} + fn iterate_path<'a, F>( schema: &Schema, parent: &mut Path, @@ -463,12 +500,42 @@ fn iterate_path<'a, F>( { match path.first() { None => f(parent, data), - Some(PathElement::Flatten) => { + Some(PathElement::Flatten(type_conditions)) => { if let Some(array) = data.as_array() { for (i, value) in array.iter().enumerate() { - parent.push(PathElement::Index(i)); - iterate_path(schema, parent, &path[1..], value, f); - parent.pop(); + if let Some(tc) = type_conditions { + if !tc.is_empty() { + if let Value::Object(o) = value { + if let Some(Value::String(type_name)) = o.get("__typename") { + if tc.iter().any(|tc| tc.as_str() == type_name.as_str()) { + parent.push(PathElement::Index(i)); + iterate_path(schema, parent, &path[1..], value, f); + parent.pop(); + } + } + } + + if let Value::Array(array) = value { + for (i, value) in array.iter().enumerate() { + if let Value::Object(o) = value { + if let Some(Value::String(type_name)) = o.get("__typename") + { + if tc.iter().any(|tc| tc.as_str() == type_name.as_str()) + { + parent.push(PathElement::Index(i)); + iterate_path(schema, parent, &path[1..], value, f); + parent.pop(); + } + } + } + } + } + } + } else { + parent.push(PathElement::Index(i)); + iterate_path(schema, parent, &path[1..], value, f); + parent.pop(); + } } } } @@ -476,16 +543,41 @@ fn iterate_path<'a, F>( if let Value::Array(a) = data { if let Some(value) = a.get(*i) { parent.push(PathElement::Index(*i)); - iterate_path(schema, parent, &path[1..], value, f); parent.pop(); } } } - Some(PathElement::Key(k)) => { - if let Value::Object(o) = data { + Some(PathElement::Key(k, type_conditions)) => { + if let Some(tc) = type_conditions { + if !tc.is_empty() { + if let Value::Object(o) = data { + if let Some(value) = o.get(k.as_str()) { + if let Some(Value::String(type_name)) = value.get("__typename") { + if tc.iter().any(|tc| tc.as_str() == type_name.as_str()) { + parent.push(PathElement::Key(k.to_string(), None)); + iterate_path(schema, parent, &path[1..], value, f); + parent.pop(); + } + } + } + } else if let Value::Array(array) = data { + for (i, value) in array.iter().enumerate() { + if let Value::Object(o) = value { + if let Some(Value::String(type_name)) = o.get("__typename") { + if tc.iter().any(|tc| tc.as_str() == type_name.as_str()) { + parent.push(PathElement::Index(i)); + iterate_path(schema, parent, path, value, f); + parent.pop(); + } + } + } + } + } + } + } else if let Value::Object(o) = data { if let Some(value) = o.get(k.as_str()) { - parent.push(PathElement::Key(k.to_string())); + parent.push(PathElement::Key(k.to_string(), None)); iterate_path(schema, parent, &path[1..], value, f); parent.pop(); } @@ -527,12 +619,26 @@ fn iterate_path_mut<'a, F>( { match path.first() { None => f(parent, data), - Some(PathElement::Flatten) => { + Some(PathElement::Flatten(type_conditions)) => { if let Some(array) = data.as_array_mut() { for (i, value) in array.iter_mut().enumerate() { - parent.push(PathElement::Index(i)); - iterate_path_mut(schema, parent, &path[1..], value, f); - parent.pop(); + if let Some(tc) = type_conditions { + if !tc.is_empty() { + if let Value::Object(o) = value { + if let Some(Value::String(type_name)) = o.get("__typename") { + if tc.iter().any(|tc| tc.as_str() == type_name.as_str()) { + parent.push(PathElement::Index(i)); + iterate_path_mut(schema, parent, &path[1..], value, f); + parent.pop(); + } + } + } + } + } else { + parent.push(PathElement::Index(i)); + iterate_path_mut(schema, parent, &path[1..], value, f); + parent.pop(); + } } } } @@ -545,10 +651,36 @@ fn iterate_path_mut<'a, F>( } } } - Some(PathElement::Key(k)) => { - if let Value::Object(o) = data { + Some(PathElement::Key(k, type_conditions)) => { + if let Some(tc) = type_conditions { + if !tc.is_empty() { + if let Value::Object(o) = data { + if let Some(value) = o.get_mut(k.as_str()) { + if let Some(Value::String(type_name)) = value.get("__typename") { + if tc.iter().any(|tc| tc.as_str() == type_name.as_str()) { + parent.push(PathElement::Key(k.to_string(), None)); + iterate_path_mut(schema, parent, &path[1..], value, f); + parent.pop(); + } + } + } + } else if let Value::Array(array) = data { + for (i, value) in array.iter_mut().enumerate() { + if let Value::Object(o) = value { + if let Some(Value::String(type_name)) = o.get("__typename") { + if tc.iter().any(|tc| tc.as_str() == type_name.as_str()) { + parent.push(PathElement::Index(i)); + iterate_path_mut(schema, parent, path, value, f); + parent.pop(); + } + } + } + } + } + } + } else if let Value::Object(o) = data { if let Some(value) = o.get_mut(k.as_str()) { - parent.push(PathElement::Key(k.to_string())); + parent.push(PathElement::Key(k.to_string(), None)); iterate_path_mut(schema, parent, &path[1..], value, f); parent.pop(); } @@ -562,6 +694,11 @@ fn iterate_path_mut<'a, F>( } Some(PathElement::Fragment(name)) => { if data.is_object_of_type(schema, name) { + // Note that (not unlike `Flatten`) we do not include the fragment in the `parent` + // path, because we want that path to be a "pure" response path. Fragments in path + // are used to essentially create a type-based choice in a "selection" path, but + // `parent` is a direct path to a specific position in the value and do not need + // fragments. iterate_path_mut(schema, parent, &path[1..], data, f); } else if let Value::Array(array) = data { for (i, value) in array.iter_mut().enumerate() { @@ -584,7 +721,7 @@ pub enum PathElement { deserialize_with = "deserialize_flatten", serialize_with = "serialize_flatten" )] - Flatten, + Flatten(Option), /// An index path element. Index(usize), @@ -597,9 +734,12 @@ pub enum PathElement { Fragment(String), /// A key path element. - Key(String), + #[serde(deserialize_with = "deserialize_key", serialize_with = "serialize_key")] + Key(String, Option), } +type TypeConditions = Vec; + #[derive(Clone, Debug, Eq, PartialEq)] pub enum ResponsePathElement<'a> { /// An index path element. @@ -609,7 +749,7 @@ pub enum ResponsePathElement<'a> { Key(&'a str), } -fn deserialize_flatten<'de, D>(deserializer: D) -> Result<(), D::Error> +fn deserialize_flatten<'de, D>(deserializer: D) -> Result, D::Error> where D: serde::Deserializer<'de>, { @@ -619,18 +759,36 @@ where struct FlattenVisitor; impl<'de> serde::de::Visitor<'de> for FlattenVisitor { - type Value = (); + type Value = Option; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "a string that is '@'") + write!( + formatter, + "a string that is '@', potentially preceded of followed by type conditions" + ) } fn visit_str(self, s: &str) -> Result where E: serde::de::Error, { - if s == "@" { - Ok(()) + let mut type_conditions: Vec = Vec::new(); + let path = TYPE_CONDITIONS_REGEX.replace(s, |caps: &Captures| { + type_conditions.extend( + caps.name("condition") + .map(|c| { + c.as_str() + .split(',') + .map(|s| s.to_string()) + .collect::>() + }) + .unwrap_or_default(), + ); + "" + }); + + if path == "@" { + Ok((!type_conditions.is_empty()).then_some(type_conditions)) } else { Err(serde::de::Error::invalid_value( serde::de::Unexpected::Str(s), @@ -640,11 +798,86 @@ impl<'de> serde::de::Visitor<'de> for FlattenVisitor { } } -fn serialize_flatten(serializer: S) -> Result +fn serialize_flatten( + type_conditions: &Option, + serializer: S, +) -> Result where S: serde::Serializer, { - serializer.serialize_str("@") + let tc_string = if let Some(c) = type_conditions { + if !c.is_empty() { + format!("|[{}]", c.join(",")) + } else { + "".to_string() + } + } else { + "".to_string() + }; + let res = format!("@{}", tc_string); + serializer.serialize_str(res.as_str()) +} + +fn deserialize_key<'de, D>(deserializer: D) -> Result<(String, Option), D::Error> +where + D: serde::Deserializer<'de>, +{ + deserializer.deserialize_str(KeyVisitor) +} + +struct KeyVisitor; + +impl<'de> serde::de::Visitor<'de> for KeyVisitor { + type Value = (String, Option); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!( + formatter, + "a string, potentially preceded of followed by type conditions" + ) + } + + fn visit_str(self, s: &str) -> Result + where + E: serde::de::Error, + { + let mut type_conditions = Vec::new(); + let key = TYPE_CONDITIONS_REGEX.replace(s, |caps: &Captures| { + type_conditions.extend( + caps.extract::<1>() + .1 + .map(|s| s.split(',').map(|s| s.to_string())) + .into_iter() + .flatten(), + ); + "" + }); + Ok(( + key.to_string(), + (!type_conditions.is_empty()).then_some(type_conditions), + )) + } +} + +fn serialize_key( + key: &String, + type_conditions: &Option, + serializer: S, +) -> Result +where + S: serde::Serializer, +{ + let tc_string = if let Some(c) = type_conditions { + if !c.is_empty() { + format!("|[{}]", c.join(",")) + } else { + "".to_string() + } + } else { + "".to_string() + }; + let res = format!("{}{}", key, tc_string); + serializer.serialize_str(res.as_str()) } fn deserialize_fragment<'de, D>(deserializer: D) -> Result @@ -680,6 +913,46 @@ where serializer.serialize_str(format!("{FRAGMENT_PREFIX}{name}").as_str()) } +fn flatten_from_str(s: &str) -> Result { + let mut type_conditions = Vec::new(); + let path = TYPE_CONDITIONS_REGEX.replace(s, |caps: &Captures| { + type_conditions.extend( + caps.extract::<1>() + .1 + .map(|s| s.split(',').map(|s| s.to_string())) + .into_iter() + .flatten(), + ); + "" + }); + + if path != "@" { + return Err("invalid flatten".to_string()); + } + Ok(PathElement::Flatten( + (!type_conditions.is_empty()).then_some(type_conditions), + )) +} + +fn key_from_str(s: &str) -> Result { + let mut type_conditions = Vec::new(); + let key = TYPE_CONDITIONS_REGEX.replace(s, |caps: &Captures| { + type_conditions.extend( + caps.extract::<1>() + .1 + .map(|s| s.split(',').map(|s| s.to_string())) + .into_iter() + .flatten(), + ); + "" + }); + + Ok(PathElement::Key( + key.to_string(), + (!type_conditions.is_empty()).then_some(type_conditions), + )) +} + /// A path into the result document. /// /// This can be composed of strings and numbers @@ -695,11 +968,11 @@ impl Path { .map(|s| { if let Ok(index) = s.parse::() { PathElement::Index(index) - } else if s == "@" { - PathElement::Flatten + } else if s.contains('@') { + flatten_from_str(s).unwrap_or(PathElement::Flatten(None)) } else { s.strip_prefix(FRAGMENT_PREFIX).map_or_else( - || PathElement::Key(s.to_string()), + || key_from_str(s).unwrap_or(PathElement::Key(s.to_string(), None)), |name| PathElement::Fragment(name.to_string()), ) } @@ -713,7 +986,7 @@ impl Path { s.iter() .map(|x| match x { ResponsePathElement::Index(index) => PathElement::Index(*index), - ResponsePathElement::Key(s) => PathElement::Key(s.to_string()), + ResponsePathElement::Key(s) => PathElement::Key(s.to_string(), None), }) .collect(), ) @@ -765,7 +1038,15 @@ impl Path { pub fn last_key(&mut self) -> Option { self.0.last().and_then(|elem| match elem { - PathElement::Key(k) => Some(k.clone()), + PathElement::Key(key, type_conditions) => { + let mut tc = String::new(); + if let Some(c) = type_conditions { + if !c.is_empty() { + tc = format!("|[{}]", c.join(",")); + } + }; + Some(format!("{}{}", key, tc)) + } _ => None, }) } @@ -773,6 +1054,17 @@ impl Path { pub fn starts_with(&self, other: &Path) -> bool { self.0.starts_with(&other.0[..]) } + + // Removes the empty key if at root (used for TypedConditions) + pub fn remove_empty_key_root(&self) -> Self { + if let Some(PathElement::Key(k, type_conditions)) = self.0.first() { + if k.is_empty() && type_conditions.is_none() { + return Path(self.iter().skip(1).cloned().collect()); + } + } + + self.clone() + } } impl FromIterator for Path { @@ -798,11 +1090,11 @@ where .map(|s| { if let Ok(index) = s.parse::() { PathElement::Index(index) - } else if s == "@" { - PathElement::Flatten + } else if s.contains('@') { + flatten_from_str(s).unwrap() } else { s.strip_prefix(FRAGMENT_PREFIX).map_or_else( - || PathElement::Key(s.to_string()), + || key_from_str(s).unwrap_or(PathElement::Key(s.to_string(), None)), |name| PathElement::Fragment(name.to_string()), ) } @@ -818,9 +1110,25 @@ impl fmt::Display for Path { write!(f, "/")?; match element { PathElement::Index(index) => write!(f, "{index}")?, - PathElement::Key(key) => write!(f, "{key}")?, - PathElement::Flatten => write!(f, "@")?, - PathElement::Fragment(name) => write!(f, "{FRAGMENT_PREFIX}{name}")?, + PathElement::Key(key, type_conditions) => { + write!(f, "{key}")?; + if let Some(c) = type_conditions { + if !c.is_empty() { + write!(f, "|[{}]", c.join(","))?; + } + }; + } + PathElement::Flatten(type_conditions) => { + write!(f, "@")?; + if let Some(c) = type_conditions { + if !c.is_empty() { + write!(f, "|[{}]", c.join(","))?; + } + }; + } + PathElement::Fragment(name) => { + write!(f, "{FRAGMENT_PREFIX}{name}")?; + } } } Ok(()) @@ -1112,10 +1420,10 @@ mod tests { assert_eq!( path.0, vec![ - PathElement::Key("k".to_string()), + PathElement::Key("k".to_string(), None), PathElement::Fragment("T".to_string()), - PathElement::Flatten, - PathElement::Key("arr".to_string()), + PathElement::Flatten(None), + PathElement::Key("arr".to_string(), None), PathElement::Index(3), ] ); diff --git a/apollo-router/src/logging/mod.rs b/apollo-router/src/logging/mod.rs index 5d0b75879d..a78552fda5 100644 --- a/apollo-router/src/logging/mod.rs +++ b/apollo-router/src/logging/mod.rs @@ -41,7 +41,7 @@ pub(crate) mod test { use tracing_core::Subscriber; use tracing_subscriber::layer::SubscriberExt; - use crate::plugins::telemetry::dynamic_attribute::DynAttributeLayer; + use crate::plugins::telemetry::dynamic_attribute::DynSpanAttributeLayer; pub(crate) struct SnapshotSubscriber { buffer: Arc>>, @@ -104,7 +104,7 @@ pub(crate) mod test { tracing_subscriber::registry::Registry::default() .with(level) - .with(DynAttributeLayer::new()) + .with(DynSpanAttributeLayer::new()) .with( tracing_subscriber::fmt::Layer::default() .json() diff --git a/apollo-router/src/notification.rs b/apollo-router/src/notification.rs index c7e3b69440..e836b72d30 100644 --- a/apollo-router/src/notification.rs +++ b/apollo-router/src/notification.rs @@ -152,7 +152,6 @@ where ttl: Option, heartbeat_error_message: Option, queue_size: Option, - router_broadcasts: Option>, ) -> Notify { let (sender, receiver) = mpsc::channel(NOTIFY_CHANNEL_SIZE); let receiver_stream = ReceiverStream::new(receiver); @@ -160,8 +159,7 @@ where Notify { sender, queue_size, - router_broadcasts: router_broadcasts - .unwrap_or_else(|| Arc::new(RouterBroadcasts::new())), + router_broadcasts: Arc::new(RouterBroadcasts::new()), } } @@ -201,12 +199,6 @@ where K: Send + Hash + Eq + Clone + 'static, V: Send + Clone + 'static, { - #[cfg(not(test))] - pub(crate) fn set_queue_size(mut self, queue_size: Option) -> Self { - self.queue_size = queue_size; - self - } - pub(crate) async fn set_ttl(&self, new_ttl: Option) -> Result<(), NotifyError> { self.sender .send(Notification::UpdateHeartbeat { new_ttl }) diff --git a/apollo-router/src/orbiter/mod.rs b/apollo-router/src/orbiter/mod.rs index 975e914691..b3f7ddcf04 100644 --- a/apollo-router/src/orbiter/mod.rs +++ b/apollo-router/src/orbiter/mod.rs @@ -383,7 +383,7 @@ mod test { let config = Configuration::from_str(include_str!("testdata/redaction.router.yaml")) .expect("config must be valid"); let schema_string = include_str!("../testdata/minimal_supergraph.graphql"); - let schema = crate::spec::Schema::parse(schema_string).unwrap(); + let schema = crate::spec::Schema::parse_test(schema_string, &Default::default()).unwrap(); let report = create_report(Arc::new(config), Arc::new(schema)); insta::with_settings!({sort_maps => true}, { assert_yaml_snapshot!(report, { @@ -401,7 +401,7 @@ mod test { .expect("config must be valid"); config.validated_yaml = Some(Value::Null); let schema_string = include_str!("../testdata/minimal_supergraph.graphql"); - let schema = crate::spec::Schema::parse(schema_string).unwrap(); + let schema = crate::spec::Schema::parse_test(schema_string, &Default::default()).unwrap(); let report = create_report(Arc::new(config), Arc::new(schema)); insta::with_settings!({sort_maps => true}, { assert_yaml_snapshot!(report, { @@ -419,7 +419,7 @@ mod test { .expect("config must be valid"); config.validated_yaml = Some(json!({"garbage": "garbage"})); let schema_string = include_str!("../testdata/minimal_supergraph.graphql"); - let schema = crate::spec::Schema::parse(schema_string).unwrap(); + let schema = crate::spec::Schema::parse_test(schema_string, &Default::default()).unwrap(); let report = create_report(Arc::new(config), Arc::new(schema)); insta::with_settings!({sort_maps => true}, { assert_yaml_snapshot!(report, { diff --git a/apollo-router/src/plugin/mod.rs b/apollo-router/src/plugin/mod.rs index 58f5a0c3f7..eafaa19383 100644 --- a/apollo-router/src/plugin/mod.rs +++ b/apollo-router/src/plugin/mod.rs @@ -44,6 +44,7 @@ use tower::ServiceBuilder; use crate::graphql; use crate::layers::ServiceBuilderExt; use crate::notification::Notify; +use crate::query_planner::fetch::SubgraphSchemas; use crate::router_factory::Endpoint; use crate::services::execution; use crate::services::router; @@ -71,7 +72,7 @@ pub struct PluginInit { pub(crate) supergraph_schema: Arc>, /// The parsed subgraph schemas from the query planner, keyed by subgraph name - pub(crate) subgraph_schemas: Arc>>>, + pub(crate) subgraph_schemas: Arc, pub(crate) notify: Notify, } @@ -164,7 +165,7 @@ where config: T, supergraph_sdl: Arc, supergraph_schema: Arc>, - subgraph_schemas: Option>>>>, + subgraph_schemas: Option>, notify: Notify, ) -> Self { PluginInit { @@ -185,7 +186,7 @@ where config: serde_json::Value, supergraph_sdl: Arc, supergraph_schema: Arc>, - subgraph_schemas: Option>>>>, + subgraph_schemas: Option>, notify: Notify, ) -> Result { let config: T = serde_json::from_value(config)?; @@ -204,7 +205,7 @@ where config: T, supergraph_sdl: Option>, supergraph_schema: Option>>, - subgraph_schemas: Option>>>>, + subgraph_schemas: Option>, notify: Option>, ) -> Self { PluginInit { diff --git a/apollo-router/src/plugins/authentication/mod.rs b/apollo-router/src/plugins/authentication/mod.rs index 29be795960..19097212e2 100644 --- a/apollo-router/src/plugins/authentication/mod.rs +++ b/apollo-router/src/plugins/authentication/mod.rs @@ -133,7 +133,9 @@ struct JWTConf { /// Header value prefix #[serde(default = "default_header_value_prefix")] header_value_prefix: String, - + /// Whether to ignore any mismatched prefixes + #[serde(default)] + ignore_other_prefixes: bool, /// Alternative sources to extract the JWT #[serde(default)] sources: Vec, @@ -571,7 +573,11 @@ fn authenticate( let mut jwt = None; for source in &config.sources { - match extract_jwt(source, request.router_request.headers()) { + match extract_jwt( + source, + config.ignore_other_prefixes, + request.router_request.headers(), + ) { None => continue, Some(Err(error)) => { return failure_message(request.context, error, StatusCode::BAD_REQUEST) @@ -676,6 +682,7 @@ fn authenticate( fn extract_jwt<'a, 'b: 'a>( source: &'a Source, + ignore_other_prefixes: bool, headers: &'b HeaderMap, ) -> Option>> { match source { @@ -706,10 +713,14 @@ fn extract_jwt<'a, 'b: 'a>( if jwt_value.len() < prefix_len || !&jwt_value[..prefix_len].eq_ignore_ascii_case(value_prefix) { - return Some(Err(AuthenticationError::InvalidPrefix( - jwt_value_untrimmed, - value_prefix, - ))); + if ignore_other_prefixes { + return None; + } else { + return Some(Err(AuthenticationError::InvalidPrefix( + jwt_value_untrimmed, + value_prefix, + ))); + } } // If there's no header prefix, we need to avoid splitting the header let jwt = if value_prefix.is_empty() { diff --git a/apollo-router/src/plugins/authentication/tests.rs b/apollo-router/src/plugins/authentication/tests.rs index 8382ab5206..687d3679dc 100644 --- a/apollo-router/src/plugins/authentication/tests.rs +++ b/apollo-router/src/plugins/authentication/tests.rs @@ -47,13 +47,14 @@ fn create_an_url(filename: &str) -> String { } async fn build_a_default_test_harness() -> router::BoxCloneService { - build_a_test_harness(None, None, false).await + build_a_test_harness(None, None, false, false).await } async fn build_a_test_harness( header_name: Option, header_value_prefix: Option, multiple_jwks: bool, + ignore_other_prefixes: bool, ) -> router::BoxCloneService { // create a mock service we will use to test our plugin let mut mock_service = test::MockSupergraphService::new(); @@ -121,6 +122,9 @@ async fn build_a_test_harness( serde_json::Value::String(hp); } + config["authentication"]["router"]["jwt"]["ignore_other_prefixes"] = + serde_json::Value::Bool(ignore_other_prefixes); + crate::TestHarness::builder() .configuration_json(config) .unwrap() @@ -435,9 +439,44 @@ async fn it_accepts_when_auth_prefix_has_correct_format_and_valid_jwt() { assert_eq!(expected_mock_response_data, response.data.as_ref().unwrap()); } +#[tokio::test] +async fn it_accepts_when_auth_prefix_does_not_match_config_and_is_ignored() { + let test_harness = build_a_test_harness(None, None, false, true).await; + // Let's create a request with our operation name + let request_with_appropriate_name = supergraph::Request::canned_builder() + .operation_name("me".to_string()) + .header(http::header::AUTHORIZATION, "Basic dXNlcjpwYXNzd29yZA==") + .build() + .unwrap(); + + // ...And call our service stack with it + let mut service_response = test_harness + .oneshot(request_with_appropriate_name.try_into().unwrap()) + .await + .unwrap(); + let response: graphql::Response = serde_json::from_slice( + service_response + .next_response() + .await + .unwrap() + .unwrap() + .to_vec() + .as_slice(), + ) + .unwrap(); + + assert_eq!(response.errors, vec![]); + + assert_eq!(StatusCode::OK, service_response.response.status()); + + let expected_mock_response_data = "response created within the mock"; + // with the expected message + assert_eq!(expected_mock_response_data, response.data.as_ref().unwrap()); +} + #[tokio::test] async fn it_accepts_when_auth_prefix_has_correct_format_multiple_jwks_and_valid_jwt() { - let test_harness = build_a_test_harness(None, None, true).await; + let test_harness = build_a_test_harness(None, None, true, false).await; // Let's create a request with our operation name let request_with_appropriate_name = supergraph::Request::canned_builder() @@ -476,7 +515,8 @@ async fn it_accepts_when_auth_prefix_has_correct_format_multiple_jwks_and_valid_ #[tokio::test] async fn it_accepts_when_auth_prefix_has_correct_format_and_valid_jwt_custom_auth() { - let test_harness = build_a_test_harness(Some("SOMETHING".to_string()), None, false).await; + let test_harness = + build_a_test_harness(Some("SOMETHING".to_string()), None, false, false).await; // Let's create a request with our operation name let request_with_appropriate_name = supergraph::Request::canned_builder() @@ -515,7 +555,8 @@ async fn it_accepts_when_auth_prefix_has_correct_format_and_valid_jwt_custom_aut #[tokio::test] async fn it_accepts_when_auth_prefix_has_correct_format_and_valid_jwt_custom_prefix() { - let test_harness = build_a_test_harness(None, Some("SOMETHING".to_string()), false).await; + let test_harness = + build_a_test_harness(None, Some("SOMETHING".to_string()), false, false).await; // Let's create a request with our operation name let request_with_appropriate_name = supergraph::Request::canned_builder() @@ -554,7 +595,7 @@ async fn it_accepts_when_auth_prefix_has_correct_format_and_valid_jwt_custom_pre #[tokio::test] async fn it_accepts_when_no_auth_prefix_and_valid_jwt_custom_prefix() { - let test_harness = build_a_test_harness(None, Some("".to_string()), false).await; + let test_harness = build_a_test_harness(None, Some("".to_string()), false, false).await; // Let's create a request with our operation name let request_with_appropriate_name = supergraph::Request::canned_builder() @@ -594,13 +635,15 @@ async fn it_accepts_when_no_auth_prefix_and_valid_jwt_custom_prefix() { #[tokio::test] #[should_panic] async fn it_panics_when_auth_prefix_has_correct_format_but_contains_whitespace() { - let _test_harness = build_a_test_harness(None, Some("SOMET HING".to_string()), false).await; + let _test_harness = + build_a_test_harness(None, Some("SOMET HING".to_string()), false, false).await; } #[tokio::test] #[should_panic] async fn it_panics_when_auth_prefix_has_correct_format_but_contains_trailing_whitespace() { - let _test_harness = build_a_test_harness(None, Some("SOMETHING ".to_string()), false).await; + let _test_harness = + build_a_test_harness(None, Some("SOMETHING ".to_string()), false, false).await; } #[tokio::test] diff --git a/apollo-router/src/plugins/authorization/authenticated.rs b/apollo-router/src/plugins/authorization/authenticated.rs index f857e6f209..23c2ab6bda 100644 --- a/apollo-router/src/plugins/authorization/authenticated.rs +++ b/apollo-router/src/plugins/authorization/authenticated.rs @@ -354,11 +354,10 @@ impl<'a> transform::Visitor for AuthenticatedVisitor<'a> { let is_field_list = field_def.ty.is_list(); let field_requires_authentication = self.is_field_authenticated(field_def); - self.current_path - .push(PathElement::Key(field_name.as_str().into())); + .push(PathElement::Key(field_name.as_str().into(), None)); if is_field_list { - self.current_path.push(PathElement::Flatten); + self.current_path.push(PathElement::Flatten(None)); } let implementors_with_different_requirements = diff --git a/apollo-router/src/plugins/authorization/mod.rs b/apollo-router/src/plugins/authorization/mod.rs index 355ffd4b5c..f3cb7431f4 100644 --- a/apollo-router/src/plugins/authorization/mod.rs +++ b/apollo-router/src/plugins/authorization/mod.rs @@ -187,7 +187,7 @@ impl AuthorizationPlugin { } = Self::generate_cache_metadata( &doc.executable, operation_name, - &schema.definitions, + schema.supergraph_schema(), false, ); if is_authenticated { @@ -433,9 +433,12 @@ impl AuthorizationPlugin { doc: &ast::Document, is_authenticated: bool, ) -> Result)>, QueryPlannerError> { - if let Some(mut visitor) = - AuthenticatedVisitor::new(&schema.definitions, doc, &schema.implementers_map, dry_run) - { + if let Some(mut visitor) = AuthenticatedVisitor::new( + schema.supergraph_schema(), + doc, + &schema.implementers_map, + dry_run, + ) { let modified_query = transform::document(&mut visitor, doc) .map_err(|e| SpecError::TransformError(e.to_string()))?; @@ -469,7 +472,7 @@ impl AuthorizationPlugin { scopes: &[String], ) -> Result)>, QueryPlannerError> { if let Some(mut visitor) = ScopeFilteringVisitor::new( - &schema.definitions, + schema.supergraph_schema(), doc, &schema.implementers_map, scopes.iter().cloned().collect(), @@ -504,7 +507,7 @@ impl AuthorizationPlugin { policies: &[String], ) -> Result)>, QueryPlannerError> { if let Some(mut visitor) = PolicyFilteringVisitor::new( - &schema.definitions, + schema.supergraph_schema(), doc, &schema.implementers_map, policies.iter().cloned().collect(), diff --git a/apollo-router/src/plugins/authorization/policy.rs b/apollo-router/src/plugins/authorization/policy.rs index 17a900c6fe..d46cb4943a 100644 --- a/apollo-router/src/plugins/authorization/policy.rs +++ b/apollo-router/src/plugins/authorization/policy.rs @@ -475,11 +475,10 @@ impl<'a> transform::Visitor for PolicyFilteringVisitor<'a> { let implementors_with_different_field_requirements = self.implementors_with_different_field_requirements(parent_type, node); - self.current_path - .push(PathElement::Key(field_name.as_str().into())); + .push(PathElement::Key(field_name.as_str().into(), None)); if is_field_list { - self.current_path.push(PathElement::Flatten); + self.current_path.push(PathElement::Flatten(None)); } let res = if is_authorized diff --git a/apollo-router/src/plugins/authorization/scopes.rs b/apollo-router/src/plugins/authorization/scopes.rs index 8f07c64762..3298a3dcf1 100644 --- a/apollo-router/src/plugins/authorization/scopes.rs +++ b/apollo-router/src/plugins/authorization/scopes.rs @@ -477,11 +477,10 @@ impl<'a> transform::Visitor for ScopeFilteringVisitor<'a> { let implementors_with_different_field_requirements = self.implementors_with_different_field_requirements(parent_type, node); - self.current_path - .push(PathElement::Key(field_name.as_str().into())); + .push(PathElement::Key(field_name.as_str().into(), None)); if is_field_list { - self.current_path.push(PathElement::Flatten); + self.current_path.push(PathElement::Flatten(None)); } let res = if is_authorized diff --git a/apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__cache_key_metadata.snap b/apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__cache_key_metadata.snap new file mode 100644 index 0000000000..4c382bd481 --- /dev/null +++ b/apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__cache_key_metadata.snap @@ -0,0 +1,25 @@ +--- +source: apollo-router/src/plugins/authorization/tests.rs +expression: response +--- +{ + "data": { + "currentUser": { + "id": 1, + "name": null, + "phone": "1234" + } + }, + "errors": [ + { + "message": "Unauthorized field or type", + "path": [ + "currentUser", + "name" + ], + "extensions": { + "code": "UNAUTHORIZED_FIELD_OR_TYPE" + } + } + ] +} diff --git a/apollo-router/src/plugins/authorization/tests.rs b/apollo-router/src/plugins/authorization/tests.rs index ed3f6bb585..813533c184 100644 --- a/apollo-router/src/plugins/authorization/tests.rs +++ b/apollo-router/src/plugins/authorization/tests.rs @@ -6,7 +6,10 @@ use tower::ServiceExt; use crate::graphql; use crate::plugin::test::MockSubgraph; +use crate::plugin::test::MockSubgraphService; +use crate::plugins::authorization::CacheKeyMetadata; use crate::services::router; +use crate::services::subgraph; use crate::services::supergraph; use crate::Context; use crate::MockedSubgraphs; @@ -1015,3 +1018,142 @@ async fn errors_in_extensions() { insta::assert_json_snapshot!(response); } + +const CACHE_KEY_SCHEMA: &str = r#"schema +@link(url: "https://specs.apollo.dev/link/v1.0") +@link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) +@link(url: "https://specs.apollo.dev/authenticated/v0.1", for: SECURITY) +@link(url: "https://specs.apollo.dev/requiresScopes/v0.1", for: SECURITY) +@link(url: "https://specs.apollo.dev/policy/v0.1", for: SECURITY) + +{ +query: Query +} +directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA +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) 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 + +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 +} + +directive @authenticated on OBJECT | FIELD_DEFINITION | INTERFACE | SCALAR | ENUM +scalar federation__Scope +directive @requiresScopes(scopes: [[federation__Scope!]!]!) on OBJECT | FIELD_DEFINITION | INTERFACE | SCALAR | ENUM +directive @policy(policies: [[String!]!]!) on OBJECT | FIELD_DEFINITION | INTERFACE | SCALAR | ENUM + +scalar join__FieldSet +enum join__Graph { + USER @join__graph(name: "user", url: "http://localhost:4001/graphql") + ORGA @join__graph(name: "orga", url: "http://localhost:4002/graphql") +} + +type Query +@join__type(graph: ORGA) +@join__type(graph: USER){ + currentUser: User @join__field(graph: USER) + orga(id: ID): Organization @join__field(graph: ORGA) +} +type User +@join__type(graph: ORGA, key: "id") +@join__type(graph: USER, key: "id"){ + id: ID! @requiresScopes(scopes: [["id"]]) + name: String @policy(policies: [["name"]]) + phone: String @authenticated + activeOrganization: Organization +} +type Organization +@join__type(graph: ORGA, key: "id") +@join__type(graph: USER, key: "id") { + id: ID @authenticated + creatorUser: User + name: String + nonNullId: ID! + suborga: [Organization] +}"#; + +#[tokio::test] +async fn cache_key_metadata() { + let query = "query { currentUser { id name phone } }"; + + let service = TestHarness::builder() + .configuration_json(serde_json::json!({ + "include_subgraph_errors": { + "all": true + }, + "authorization": { + "directives": { + "enabled": true + } + } + })) + .unwrap() + .schema(CACHE_KEY_SCHEMA) + .subgraph_hook(|_name, _service| { + let mut mock_subgraph_service = MockSubgraphService::new(); + mock_subgraph_service.expect_call().times(1).returning( + move |req: subgraph::Request| { + assert_eq!( + *req.authorization, + CacheKeyMetadata { + is_authenticated: true, + scopes: vec!["id".to_string()], + policies: vec![] + } + ); + + Ok(subgraph::Response::fake_builder() + .context(req.context) + .data(serde_json::json! {{ + + "currentUser": { + "id": 1, + "name": "A", // This will be filtered because we don't have the policy + "phone": "1234" + } + + }}) + .build()) + }, + ); + mock_subgraph_service.boxed() + }) + .build_router() + .await + .unwrap(); + + let context = Context::new(); + context + .insert( + "apollo_authentication::JWT::claims", + json! {{ "scope": "id test" }}, + ) + .unwrap(); + + let request = supergraph::Request::fake_builder() + .query(query) + .context(context) + .build() + .unwrap(); + let mut response = service + .oneshot(router::Request::try_from(request).unwrap()) + .await + .unwrap(); + let response = response.next_response().await.unwrap().unwrap(); + let response: serde_json::Value = serde_json::from_slice(&response).unwrap(); + + insta::assert_json_snapshot!(response); +} diff --git a/apollo-router/src/plugins/cache/cache_control.rs b/apollo-router/src/plugins/cache/cache_control.rs index 85121ea157..016552a691 100644 --- a/apollo-router/src/plugins/cache/cache_control.rs +++ b/apollo-router/src/plugins/cache/cache_control.rs @@ -278,7 +278,11 @@ impl CacheControl { pub(crate) fn should_store(&self) -> bool { // FIXME: should we add support for must-understand? // public will be the default case - !(self.no_store || self.private) + !self.no_store + } + + pub(crate) fn private(&self) -> bool { + self.private } // We don't support revalidation yet diff --git a/apollo-router/src/plugins/cache/entity.rs b/apollo-router/src/plugins/cache/entity.rs index 0ed337c6d5..4839b9197a 100644 --- a/apollo-router/src/plugins/cache/entity.rs +++ b/apollo-router/src/plugins/cache/entity.rs @@ -1,4 +1,6 @@ use std::collections::HashMap; +use std::collections::HashSet; +use std::fmt::Write; use std::ops::ControlFlow; use std::sync::Arc; use std::time::Duration; @@ -12,6 +14,7 @@ use serde_json_bytes::ByteString; use serde_json_bytes::Value; use sha2::Digest; use sha2::Sha256; +use tokio::sync::RwLock; use tower::BoxError; use tower::ServiceBuilder; use tower::ServiceExt; @@ -47,11 +50,13 @@ pub(crate) const CONTEXT_CACHE_KEY: &str = "apollo_entity_cache::key"; register_plugin!("apollo", "preview_entity_cache", EntityCache); +#[derive(Clone)] pub(crate) struct EntityCache { storage: Option, subgraphs: Arc>, enabled: Option, metrics: Metrics, + private_queries: Arc>>, } /// Configuration for entity caching @@ -81,7 +86,11 @@ pub(crate) struct Subgraph { /// activates caching for this subgraph, overrides the global configuration #[serde(default)] - enabled: Option, + pub(crate) enabled: Option, + + /// Context key used to separate cache sections per user + #[serde(default)] + pub(crate) private_id: Option, } /// Per subgraph configuration for entity caching @@ -147,6 +156,7 @@ impl Plugin for EntityCache { enabled: init.config.enabled, subgraphs: Arc::new(init.config.subgraphs), metrics: init.config.metrics, + private_queries: Arc::new(RwLock::new(HashSet::new())), }) } @@ -177,14 +187,16 @@ impl Plugin for EntityCache { None => return service, }; - let (subgraph_ttl, subgraph_enabled) = if let Some(config) = self.subgraphs.get(name) { - ( - config.ttl.clone().map(|t| t.0).or_else(|| storage.ttl()), - config.enabled.or(self.enabled).unwrap_or(false), - ) - } else { - (storage.ttl(), self.enabled.unwrap_or(false)) - }; + let (subgraph_ttl, subgraph_enabled, private_id) = + if let Some(config) = self.subgraphs.get(name) { + ( + config.ttl.clone().map(|t| t.0).or_else(|| storage.ttl()), + config.enabled.or(self.enabled).unwrap_or(false), + config.private_id.clone(), + ) + } else { + (storage.ttl(), self.enabled.unwrap_or(false), None) + }; let name = name.to_string(); if self.metrics.enabled { @@ -197,11 +209,14 @@ impl Plugin for EntityCache { } if subgraph_enabled { + let private_queries = self.private_queries.clone(); tower::util::BoxService::new(CacheService(Some(InnerCacheService { service, name: name.to_string(), storage, subgraph_ttl, + private_queries, + private_id, }))) } else { service @@ -223,6 +238,7 @@ impl EntityCache { enabled: Some(true), subgraphs: Arc::new(subgraphs), metrics: Metrics::default(), + private_queries: Default::default(), }) } } @@ -233,6 +249,8 @@ struct InnerCacheService { name: String, storage: RedisCacheStorage, subgraph_ttl: Option, + private_queries: Arc>>, + private_id: Option, } impl Service for CacheService { @@ -263,6 +281,21 @@ impl InnerCacheService { mut self, request: subgraph::Request, ) -> Result { + let query = request + .subgraph_request + .body() + .query + .clone() + .unwrap_or_default(); + + let is_known_private = { self.private_queries.read().await.contains(&query) }; + let private_id = self.get_private_id(&request.context); + + // the response will have a private scope but we don't have a way to differentiate users, so we know we will not get or store anything in the cache + if is_known_private && private_id.is_none() { + return self.service.call(request).await; + } + if !request .subgraph_request .body() @@ -270,12 +303,18 @@ impl InnerCacheService { .contains_key(REPRESENTATIONS) { if request.operation_kind == OperationKind::Query { - match cache_lookup_root(self.name, self.storage.clone(), request) - .instrument(tracing::info_span!("cache_lookup")) - .await? + match cache_lookup_root( + self.name, + self.storage.clone(), + is_known_private, + private_id.as_deref(), + request, + ) + .instrument(tracing::info_span!("cache_lookup")) + .await? { ControlFlow::Break(response) => Ok(response), - ControlFlow::Continue((request, root_cache_key)) => { + ControlFlow::Continue((request, mut root_cache_key)) => { let response = self.service.call(request).await?; let cache_control = @@ -289,6 +328,20 @@ impl InnerCacheService { update_cache_control(&response.context, &cache_control); + if cache_control.private() { + // we did not know in advance that this was a query with a private scope, so we update the cache key + if !is_known_private { + self.private_queries.write().await.insert(query.to_string()); + } + + if let Some(s) = private_id.as_ref() { + root_cache_key = format!("{root_cache_key}:{s}"); + } else { + // the response has a private scope but we don't have a way to differentiate users, so we do not store the response in cache + return Ok(response); + } + } + cache_store_root_from_response( self.storage, self.subgraph_ttl, @@ -305,9 +358,15 @@ impl InnerCacheService { self.service.call(request).await } } else { - match cache_lookup_entities(self.name, self.storage.clone(), request) - .instrument(tracing::info_span!("cache_lookup")) - .await? + match cache_lookup_entities( + self.name, + self.storage.clone(), + is_known_private, + private_id.as_deref(), + request, + ) + .instrument(tracing::info_span!("cache_lookup")) + .await? { ControlFlow::Break(response) => Ok(response), ControlFlow::Continue((request, cache_result)) => { @@ -322,12 +381,18 @@ impl InnerCacheService { }; update_cache_control(&response.context, &cache_control); + if !is_known_private && cache_control.private() { + self.private_queries.write().await.insert(query.to_string()); + } + cache_store_entities_from_response( self.storage, self.subgraph_ttl, &mut response, cache_control, cache_result.0, + is_known_private, + private_id, ) .await?; Ok(response) @@ -335,11 +400,25 @@ impl InnerCacheService { } } } + + fn get_private_id(&self, context: &Context) -> Option { + self.private_id.as_ref().and_then(|key| { + context.get_json_value(key).and_then(|value| { + value.as_str().map(|s| { + let mut digest = Sha256::new(); + digest.update(s); + hex::encode(digest.finalize().as_slice()) + }) + }) + }) + } } async fn cache_lookup_root( name: String, cache: RedisCacheStorage, + is_known_private: bool, + private_id: Option<&str>, mut request: subgraph::Request, ) -> Result, BoxError> { let body = request.subgraph_request.body_mut(); @@ -350,6 +429,8 @@ async fn cache_lookup_root( body, &request.context, &request.authorization, + is_known_private, + private_id, ); let cache_result: Option> = cache.get(RedisKey(key.clone())).await; @@ -375,6 +456,8 @@ struct EntityCacheResults(Vec); async fn cache_lookup_entities( name: String, cache: RedisCacheStorage, + is_known_private: bool, + private_id: Option<&str>, mut request: subgraph::Request, ) -> Result, BoxError> { let body = request.subgraph_request.body_mut(); @@ -385,6 +468,8 @@ async fn cache_lookup_entities( body, &request.context, &request.authorization, + is_known_private, + private_id, )?; let cache_result: Vec> = cache @@ -489,6 +574,8 @@ async fn cache_store_entities_from_response( response: &mut subgraph::Response, cache_control: CacheControl, mut result_from_cache: Vec, + is_known_private: bool, + private_id: Option, ) -> Result<(), BoxError> { update_cache_control(&response.context, &cache_control); @@ -499,6 +586,15 @@ async fn cache_store_entities_from_response( .and_then(|v| v.as_object_mut()) .and_then(|o| o.remove(ENTITIES)) { + // if the scope is private but we do not have a way to differentiate users, do not store anything in the cache + let should_cache_private = !cache_control.private() || private_id.is_some(); + + let update_key_private = if !is_known_private && cache_control.private() { + private_id + } else { + None + }; + let (new_entities, new_errors) = insert_entities_in_result( entities .as_array_mut() @@ -510,6 +606,8 @@ async fn cache_store_entities_from_response( subgraph_ttl, cache_control, &mut result_from_cache, + update_key_private, + should_cache_private, ) .await?; @@ -596,6 +694,8 @@ fn extract_cache_key_root( body: &mut graphql::Request, context: &Context, cache_key: &CacheKeyMetadata, + is_known_private: bool, + private_id: Option<&str>, ) -> String { // hash the query and operation name let query_hash = hash_query(query_hash, body); @@ -606,10 +706,18 @@ fn extract_cache_key_root( // - subgraph name: caching is done per subgraph // - query hash: invalidate the entry for a specific query and operation name // - additional data: separate cache entries depending on info like authorization status - format!( - "subgraph:{}:Query:{}:{}", - subgraph_name, query_hash, additional_data_hash - ) + let mut key = String::new(); + let _ = write!( + &mut key, + "subgraph:{subgraph_name}:Query:{query_hash}:{additional_data_hash}" + ); + + if is_known_private { + if let Some(id) = private_id { + let _ = write!(&mut key, ":{id}"); + } + } + key } // build a list of keys to get from the cache in one query @@ -619,6 +727,8 @@ fn extract_cache_keys( body: &mut graphql::Request, context: &Context, cache_key: &CacheKeyMetadata, + is_known_private: bool, + private_id: Option<&str>, ) -> Result, BoxError> { // hash the query and operation name let query_hash = hash_query(query_hash, body); @@ -653,10 +763,13 @@ fn extract_cache_keys( // - entity key: invalidate a specific entity // - query hash: invalidate the entry for a specific query and operation name // - additional data: separate cache entries depending on info like authorization status - let key = format!( - "subgraph:{}:{}:{}:{}:{}", - subgraph_name, &typename, hashed_entity_key, query_hash, additional_data_hash - ); + let mut key = String::new(); + let _ = write!(&mut key, "subgraph:{subgraph_name}:{typename}:{hashed_entity_key}:{query_hash}:{additional_data_hash}"); + if is_known_private { + if let Some(id) = private_id { + let _ = write!(&mut key, ":{id}"); + } + } representation .as_object_mut() @@ -755,6 +868,7 @@ fn filter_representations( } // fill in the entities for the response +#[allow(clippy::too_many_arguments)] async fn insert_entities_in_result( entities: &mut Vec, errors: &[Error], @@ -762,6 +876,8 @@ async fn insert_entities_in_result( subgraph_ttl: Option, cache_control: CacheControl, result: &mut Vec, + update_key_private: Option, + should_cache_private: bool, ) -> Result<(Vec, Vec), BoxError> { let ttl: Option = cache_control .ttl() @@ -780,7 +896,7 @@ async fn insert_entities_in_result( for ( new_entity_idx, IntermediateResult { - key, + mut key, typename, cache_entry, }, @@ -798,40 +914,42 @@ async fn insert_entities_in_result( reason: "invalid number of entities".to_string(), })?; - if cache_control.should_store() { - *inserted_types.entry(typename).or_default() += 1; - - let mut has_errors = false; - for error in errors.iter().filter(|e| { - e.path - .as_ref() - .map(|path| { - path.starts_with(&Path(vec![ - PathElement::Key(ENTITIES.to_string()), - PathElement::Index(entity_idx), - ])) - }) - .unwrap_or(false) - }) { - // update the entity index, because it does not match with the original one - let mut e = error.clone(); - if let Some(path) = e.path.as_mut() { - path.0[1] = PathElement::Index(new_entity_idx); - } + *inserted_types.entry(typename).or_default() += 1; - new_errors.push(e); - has_errors = true; - } + if let Some(ref id) = update_key_private { + key = format!("{key}:{id}"); + } - if !has_errors { - to_insert.push(( - RedisKey(key), - RedisValue(CacheEntry { - control: cache_control.clone(), - data: value.clone(), - }), - )); + let mut has_errors = false; + for error in errors.iter().filter(|e| { + e.path + .as_ref() + .map(|path| { + path.starts_with(&Path(vec![ + PathElement::Key(ENTITIES.to_string(), None), + PathElement::Index(entity_idx), + ])) + }) + .unwrap_or(false) + }) { + // update the entity index, because it does not match with the original one + let mut e = error.clone(); + if let Some(path) = e.path.as_mut() { + path.0[1] = PathElement::Index(new_entity_idx); } + + new_errors.push(e); + has_errors = true; + } + + if !has_errors && cache_control.should_store() && should_cache_private { + to_insert.push(( + RedisKey(key), + RedisValue(CacheEntry { + control: cache_control.clone(), + data: value.clone(), + }), + )); } new_entities.push(value); diff --git a/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-2.snap b/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-2.snap new file mode 100644 index 0000000000..e3d6799c33 --- /dev/null +++ b/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-2.snap @@ -0,0 +1,17 @@ +--- +source: apollo-router/src/plugins/cache/tests.rs +expression: response +--- +{ + "data": { + "currentUser": { + "activeOrganization": { + "id": "1", + "creatorUser": { + "__typename": "User", + "id": 2 + } + } + } + } +} diff --git a/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-3.snap b/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-3.snap new file mode 100644 index 0000000000..3c363a2b4d --- /dev/null +++ b/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-3.snap @@ -0,0 +1,9 @@ +--- +source: apollo-router/src/plugins/cache/tests.rs +expression: response +--- +{ + "data": { + "currentUser": null + } +} diff --git a/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private.snap b/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private.snap new file mode 100644 index 0000000000..e3d6799c33 --- /dev/null +++ b/apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private.snap @@ -0,0 +1,17 @@ +--- +source: apollo-router/src/plugins/cache/tests.rs +expression: response +--- +{ + "data": { + "currentUser": { + "activeOrganization": { + "id": "1", + "creatorUser": { + "__typename": "User", + "id": 2 + } + } + } + } +} diff --git a/apollo-router/src/plugins/cache/tests.rs b/apollo-router/src/plugins/cache/tests.rs index de22c0e585..a7a59a2335 100644 --- a/apollo-router/src/plugins/cache/tests.rs +++ b/apollo-router/src/plugins/cache/tests.rs @@ -15,6 +15,7 @@ use tower::ServiceExt; use super::entity::EntityCache; use crate::cache::redis::RedisCacheStorage; use crate::plugin::test::MockSubgraph; +use crate::plugins::cache::entity::Subgraph; use crate::services::supergraph; use crate::Context; use crate::MockedSubgraphs; @@ -81,12 +82,13 @@ impl MockStore { impl Mocks for MockStore { fn process_command(&self, command: MockCommand) -> Result { - println!("mock2 received redis command: {command:?}"); + println!("mock received redis command: {command:?}"); match &*command.cmd { "GET" => { if let Some(RedisValue::Bytes(b)) = command.args.first() { if let Some(bytes) = self.map.lock().get(b) { + println!("-> returning {:?}", std::str::from_utf8(bytes)); return Ok(RedisValue::Bytes(bytes.clone())); } } @@ -114,6 +116,7 @@ impl Mocks for MockStore { Err(RedisError::new(RedisErrorKind::NotFound, "mock not found")) } } + #[tokio::test] async fn insert() { let query = "query { currentUser { activeOrganization { id creatorUser { __typename id } } } }"; @@ -293,3 +296,144 @@ async fn no_cache_control() { insta::assert_json_snapshot!(response); } + +#[tokio::test] +async fn private() { + let query = "query { currentUser { activeOrganization { id creatorUser { __typename id } } } }"; + + let subgraphs = MockedSubgraphs([ + ("user", MockSubgraph::builder().with_json( + serde_json::json!{{"query":"{currentUser{activeOrganization{__typename id}}}"}}, + serde_json::json!{{"data": {"currentUser": { "activeOrganization": { + "__typename": "Organization", + "id": "1" + } }}}} + ).with_header(CACHE_CONTROL, HeaderValue::from_static("private")) + .build()), + ("orga", MockSubgraph::builder().with_json( + serde_json::json!{{ + "query": "query($representations:[_Any!]!){_entities(representations:$representations){...on Organization{creatorUser{__typename id}}}}", + "variables": { + "representations": [ + { + "id": "1", + "__typename": "Organization", + } + ] + }}}, + serde_json::json!{{"data": { + "_entities": [{ + "creatorUser": { + "__typename": "User", + "id": 2 + } + }] + }}} + ).with_header(CACHE_CONTROL, HeaderValue::from_static("private")).build()) + ].into_iter().collect()); + + let redis_cache = RedisCacheStorage::from_mocks(Arc::new(MockStore::new())) + .await + .unwrap(); + let map = [ + ( + "user".to_string(), + Subgraph { + private_id: Some("sub".to_string()), + enabled: Some(true), + ttl: None, + }, + ), + ( + "orga".to_string(), + Subgraph { + private_id: Some("sub".to_string()), + enabled: Some(true), + ttl: None, + }, + ), + ] + .into_iter() + .collect(); + let entity_cache = EntityCache::with_mocks(redis_cache.clone(), map) + .await + .unwrap(); + + let service = TestHarness::builder() + .configuration_json(serde_json::json!({"include_subgraph_errors": { "all": true } })) + .unwrap() + .schema(SCHEMA) + .extra_plugin(entity_cache.clone()) + .extra_plugin(subgraphs) + .build_supergraph() + .await + .unwrap(); + + let context = Context::new(); + context.insert_json_value("sub", "1234".into()); + + let request = supergraph::Request::fake_builder() + .query(query) + .context(context) + .build() + .unwrap(); + let response = service + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); + + println!("\nNOW WITHOUT SUBGRAPHS\n"); + // Now testing without any mock subgraphs, all the data should come from the cache + let service = TestHarness::builder() + .configuration_json(serde_json::json!({"include_subgraph_errors": { "all": true } })) + .unwrap() + .schema(SCHEMA) + .extra_plugin(entity_cache) + .build_supergraph() + .await + .unwrap(); + + let context = Context::new(); + context.insert_json_value("sub", "1234".into()); + + let request = supergraph::Request::fake_builder() + .query(query) + .context(context) + .build() + .unwrap(); + let response = service + .clone() + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); + + println!("\nNOW WITH DIFFERENT SUB\n"); + + let context = Context::new(); + context.insert_json_value("sub", "5678".into()); + let request = supergraph::Request::fake_builder() + .query(query) + .context(context) + .build() + .unwrap(); + let response = service + .clone() + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); +} diff --git a/apollo-router/src/plugins/demand_control/directives.rs b/apollo-router/src/plugins/demand_control/cost_calculator/directives.rs similarity index 78% rename from apollo-router/src/plugins/demand_control/directives.rs rename to apollo-router/src/plugins/demand_control/cost_calculator/directives.rs index 73528107e9..23eae7d6f9 100644 --- a/apollo-router/src/plugins/demand_control/directives.rs +++ b/apollo-router/src/plugins/demand_control/cost_calculator/directives.rs @@ -8,12 +8,14 @@ use tower::BoxError; use super::DemandControlError; -pub(super) struct IncludeDirective { - pub(super) is_included: bool, +pub(in crate::plugins::demand_control) struct IncludeDirective { + pub(in crate::plugins::demand_control) is_included: bool, } impl IncludeDirective { - pub(super) fn from_field(field: &Field) -> Result, BoxError> { + pub(in crate::plugins::demand_control) fn from_field( + field: &Field, + ) -> Result, BoxError> { let directive = field .directives .get("include") @@ -25,12 +27,12 @@ impl IncludeDirective { } } -pub(super) struct RequiresDirective { - pub(super) fields: SelectionSet, +pub(in crate::plugins::demand_control) struct RequiresDirective { + pub(in crate::plugins::demand_control) fields: SelectionSet, } impl RequiresDirective { - pub(super) fn from_field( + pub(in crate::plugins::demand_control) fn from_field( field: &Field, parent_type_name: &NamedType, schema: &Valid, @@ -69,12 +71,14 @@ impl RequiresDirective { } } -pub(super) struct SkipDirective { - pub(super) is_skipped: bool, +pub(in crate::plugins::demand_control) struct SkipDirective { + pub(in crate::plugins::demand_control) is_skipped: bool, } impl SkipDirective { - pub(super) fn from_field(field: &Field) -> Result, BoxError> { + pub(in crate::plugins::demand_control) fn from_field( + field: &Field, + ) -> Result, BoxError> { let directive = field .directives .get("skip") diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_excluded_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_excluded_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_excluded_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_excluded_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_interface_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_interface_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_interface_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_interface_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_mutation.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_mutation.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_mutation.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_mutation.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_nested_list_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_nested_list_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_nested_list_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_nested_list_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_object_list_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_object_list_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_object_list_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_object_list_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_object_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_object_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_object_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_object_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_scalar_list_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_scalar_list_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_scalar_list_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_scalar_list_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_schema.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_schema.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_schema.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_schema.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_skipped_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_skipped_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_skipped_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_skipped_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/basic_union_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_union_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/basic_union_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_union_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_deferred_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_deferred_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_deferred_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_deferred_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_deferred_response.json b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_deferred_response.json similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_deferred_response.json rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_deferred_response.json diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_fragment_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_fragment_query.graphql similarity index 54% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_fragment_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_fragment_query.graphql index 9d6d479fd8..0e6970da38 100644 --- a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_fragment_query.graphql +++ b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_fragment_query.graphql @@ -3,11 +3,15 @@ fragment nameAndLicense on User { name } +fragment identifiedOwner on Ship { + owner { + ...nameAndLicense + } +} + { ships { - owner { - ...nameAndLicense - } + ...identifiedOwner } users { ...nameAndLicense diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_fragment_response.json b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_fragment_response.json similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_fragment_response.json rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_fragment_response.json diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_inline_fragment_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_inline_fragment_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_inline_fragment_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_inline_fragment_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_named_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_named_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_named_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_named_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_named_response.json b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_named_response.json similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_named_response.json rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_named_response.json diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_required_query.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_required_query.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_required_query.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_required_query.graphql diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_required_response.json b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_required_response.json similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_required_response.json rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_required_response.json diff --git a/apollo-router/src/plugins/demand_control/fixtures/federated_ships_schema.graphql b/apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_schema.graphql similarity index 100% rename from apollo-router/src/plugins/demand_control/fixtures/federated_ships_schema.graphql rename to apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_schema.graphql diff --git a/apollo-router/src/plugins/demand_control/cost_calculator/mod.rs b/apollo-router/src/plugins/demand_control/cost_calculator/mod.rs new file mode 100644 index 0000000000..b06323dd86 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/cost_calculator/mod.rs @@ -0,0 +1,5 @@ +mod directives; +mod schema_aware_response; +pub(crate) mod static_cost; + +use crate::plugins::demand_control::DemandControlError; diff --git a/apollo-router/src/plugins/demand_control/schema_aware_response.rs b/apollo-router/src/plugins/demand_control/cost_calculator/schema_aware_response.rs similarity index 84% rename from apollo-router/src/plugins/demand_control/schema_aware_response.rs rename to apollo-router/src/plugins/demand_control/cost_calculator/schema_aware_response.rs index c32ba20d33..2ee54a30cd 100644 --- a/apollo-router/src/plugins/demand_control/schema_aware_response.rs +++ b/apollo-router/src/plugins/demand_control/cost_calculator/schema_aware_response.rs @@ -137,13 +137,13 @@ mod tests { use bytes::Bytes; use crate::graphql::Response; - use crate::plugins::demand_control::schema_aware_response::SchemaAwareResponse; + use crate::plugins::demand_control::cost_calculator::schema_aware_response::SchemaAwareResponse; #[test] fn response_zipper() { - let schema_str = include_str!("./fixtures/federated_ships_schema.graphql"); - let query_str = include_str!("./fixtures/federated_ships_required_query.graphql"); - let response_bytes = include_bytes!("./fixtures/federated_ships_required_response.json"); + let schema_str = include_str!("fixtures/federated_ships_schema.graphql"); + let query_str = include_str!("fixtures/federated_ships_required_query.graphql"); + let response_bytes = include_bytes!("fixtures/federated_ships_required_response.json"); let schema = Schema::parse_and_validate(schema_str, "").unwrap(); let request = ExecutableDocument::parse(&schema, query_str, "").unwrap(); @@ -155,9 +155,9 @@ mod tests { #[test] fn fragment_response_zipper() { - let schema_str = include_str!("./fixtures/federated_ships_schema.graphql"); - let query_str = include_str!("./fixtures/federated_ships_fragment_query.graphql"); - let response_bytes = include_bytes!("./fixtures/federated_ships_fragment_response.json"); + let schema_str = include_str!("fixtures/federated_ships_schema.graphql"); + let query_str = include_str!("fixtures/federated_ships_fragment_query.graphql"); + let response_bytes = include_bytes!("fixtures/federated_ships_fragment_response.json"); let schema = Schema::parse_and_validate(schema_str, "").unwrap(); let request = ExecutableDocument::parse(&schema, query_str, "").unwrap(); @@ -169,9 +169,9 @@ mod tests { #[test] fn inline_fragment_zipper() { - let schema_str = include_str!("./fixtures/federated_ships_schema.graphql"); - let query_str = include_str!("./fixtures/federated_ships_inline_fragment_query.graphql"); - let response_bytes = include_bytes!("./fixtures/federated_ships_fragment_response.json"); + let schema_str = include_str!("fixtures/federated_ships_schema.graphql"); + let query_str = include_str!("fixtures/federated_ships_inline_fragment_query.graphql"); + let response_bytes = include_bytes!("fixtures/federated_ships_fragment_response.json"); let schema = Schema::parse_and_validate(schema_str, "").unwrap(); let request = ExecutableDocument::parse(&schema, query_str, "").unwrap(); @@ -183,9 +183,9 @@ mod tests { #[test] fn named_operation_zipper() { - let schema_str = include_str!("./fixtures/federated_ships_schema.graphql"); - let query_str = include_str!("./fixtures/federated_ships_named_query.graphql"); - let response_bytes = include_bytes!("./fixtures/federated_ships_named_response.json"); + let schema_str = include_str!("fixtures/federated_ships_schema.graphql"); + let query_str = include_str!("fixtures/federated_ships_named_query.graphql"); + let response_bytes = include_bytes!("fixtures/federated_ships_named_response.json"); let schema = Schema::parse_and_validate(schema_str, "").unwrap(); let request = ExecutableDocument::parse(&schema, query_str, "").unwrap(); diff --git a/apollo-router/src/plugins/demand_control/basic_cost_calculator.rs b/apollo-router/src/plugins/demand_control/cost_calculator/static_cost.rs similarity index 79% rename from apollo-router/src/plugins/demand_control/basic_cost_calculator.rs rename to apollo-router/src/plugins/demand_control/cost_calculator/static_cost.rs index 1614ec6550..80ef8de562 100644 --- a/apollo-router/src/plugins/demand_control/basic_cost_calculator.rs +++ b/apollo-router/src/plugins/demand_control/cost_calculator/static_cost.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use std::sync::Arc; use apollo_compiler::ast::NamedType; @@ -17,19 +16,28 @@ use super::directives::RequiresDirective; use super::directives::SkipDirective; use super::schema_aware_response::SchemaAwareResponse; use super::schema_aware_response::TypedValue; -use super::CostCalculator; use super::DemandControlError; use crate::graphql::Response; +use crate::query_planner::fetch::SubgraphOperation; +use crate::query_planner::fetch::SubgraphSchemas; use crate::query_planner::DeferredNode; use crate::query_planner::PlanNode; use crate::query_planner::Primary; use crate::query_planner::QueryPlan; -pub(crate) struct BasicCostCalculator { - subgraph_schemas: Arc>>>, +pub(crate) struct StaticCostCalculator { + list_size: u32, + subgraph_schemas: Arc, } -impl BasicCostCalculator { +impl StaticCostCalculator { + pub(crate) fn new(subgraph_schemas: Arc, list_size: u32) -> Self { + Self { + list_size, + subgraph_schemas, + } + } + /// Scores a field within a GraphQL operation, handling some expected cases where /// directives change how the query is fetched. In the case of the federation /// directive `@requires`, the cost of the required selection is added to the @@ -49,11 +57,13 @@ impl BasicCostCalculator { /// any deduplication happening in the query planner, and we're estimating an upper /// bound for cost anyway. fn score_field( + &self, field: &Field, - parent_type_name: &NamedType, + parent_type: &NamedType, schema: &Valid, + executable: &ExecutableDocument, ) -> Result { - if BasicCostCalculator::skipped_by_directives(field) { + if StaticCostCalculator::skipped_by_directives(field) { return Ok(0.0); } @@ -66,7 +76,11 @@ impl BasicCostCalculator { // Determine how many instances we're scoring. If there's no user-provided // information, assume lists have 100 items. - let instance_count = if field.ty().is_list() { 100.0 } else { 1.0 }; + let instance_count = if field.ty().is_list() { + self.list_size as f64 + } else { + 1.0 + }; // Determine the cost for this particular field. Scalars are free, non-scalars are not. // For fields with selections, add in the cost of the selections as well. @@ -75,20 +89,21 @@ impl BasicCostCalculator { } else { 0.0 }; - type_cost += BasicCostCalculator::score_selection_set( + type_cost += self.score_selection_set( &field.selection_set, field.ty().inner_named_type(), schema, + executable, )?; // If the field is marked with `@requires`, the required selection may not be included // in the query's selection. Adding that requirement's cost to the field ensures it's // accounted for. let requirements = - RequiresDirective::from_field(field, parent_type_name, schema)?.map(|d| d.fields); + RequiresDirective::from_field(field, parent_type, schema)?.map(|d| d.fields); let requirements_cost = match requirements { Some(selection_set) => { - BasicCostCalculator::score_selection_set(&selection_set, parent_type_name, schema)? + self.score_selection_set(&selection_set, parent_type, schema, executable)? } None => 0.0, }; @@ -106,25 +121,42 @@ impl BasicCostCalculator { Ok(cost) } - fn score_fragment_spread(_fragment_spread: &FragmentSpread) -> Result { - Ok(0.0) + fn score_fragment_spread( + &self, + fragment_spread: &FragmentSpread, + parent_type: &NamedType, + schema: &Valid, + executable: &ExecutableDocument, + ) -> Result { + let fragment = fragment_spread.fragment_def(executable).ok_or( + DemandControlError::QueryParseFailure(format!( + "Parsed operation did not have a definition for fragment {}", + fragment_spread.fragment_name + )), + )?; + self.score_selection_set(&fragment.selection_set, parent_type, schema, executable) } fn score_inline_fragment( + &self, inline_fragment: &InlineFragment, parent_type: &NamedType, schema: &Valid, + executable: &ExecutableDocument, ) -> Result { - BasicCostCalculator::score_selection_set( + self.score_selection_set( &inline_fragment.selection_set, parent_type, schema, + executable, ) } fn score_operation( + &self, operation: &Operation, schema: &Valid, + executable: &ExecutableDocument, ) -> Result { let mut cost = if operation.is_mutation() { 10.0 } else { 0.0 }; @@ -135,39 +167,43 @@ impl BasicCostCalculator { ))); }; - cost += BasicCostCalculator::score_selection_set( - &operation.selection_set, - root_type_name, - schema, - )?; + cost += + self.score_selection_set(&operation.selection_set, root_type_name, schema, executable)?; Ok(cost) } fn score_selection( + &self, selection: &Selection, parent_type: &NamedType, schema: &Valid, + executable: &ExecutableDocument, ) -> Result { match selection { - Selection::Field(f) => BasicCostCalculator::score_field(f, parent_type, schema), - Selection::FragmentSpread(s) => BasicCostCalculator::score_fragment_spread(s), - Selection::InlineFragment(i) => BasicCostCalculator::score_inline_fragment( + Selection::Field(f) => self.score_field(f, parent_type, schema, executable), + Selection::FragmentSpread(s) => { + self.score_fragment_spread(s, parent_type, schema, executable) + } + Selection::InlineFragment(i) => self.score_inline_fragment( i, i.type_condition.as_ref().unwrap_or(parent_type), schema, + executable, ), } } fn score_selection_set( + &self, selection_set: &SelectionSet, parent_type_name: &NamedType, schema: &Valid, + executable: &ExecutableDocument, ) -> Result { let mut cost = 0.0; for selection in selection_set.selections.iter() { - cost += BasicCostCalculator::score_selection(selection, parent_type_name, schema)?; + cost += self.score_selection(selection, parent_type_name, schema, executable)?; } Ok(cost) } @@ -210,21 +246,22 @@ impl BasicCostCalculator { fn estimated_cost_of_operation( &self, - subgraph: &String, - operation: &String, + subgraph: &str, + operation: &SubgraphOperation, ) -> Result { tracing::debug!("On subgraph {}, scoring operation: {}", subgraph, operation); - let schema = - self.subgraph_schemas - .get(subgraph) - .ok_or(DemandControlError::QueryParseFailure(format!( - "Query planner did not provide a schema for service {}", - subgraph - )))?; - let query = ExecutableDocument::parse(schema, operation, "")?; + let schema = self.subgraph_schemas.get(subgraph).ok_or_else(|| { + DemandControlError::QueryParseFailure(format!( + "Query planner did not provide a schema for service {}", + subgraph + )) + })?; - Self::estimated(&query, schema) + let operation = operation + .as_parsed(schema) + .map_err(DemandControlError::InvalidSubgraphQuery)?; + self.estimated(operation, schema) } fn max_score_of_nodes( @@ -293,28 +330,28 @@ impl BasicCostCalculator { } Ok(score) } -} -impl CostCalculator for BasicCostCalculator { - fn estimated( + pub(crate) fn estimated( + &self, query: &ExecutableDocument, schema: &Valid, ) -> Result { let mut cost = 0.0; if let Some(op) = &query.anonymous_operation { - cost += BasicCostCalculator::score_operation(op, schema)?; + cost += self.score_operation(op, schema, query)?; } for (_name, op) in query.named_operations.iter() { - cost += BasicCostCalculator::score_operation(op, schema)?; + cost += self.score_operation(op, schema, query)?; } Ok(cost) } - fn planned(&self, query_plan: &QueryPlan) -> Result { + pub(crate) fn planned(&self, query_plan: &QueryPlan) -> Result { self.score_plan_node(&query_plan.root) } - fn actual( + pub(crate) fn actual( + &self, request: &ExecutableDocument, response: &Response, ) -> Result { @@ -355,7 +392,9 @@ mod tests { fn estimated_cost(schema_str: &str, query_str: &str) -> f64 { let (schema, query) = parse_schema_and_operation(schema_str, query_str, &Default::default()); - BasicCostCalculator::estimated(&query.executable, &schema.definitions).unwrap() + StaticCostCalculator::new(Default::default(), 100) + .estimated(&query.executable, schema.supergraph_schema()) + .unwrap() } /// Estimate cost of an operation on a plain, non-federated schema. @@ -368,7 +407,9 @@ mod tests { "query.graphql", ) .unwrap(); - BasicCostCalculator::estimated(&query, &schema).unwrap() + StaticCostCalculator::new(Default::default(), 100) + .estimated(&query, &schema) + .unwrap() } async fn planned_cost(schema_str: &str, query_str: &str) -> f64 { @@ -391,8 +432,9 @@ mod tests { _ => panic!("Query planner returned unexpected non-plan content"), }; - let calculator = BasicCostCalculator { + let calculator = StaticCostCalculator { subgraph_schemas: planner.subgraph_schemas(), + list_size: 100, }; calculator.planned(&query_plan).unwrap() @@ -402,7 +444,9 @@ mod tests { let (_schema, query) = parse_schema_and_operation(schema_str, query_str, &Default::default()); let response = Response::from_bytes("test", Bytes::from(response_bytes)).unwrap(); - BasicCostCalculator::actual(&query.executable, &response).unwrap() + StaticCostCalculator::new(Default::default(), 100) + .actual(&query.executable, &response) + .unwrap() } #[test] @@ -538,4 +582,21 @@ mod tests { assert_eq!(planned_cost(schema, query).await, 10400.0); assert_eq!(actual_cost(schema, query, response), 2.0); } + + #[test(tokio::test)] + async fn federated_query_with_adjustable_list_cost() { + let schema = include_str!("./fixtures/federated_ships_schema.graphql"); + let query = include_str!("./fixtures/federated_ships_deferred_query.graphql"); + let (schema, query) = parse_schema_and_operation(schema, query, &Default::default()); + + let conservative_estimate = StaticCostCalculator::new(Default::default(), 100) + .estimated(&query.executable, schema.supergraph_schema()) + .unwrap(); + let narrow_estimate = StaticCostCalculator::new(Default::default(), 5) + .estimated(&query.executable, schema.supergraph_schema()) + .unwrap(); + + assert_eq!(conservative_estimate, 10200.0); + assert_eq!(narrow_estimate, 35.0); + } } diff --git a/apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_request.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_request.router.yaml new file mode 100644 index 0000000000..dffa5e6951 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_request.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: enforce + strategy: + test: + stage: execution_request + error: estimated_cost_too_expensive \ No newline at end of file diff --git a/apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_response.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_response.router.yaml new file mode 100644 index 0000000000..e4a954cbcd --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_response.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: enforce + strategy: + test: + stage: execution_response + error: estimated_cost_too_expensive \ No newline at end of file diff --git a/apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_request.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_request.router.yaml new file mode 100644 index 0000000000..731fffb8f9 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_request.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: enforce + strategy: + test: + stage: subgraph_request + error: estimated_cost_too_expensive \ No newline at end of file diff --git a/apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_response.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_response.router.yaml new file mode 100644 index 0000000000..ff97fd8c25 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_response.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: enforce + strategy: + test: + stage: subgraph_response + error: estimated_cost_too_expensive \ No newline at end of file diff --git a/apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_request.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_request.router.yaml new file mode 100644 index 0000000000..18ddc41e57 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_request.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: measure + strategy: + test: + stage: execution_request + error: estimated_cost_too_expensive diff --git a/apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_response.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_response.router.yaml new file mode 100644 index 0000000000..efcc67c8df --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_response.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: measure + strategy: + test: + stage: execution_response + error: estimated_cost_too_expensive diff --git a/apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_request.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_request.router.yaml new file mode 100644 index 0000000000..18ddc41e57 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_request.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: measure + strategy: + test: + stage: execution_request + error: estimated_cost_too_expensive diff --git a/apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_response.router.yaml b/apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_response.router.yaml new file mode 100644 index 0000000000..efcc67c8df --- /dev/null +++ b/apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_response.router.yaml @@ -0,0 +1,7 @@ +experimental_demand_control: + enabled: true + mode: measure + strategy: + test: + stage: execution_response + error: estimated_cost_too_expensive diff --git a/apollo-router/src/plugins/demand_control/mod.rs b/apollo-router/src/plugins/demand_control/mod.rs index a071f1a903..e4a8d1f692 100644 --- a/apollo-router/src/plugins/demand_control/mod.rs +++ b/apollo-router/src/plugins/demand_control/mod.rs @@ -1,13 +1,17 @@ //! Demand control plugin. -mod basic_cost_calculator; -mod directives; -mod schema_aware_response; +//! This plugin will use the cost calculation algorithm to determine if a query should be allowed to execute. +//! On the request path it will use estimated +use std::future; +use std::ops::ControlFlow; +use std::sync::Arc; -use apollo_compiler::executable::ExecutableDocument; use apollo_compiler::validation::Valid; use apollo_compiler::validation::WithErrors; -use apollo_compiler::Schema; +use apollo_compiler::ExecutableDocument; use displaydoc::Display; +use futures::future::Either; +use futures::stream; +use futures::StreamExt; use schemars::JsonSchema; use serde::Deserialize; use thiserror::Error; @@ -15,17 +19,56 @@ use tower::BoxError; use tower::ServiceBuilder; use tower::ServiceExt; +use crate::error::Error; +use crate::error::ValidationErrors; use crate::graphql; +use crate::graphql::IntoGraphQLErrors; +use crate::json_ext::Object; +use crate::layers::ServiceBuilderExt; use crate::plugin::Plugin; use crate::plugin::PluginInit; -use crate::query_planner::QueryPlan; +use crate::plugins::demand_control::strategy::Strategy; +use crate::plugins::demand_control::strategy::StrategyFactory; use crate::register_plugin; +use crate::services::execution; use crate::services::execution::BoxService; +use crate::services::subgraph; + +pub(crate) mod cost_calculator; +pub(crate) mod strategy; + +/// The cost calculation information stored in context for use in telemetry and other plugins that need to know what cost was calculated. +pub(crate) struct CostContext { + pub(crate) estimated: f64, + pub(crate) actual: f64, + pub(crate) result: &'static str, +} + +impl Default for CostContext { + fn default() -> Self { + Self { + estimated: 0.0, + actual: 0.0, + result: "COST_OK", + } + } +} + +impl CostContext { + pub(crate) fn delta(&self) -> f64 { + self.estimated - self.actual + } + + pub(crate) fn result(&mut self, error: DemandControlError) -> DemandControlError { + self.result = error.code(); + error + } +} /// Algorithm for calculating the cost of an incoming query. #[derive(Clone, Debug, Deserialize, JsonSchema)] #[serde(deny_unknown_fields, rename_all = "snake_case")] -pub(crate) enum CostCalculationAlgorithm { +pub(crate) enum StrategyConfig { /// A simple, statically-defined cost mapping for operations and types. /// /// Operation costs: @@ -39,21 +82,25 @@ pub(crate) enum CostCalculationAlgorithm { /// - Union: 1 /// - Scalar: 0 /// - Enum: 0 - Basic, -} - -trait CostCalculator { - fn estimated( - query: &ExecutableDocument, - schema: &Valid, - ) -> Result; + StaticEstimated { + /// The assumed length of lists returned by the operation. + list_size: u32, + /// The maximum cost of a query + max: f64, + }, - fn planned(&self, query_plan: &QueryPlan) -> Result; + #[cfg(test)] + Test { + stage: test::TestStage, + error: test::TestError, + }, +} - fn actual( - request: &ExecutableDocument, - response: &graphql::Response, - ) -> Result; +#[derive(Copy, Clone, Debug, Deserialize, JsonSchema, Eq, PartialEq)] +#[serde(deny_unknown_fields, rename_all = "snake_case")] +enum Mode { + Measure, + Enforce, } /// Demand control configuration @@ -62,28 +109,104 @@ trait CostCalculator { pub(crate) struct DemandControlConfig { /// Enable demand control enabled: bool, - /// The algorithm used to calculate the cost of an incoming request - #[allow(dead_code)] - algorithm: CostCalculationAlgorithm, + /// The mode that the demand control plugin should operate in. + /// - Measure: The plugin will measure the cost of incoming requests but not reject them. + /// - Enforce: The plugin will enforce the cost of incoming requests and reject them if the algorithm indicates that they should be rejected. + mode: Mode, + /// The strategy used to reject requests. + strategy: StrategyConfig, } #[derive(Debug, Display, Error)] pub(crate) enum DemandControlError { + /// query estimated cost {estimated_cost} exceeded configured maximum {max_cost} + EstimatedCostTooExpensive { + /// The estimated cost of the query + estimated_cost: f64, + /// The maximum cost of the query + max_cost: f64, + }, + /// auery actual cost {actual_cost} exceeded configured maximum {max_cost} + #[allow(dead_code)] + ActualCostTooExpensive { + /// The actual cost of the query + actual_cost: f64, + /// The maximum cost of the query + max_cost: f64, + }, /// Query could not be parsed: {0} QueryParseFailure(String), + /// Invalid subgraph query: {0} + InvalidSubgraphQuery(ValidationErrors), /// The response body could not be properly matched with its query's structure: {0} ResponseTypingFailure(String), } +impl IntoGraphQLErrors for DemandControlError { + fn into_graphql_errors(self) -> Result, Self> { + match self { + DemandControlError::EstimatedCostTooExpensive { + estimated_cost, + max_cost, + } => { + let mut extensions = Object::new(); + extensions.insert("cost.estimated", estimated_cost.into()); + extensions.insert("cost.max", max_cost.into()); + Ok(vec![graphql::Error::builder() + .extension_code(self.code()) + .extensions(extensions) + .message(self.to_string()) + .build()]) + } + DemandControlError::ActualCostTooExpensive { + actual_cost, + max_cost, + } => { + let mut extensions = Object::new(); + extensions.insert("cost.actual", actual_cost.into()); + extensions.insert("cost.max", max_cost.into()); + Ok(vec![graphql::Error::builder() + .extension_code(self.code()) + .extensions(extensions) + .message(self.to_string()) + .build()]) + } + DemandControlError::QueryParseFailure(_) => Ok(vec![graphql::Error::builder() + .extension_code(self.code()) + .message(self.to_string()) + .build()]), + DemandControlError::ResponseTypingFailure(_) => Ok(vec![graphql::Error::builder() + .extension_code(self.code()) + .message(self.to_string()) + .build()]), + DemandControlError::InvalidSubgraphQuery(errors) => { + Ok(errors.into_graphql_errors_infallible()) + } + } + } +} + +impl DemandControlError { + fn code(&self) -> &'static str { + match self { + DemandControlError::EstimatedCostTooExpensive { .. } => "COST_ESTIMATED_TOO_EXPENSIVE", + DemandControlError::ActualCostTooExpensive { .. } => "COST_ACTUAL_TOO_EXPENSIVE", + DemandControlError::QueryParseFailure(_) => "COST_QUERY_PARSE_FAILURE", + DemandControlError::ResponseTypingFailure(_) => "COST_RESPONSE_TYPING_FAILURE", + DemandControlError::InvalidSubgraphQuery(_) => "GRAPHQL_VALIDATION_FAILED", + } + } +} + impl From> for DemandControlError { fn from(value: WithErrors) -> Self { DemandControlError::QueryParseFailure(format!("{}", value)) } } -#[derive(Clone, Debug)] pub(crate) struct DemandControl { config: DemandControlConfig, + strategy_factory: StrategyFactory, } #[async_trait::async_trait] @@ -92,6 +215,11 @@ impl Plugin for DemandControl { async fn new(init: PluginInit) -> Result { Ok(DemandControl { + strategy_factory: StrategyFactory::new( + init.config.clone(), + init.supergraph_schema.clone(), + init.subgraph_schemas.clone(), + ), config: init.config, }) } @@ -100,9 +228,334 @@ impl Plugin for DemandControl { if !self.config.enabled { service } else { - ServiceBuilder::new().service(service).boxed() + let strategy = self.strategy_factory.create(); + ServiceBuilder::new() + .checkpoint(move |req: execution::Request| { + req.context.extensions().lock().insert(strategy.clone()); + // On the request path we need to check for estimates, checkpoint is used to do this, short-circuiting the request if it's too expensive. + Ok(match strategy.on_execution_request(&req) { + Ok(_) => ControlFlow::Continue(req), + Err(err) => ControlFlow::Break( + execution::Response::builder() + .errors( + err.into_graphql_errors() + .expect("must be able to convert to graphql error"), + ) + .context(req.context.clone()) + .build() + .expect("Must be able to build response"), + ), + }) + }) + .map_response(|mut resp: execution::Response| { + let req = resp + .context + .unsupported_executable_document() + .expect("must have document"); + let strategy = resp + .context + .extensions() + .lock() + .get::() + .expect("must have strategy") + .clone(); + let context = resp.context.clone(); + resp.response = resp.response.map(move |resp| { + // Here we are going to abort the stream if the cost is too high + // First we map based on cost, then we use take while to abort the stream if an error is emitted. + // When we terminate the stream we still want to emit a graphql error, so the error response is emitted first before a termination error. + resp.flat_map(move |resp| { + match strategy.on_execution_response(&context, req.as_ref(), &resp) { + Ok(_) => Either::Left(stream::once(future::ready(Ok(resp)))), + Err(err) => Either::Right(stream::iter(vec![ + // This is the error we are returning to the user + Ok(graphql::Response::builder() + .errors( + err.into_graphql_errors() + .expect("must be able to convert to graphql error"), + ) + .extensions(crate::json_ext::Object::new()) + .build()), + // This will terminate the stream + Err(()), + ])), + } + }) + // Terminate the stream on error + .take_while(|resp| future::ready(resp.is_ok())) + // Unwrap the result. This is safe because we are terminating the stream on error. + .map(|i| i.expect("error used to terminate stream")) + .boxed() + }); + resp + }) + .service(service) + .boxed() + } + } + + fn subgraph_service( + &self, + _subgraph_name: &str, + service: subgraph::BoxService, + ) -> subgraph::BoxService { + if !self.config.enabled { + service + } else { + ServiceBuilder::new() + .checkpoint(move |req: subgraph::Request| { + let strategy = req + .context + .extensions() + .lock() + .get::() + .expect("must have strategy") + .clone(); + + // On the request path we need to check for estimates, checkpoint is used to do this, short-circuiting the request if it's too expensive. + Ok(match strategy.on_subgraph_request(&req) { + Ok(_) => ControlFlow::Continue(req), + Err(err) => ControlFlow::Break( + subgraph::Response::builder() + .errors( + err.into_graphql_errors() + .expect("must be able to convert to graphql error"), + ) + .context(req.context.clone()) + .extensions(crate::json_ext::Object::new()) + .build(), + ), + }) + }) + .map_future_with_request_data( + |req: &subgraph::Request| { + //TODO convert this to expect + req.executable_document.clone().unwrap_or_else(|| { + Arc::new(Valid::assume_valid(ExecutableDocument::new())) + }) + }, + |req: Arc>, fut| async move { + let resp: subgraph::Response = fut.await?; + let strategy = resp + .context + .extensions() + .lock() + .get::() + .expect("must have strategy") + .clone(); + Ok(match strategy.on_subgraph_response(req.as_ref(), &resp) { + Ok(_) => resp, + Err(err) => subgraph::Response::builder() + .errors( + err.into_graphql_errors() + .expect("must be able to convert to graphql error"), + ) + .context(resp.context.clone()) + .extensions(Object::new()) + .build(), + }) + }, + ) + .service(service) + .boxed() } } } register_plugin!("apollo", "experimental_demand_control", DemandControl); + +#[cfg(test)] +mod test { + use std::sync::Arc; + + use apollo_compiler::ast; + use apollo_compiler::validation::Valid; + use apollo_compiler::ExecutableDocument; + use futures::StreamExt; + use schemars::JsonSchema; + use serde::Deserialize; + + use crate::graphql; + use crate::graphql::Response; + use crate::plugins::demand_control::DemandControl; + use crate::plugins::demand_control::DemandControlError; + use crate::plugins::test::PluginTestHarness; + use crate::query_planner::fetch::QueryHash; + use crate::services::execution; + use crate::services::layers::query_analysis::ParsedDocument; + use crate::services::layers::query_analysis::ParsedDocumentInner; + use crate::services::subgraph; + use crate::Context; + + #[tokio::test] + async fn test_measure_on_execution_request() { + let body = test_on_execution(include_str!( + "fixtures/measure_on_execution_request.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + #[tokio::test] + async fn test_enforce_on_execution_request() { + let body = test_on_execution(include_str!( + "fixtures/enforce_on_execution_request.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + #[tokio::test] + async fn test_measure_on_execution_response() { + let body = test_on_execution(include_str!( + "fixtures/measure_on_execution_response.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + #[tokio::test] + async fn test_enforce_on_execution_response() { + let body = test_on_execution(include_str!( + "fixtures/enforce_on_execution_response.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + #[tokio::test] + async fn test_measure_on_subgraph_request() { + let body = test_on_subgraph(include_str!( + "fixtures/measure_on_subgraph_request.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + #[tokio::test] + async fn test_enforce_on_subgraph_request() { + let body = test_on_subgraph(include_str!( + "fixtures/enforce_on_subgraph_request.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + #[tokio::test] + async fn test_measure_on_subgraph_response() { + let body = test_on_subgraph(include_str!( + "fixtures/measure_on_subgraph_response.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + #[tokio::test] + async fn test_enforce_on_subgraph_response() { + let body = test_on_subgraph(include_str!( + "fixtures/enforce_on_subgraph_response.router.yaml" + )) + .await; + insta::assert_yaml_snapshot!(body); + } + + async fn test_on_execution(config: &'static str) -> Vec { + let plugin = PluginTestHarness::::builder() + .config(config) + .build() + .await; + + let ctx = context(); + + let resp = plugin + .call_execution( + execution::Request::fake_builder().context(ctx).build(), + |req| { + execution::Response::fake_builder() + .context(req.context) + .build() + .unwrap() + }, + ) + .await + .unwrap(); + + resp.response + .into_body() + .collect::>() + .await + } + + async fn test_on_subgraph(config: &'static str) -> Response { + let plugin = PluginTestHarness::::builder() + .config(config) + .build() + .await; + let strategy = plugin.strategy_factory.create(); + + let ctx = context(); + ctx.extensions().lock().insert(strategy); + let mut req = subgraph::Request::fake_builder() + .subgraph_name("test") + .context(ctx) + .build(); + req.executable_document = Some(Arc::new(Valid::assume_valid(ExecutableDocument::new()))); + let resp = plugin + .call_subgraph(req, |req| { + subgraph::Response::fake_builder() + .context(req.context) + .build() + }) + .await + .unwrap(); + + resp.response.into_body() + } + + fn context() -> Context { + let parsed_document = ParsedDocumentInner { + executable: Arc::new(Valid::assume_valid(ExecutableDocument::new())), + hash: Arc::new(QueryHash::default()), + ast: ast::Document::new(), + }; + let ctx = Context::new(); + ctx.extensions() + .lock() + .insert(ParsedDocument::new(parsed_document)); + ctx + } + + #[derive(Clone, Debug, Deserialize, JsonSchema)] + #[serde(deny_unknown_fields, rename_all = "snake_case")] + pub(crate) enum TestStage { + ExecutionRequest, + ExecutionResponse, + SubgraphRequest, + SubgraphResponse, + } + + #[derive(Clone, Debug, Deserialize, JsonSchema)] + #[serde(deny_unknown_fields, rename_all = "snake_case")] + pub(crate) enum TestError { + EstimatedCostTooExpensive, + ActualCostTooExpensive, + } + + impl From<&TestError> for DemandControlError { + fn from(value: &TestError) -> Self { + match value { + TestError::EstimatedCostTooExpensive => { + DemandControlError::EstimatedCostTooExpensive { + max_cost: 1.0, + estimated_cost: 2.0, + } + } + + TestError::ActualCostTooExpensive => DemandControlError::ActualCostTooExpensive { + actual_cost: 1.0, + max_cost: 2.0, + }, + } + } + } +} diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_request.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_request.snap new file mode 100644 index 0000000000..5eba5d7cee --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_request.snap @@ -0,0 +1,10 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +- errors: + - message: query estimated cost 2 exceeded configured maximum 1 + extensions: + cost.estimated: 2 + cost.max: 1 + code: COST_ESTIMATED_TOO_EXPENSIVE diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_response.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_response.snap new file mode 100644 index 0000000000..5eba5d7cee --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_response.snap @@ -0,0 +1,10 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +- errors: + - message: query estimated cost 2 exceeded configured maximum 1 + extensions: + cost.estimated: 2 + cost.max: 1 + code: COST_ESTIMATED_TOO_EXPENSIVE diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_request.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_request.snap new file mode 100644 index 0000000000..9daee688ef --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_request.snap @@ -0,0 +1,11 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +data: ~ +errors: + - message: query estimated cost 2 exceeded configured maximum 1 + extensions: + cost.estimated: 2 + cost.max: 1 + code: COST_ESTIMATED_TOO_EXPENSIVE diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_response.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_response.snap new file mode 100644 index 0000000000..9daee688ef --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_response.snap @@ -0,0 +1,11 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +data: ~ +errors: + - message: query estimated cost 2 exceeded configured maximum 1 + extensions: + cost.estimated: 2 + cost.max: 1 + code: COST_ESTIMATED_TOO_EXPENSIVE diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_request.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_request.snap new file mode 100644 index 0000000000..ca48f2632f --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_request.snap @@ -0,0 +1,5 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +- {} diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_response.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_response.snap new file mode 100644 index 0000000000..ca48f2632f --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_response.snap @@ -0,0 +1,5 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +- {} diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_request.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_request.snap new file mode 100644 index 0000000000..780b2ce2df --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_request.snap @@ -0,0 +1,5 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +data: ~ diff --git a/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_response.snap b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_response.snap new file mode 100644 index 0000000000..780b2ce2df --- /dev/null +++ b/apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_response.snap @@ -0,0 +1,5 @@ +--- +source: apollo-router/src/plugins/demand_control/mod.rs +expression: body +--- +data: ~ diff --git a/apollo-router/src/plugins/demand_control/strategy/mod.rs b/apollo-router/src/plugins/demand_control/strategy/mod.rs new file mode 100644 index 0000000000..eba60a6b63 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/strategy/mod.rs @@ -0,0 +1,131 @@ +use std::collections::HashMap; +use std::sync::Arc; + +use apollo_compiler::validation::Valid; +use apollo_compiler::ExecutableDocument; +use apollo_compiler::Schema; + +use crate::graphql; +use crate::plugins::demand_control::cost_calculator::static_cost::StaticCostCalculator; +use crate::plugins::demand_control::strategy::static_estimated::StaticEstimated; +use crate::plugins::demand_control::DemandControlConfig; +use crate::plugins::demand_control::DemandControlError; +use crate::plugins::demand_control::Mode; +use crate::plugins::demand_control::StrategyConfig; +use crate::services::execution; +use crate::services::subgraph; +use crate::Context; + +mod static_estimated; +#[cfg(test)] +mod test; + +/// Strategy for a demand control exists for an entire request. It is Send and Sync but may contain state +/// such as the amount of budget remaining. +/// It is also responsible for updating metrics on what was rejected. +#[derive(Clone)] +pub(crate) struct Strategy { + inner: Arc, + mode: Mode, +} +impl Strategy { + pub(crate) fn on_execution_request( + &self, + request: &execution::Request, + ) -> Result<(), DemandControlError> { + match self.inner.on_execution_request(request) { + Err(e) if self.mode == Mode::Enforce => Err(e), + _ => Ok(()), + } + } + pub(crate) fn on_subgraph_request( + &self, + request: &subgraph::Request, + ) -> Result<(), DemandControlError> { + match self.inner.on_subgraph_request(request) { + Err(e) if self.mode == Mode::Enforce => Err(e), + _ => Ok(()), + } + } + + pub(crate) fn on_subgraph_response( + &self, + request: &ExecutableDocument, + response: &subgraph::Response, + ) -> Result<(), DemandControlError> { + match self.inner.on_subgraph_response(request, response) { + Err(e) if self.mode == Mode::Enforce => Err(e), + _ => Ok(()), + } + } + pub(crate) fn on_execution_response( + &self, + context: &Context, + request: &ExecutableDocument, + response: &graphql::Response, + ) -> Result<(), DemandControlError> { + match self.inner.on_execution_response(context, request, response) { + Err(e) if self.mode == Mode::Enforce => Err(e), + _ => Ok(()), + } + } +} + +pub(crate) struct StrategyFactory { + config: DemandControlConfig, + #[allow(dead_code)] + supergraph_schema: Arc>, + subgraph_schemas: Arc>>>, +} + +impl StrategyFactory { + pub(crate) fn new( + config: DemandControlConfig, + supergraph_schema: Arc>, + subgraph_schemas: Arc>>>, + ) -> Self { + Self { + config, + supergraph_schema, + subgraph_schemas, + } + } + + pub(crate) fn create(&self) -> Strategy { + let strategy: Arc = match &self.config.strategy { + StrategyConfig::StaticEstimated { list_size, max } => Arc::new(StaticEstimated { + max: *max, + cost_calculator: StaticCostCalculator::new( + self.subgraph_schemas.clone(), + *list_size, + ), + }), + #[cfg(test)] + StrategyConfig::Test { stage, error } => Arc::new(test::Test { + stage: stage.clone(), + error: error.clone(), + }), + }; + Strategy { + mode: self.config.mode, + inner: strategy, + } + } +} + +pub(crate) trait StrategyImpl: Send + Sync { + fn on_execution_request(&self, request: &execution::Request) -> Result<(), DemandControlError>; + fn on_subgraph_request(&self, request: &subgraph::Request) -> Result<(), DemandControlError>; + + fn on_subgraph_response( + &self, + request: &ExecutableDocument, + response: &subgraph::Response, + ) -> Result<(), DemandControlError>; + fn on_execution_response( + &self, + context: &Context, + request: &ExecutableDocument, + response: &graphql::Response, + ) -> Result<(), DemandControlError>; +} diff --git a/apollo-router/src/plugins/demand_control/strategy/static_estimated.rs b/apollo-router/src/plugins/demand_control/strategy/static_estimated.rs new file mode 100644 index 0000000000..c7aacd8b8d --- /dev/null +++ b/apollo-router/src/plugins/demand_control/strategy/static_estimated.rs @@ -0,0 +1,65 @@ +use apollo_compiler::ExecutableDocument; + +use crate::graphql; +use crate::plugins::demand_control::cost_calculator::static_cost::StaticCostCalculator; +use crate::plugins::demand_control::strategy::StrategyImpl; +use crate::plugins::demand_control::CostContext; +use crate::plugins::demand_control::DemandControlError; +use crate::services::execution; +use crate::services::subgraph; + +/// This strategy will reject requests if the estimated cost of the request exceeds the maximum cost. +pub(crate) struct StaticEstimated { + // The estimated value of the demand + pub(crate) max: f64, + pub(crate) cost_calculator: StaticCostCalculator, +} + +impl StrategyImpl for StaticEstimated { + fn on_execution_request(&self, request: &execution::Request) -> Result<(), DemandControlError> { + self.cost_calculator + .planned(&request.query_plan) + .and_then(|cost| { + let mut extensions = request.context.extensions().lock(); + let cost_result = extensions.get_or_default_mut::(); + cost_result.estimated = cost; + if cost > self.max { + Err( + cost_result.result(DemandControlError::EstimatedCostTooExpensive { + estimated_cost: cost, + max_cost: self.max, + }), + ) + } else { + Ok(()) + } + }) + } + + fn on_subgraph_request(&self, _request: &subgraph::Request) -> Result<(), DemandControlError> { + Ok(()) + } + + fn on_subgraph_response( + &self, + _request: &ExecutableDocument, + _response: &subgraph::Response, + ) -> Result<(), DemandControlError> { + Ok(()) + } + + fn on_execution_response( + &self, + context: &crate::Context, + request: &ExecutableDocument, + response: &graphql::Response, + ) -> Result<(), DemandControlError> { + if response.data.is_some() { + let cost = self.cost_calculator.actual(request, response)?; + let mut extensions = context.extensions().lock(); + let cost_result = extensions.get_or_default_mut::(); + cost_result.actual = cost; + } + Ok(()) + } +} diff --git a/apollo-router/src/plugins/demand_control/strategy/test.rs b/apollo-router/src/plugins/demand_control/strategy/test.rs new file mode 100644 index 0000000000..f60a5e1443 --- /dev/null +++ b/apollo-router/src/plugins/demand_control/strategy/test.rs @@ -0,0 +1,69 @@ +use apollo_compiler::ExecutableDocument; + +use crate::plugins::demand_control::strategy::StrategyImpl; +use crate::plugins::demand_control::test::TestError; +use crate::plugins::demand_control::test::TestStage; +use crate::plugins::demand_control::DemandControlError; +use crate::services::execution::Request; +use crate::services::subgraph::Response; + +/// Test strategy for demand control. +/// Can be configured to fail at different stages of the request processing. +pub(crate) struct Test { + pub(crate) stage: TestStage, + pub(crate) error: TestError, +} + +impl StrategyImpl for Test { + fn on_execution_request(&self, _request: &Request) -> Result<(), DemandControlError> { + match self { + Test { + stage: TestStage::ExecutionRequest, + error, + } => Err(error.into()), + _ => Ok(()), + } + } + + fn on_subgraph_request( + &self, + _request: &crate::services::subgraph::Request, + ) -> Result<(), DemandControlError> { + match self { + Test { + stage: TestStage::SubgraphRequest, + error, + } => Err(error.into()), + _ => Ok(()), + } + } + + fn on_subgraph_response( + &self, + _request: &ExecutableDocument, + _response: &Response, + ) -> Result<(), DemandControlError> { + match self { + Test { + stage: TestStage::SubgraphResponse, + error, + } => Err(error.into()), + _ => Ok(()), + } + } + + fn on_execution_response( + &self, + _context: &crate::Context, + _request: &ExecutableDocument, + _response: &crate::graphql::Response, + ) -> Result<(), DemandControlError> { + match self { + Test { + stage: TestStage::ExecutionResponse, + error, + } => Err(error.into()), + _ => Ok(()), + } + } +} diff --git a/apollo-router/src/plugins/headers.rs b/apollo-router/src/plugins/headers.rs index 73a15a0b13..55fa15772f 100644 --- a/apollo-router/src/plugins/headers.rs +++ b/apollo-router/src/plugins/headers.rs @@ -839,6 +839,7 @@ mod test { connection_closed_signal: None, query_hash: Default::default(), authorization: Default::default(), + executable_document: None, }; service.modify_request(&mut request); let headers = request @@ -910,6 +911,7 @@ mod test { connection_closed_signal: None, query_hash: Default::default(), authorization: Default::default(), + executable_document: None, }; service.modify_request(&mut request); let headers = request @@ -971,6 +973,7 @@ mod test { connection_closed_signal: None, query_hash: Default::default(), authorization: Default::default(), + executable_document: None, } } diff --git a/apollo-router/src/plugins/record_replay/record.rs b/apollo-router/src/plugins/record_replay/record.rs index 134a431524..59b36dd803 100644 --- a/apollo-router/src/plugins/record_replay/record.rs +++ b/apollo-router/src/plugins/record_replay/record.rs @@ -66,7 +66,10 @@ impl Plugin for Record { enabled: init.config.enabled, supergraph_sdl: init.supergraph_sdl.clone(), storage_path: storage_path.clone().into(), - schema: Arc::new(Schema::parse(init.supergraph_sdl.clone().as_str())?), + schema: Arc::new(Schema::parse( + init.supergraph_sdl.clone().as_str(), + &Default::default(), + )?), }; if init.config.enabled { diff --git a/apollo-router/src/plugins/subscription.rs b/apollo-router/src/plugins/subscription.rs index dc0077d742..2c011887df 100644 --- a/apollo-router/src/plugins/subscription.rs +++ b/apollo-router/src/plugins/subscription.rs @@ -32,6 +32,7 @@ use crate::graphql::Response; use crate::json_ext::Object; use crate::layers::ServiceBuilderExt; use crate::notification::Notify; +use crate::notification::NotifyError; use crate::plugin::Plugin; use crate::plugin::PluginInit; use crate::protocols::websocket::WebSocketProtocol; @@ -44,7 +45,6 @@ use crate::ListenAddr; type HmacSha256 = Hmac; pub(crate) const APOLLO_SUBSCRIPTION_PLUGIN: &str = "apollo.subscription"; -#[cfg(not(test))] pub(crate) const APOLLO_SUBSCRIPTION_PLUGIN_NAME: &str = "subscription"; pub(crate) static SUBSCRIPTION_CALLBACK_HMAC_KEY: OnceCell = OnceCell::new(); pub(crate) const SUBSCRIPTION_WS_CUSTOM_CONNECTION_PARAMS: &str = @@ -612,18 +612,53 @@ impl Service for CallbackService { .. }) => { if let Some(errors) = errors { - let mut handle = - notify.subscribe(id.clone()).await?.into_sink(); + let mut handle = match notify.subscribe(id.clone()).await { + Ok(handle) => handle.into_sink(), + Err(NotifyError::UnknownTopic) => { + return Ok(router::Response { + response: http::Response::builder() + .status(StatusCode::NOT_FOUND) + .body("unknown topic".into()) + .map_err(BoxError::from)?, + context: req.context, + }); + }, + Err(err) => { + return Ok(router::Response { + response: http::Response::builder() + .status(StatusCode::NOT_FOUND) + .body(err.to_string().into()) + .map_err(BoxError::from)?, + context: req.context, + }); + } + }; tracing::info!( monotonic_counter.apollo.router.operations.subscriptions.events = 1u64, subscriptions.mode="callback", subscriptions.complete=true ); - handle.send_sync( + if let Err(_err) = handle.send_sync( graphql::Response::builder().errors(errors).build(), - )?; + ) { + return Ok(router::Response { + response: http::Response::builder() + .status(StatusCode::NOT_FOUND) + .body("cannot send errors to the client".into()) + .map_err(BoxError::from)?, + context: req.context, + }); + } + } + if let Err(_err) = notify.force_delete(id).await { + return Ok(router::Response { + response: http::Response::builder() + .status(StatusCode::NOT_FOUND) + .body("cannot force delete".into()) + .map_err(BoxError::from)?, + context: req.context, + }); } - notify.force_delete(id).await?; Ok(router::Response { response: http::Response::builder() .status(StatusCode::ACCEPTED) diff --git a/apollo-router/src/plugins/telemetry/config.rs b/apollo-router/src/plugins/telemetry/config.rs index a3725a6d3f..3dd3c676c7 100644 --- a/apollo-router/src/plugins/telemetry/config.rs +++ b/apollo-router/src/plugins/telemetry/config.rs @@ -83,7 +83,6 @@ pub(crate) struct Exporters { #[derive(Clone, Default, Debug, Deserialize, JsonSchema)] #[serde(deny_unknown_fields, default)] pub(crate) struct Instrumentation { - #[serde(skip)] /// Event configuration pub(crate) events: config_new::events::Events, /// Span configuration diff --git a/apollo-router/src/plugins/telemetry/config_new/attributes.rs b/apollo-router/src/plugins/telemetry/config_new/attributes.rs index 81f99cc8cd..e4acaa6fb8 100644 --- a/apollo-router/src/plugins/telemetry/config_new/attributes.rs +++ b/apollo-router/src/plugins/telemetry/config_new/attributes.rs @@ -31,19 +31,18 @@ use opentelemetry_semantic_conventions::trace::URL_SCHEME; use opentelemetry_semantic_conventions::trace::USER_AGENT_ORIGINAL; use schemars::JsonSchema; use serde::Deserialize; -#[cfg(test)] -use serde::Serialize; use tower::BoxError; use tracing::Span; -use tracing_opentelemetry::OpenTelemetrySpanExt; use crate::axum_factory::utils::ConnectionInfo; use crate::context::OPERATION_KIND; use crate::context::OPERATION_NAME; +use crate::plugins::telemetry::config_new::cost::SupergraphCostAttributes; use crate::plugins::telemetry::config_new::trace_id; use crate::plugins::telemetry::config_new::DatadogId; use crate::plugins::telemetry::config_new::DefaultForLevel; use crate::plugins::telemetry::config_new::Selectors; +use crate::plugins::telemetry::otel::OpenTelemetrySpanExt; use crate::plugins::telemetry::otlp::TelemetryDataKind; use crate::services::router; use crate::services::router::Request; @@ -78,27 +77,28 @@ pub(crate) enum DefaultAttributeRequirementLevel { } #[derive(Deserialize, JsonSchema, Clone, Default, Debug)] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, default)] pub(crate) struct RouterAttributes { /// The datadog trace ID. /// This can be output in logs and used to correlate traces in Datadog. #[serde(rename = "dd.trace_id")] - datadog_trace_id: Option, + pub(crate) datadog_trace_id: Option, /// The OpenTelemetry trace ID. /// This can be output in logs. #[serde(rename = "trace_id")] - trace_id: Option, + pub(crate) trace_id: Option, /// All key values from trace baggage. - baggage: Option, + pub(crate) baggage: Option, /// Http attributes from Open Telemetry semantic conventions. #[serde(flatten)] - common: HttpCommonAttributes, + pub(crate) common: HttpCommonAttributes, /// Http server attributes from Open Telemetry semantic conventions. #[serde(flatten)] - server: HttpServerAttributes, + pub(crate) server: HttpServerAttributes, } impl DefaultForLevel for RouterAttributes { @@ -113,7 +113,7 @@ impl DefaultForLevel for RouterAttributes { } #[derive(Deserialize, JsonSchema, Clone, Default, Debug)] -#[cfg_attr(test, derive(Serialize))] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, default)] pub(crate) struct SupergraphAttributes { /// The GraphQL document being executed. @@ -121,13 +121,13 @@ pub(crate) struct SupergraphAttributes { /// * query findBookById { bookById(id: ?) { name } } /// Requirement level: Recommended #[serde(rename = "graphql.document")] - graphql_document: Option, + pub(crate) graphql_document: Option, /// The name of the operation being executed. /// Examples: /// * findBookById /// Requirement level: Recommended #[serde(rename = "graphql.operation.name")] - graphql_operation_name: Option, + pub(crate) graphql_operation_name: Option, /// The type of the operation being executed. /// Examples: /// * query @@ -135,7 +135,11 @@ pub(crate) struct SupergraphAttributes { /// * mutation /// Requirement level: Recommended #[serde(rename = "graphql.operation.type")] - graphql_operation_type: Option, + pub(crate) graphql_operation_type: Option, + + /// Cost attributes for the operation being executed + #[serde(flatten)] + pub(crate) cost: SupergraphCostAttributes, } impl DefaultForLevel for SupergraphAttributes { @@ -227,6 +231,7 @@ impl DefaultForLevel for SubgraphAttributes { /// Common attributes for http server and client. /// See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes #[derive(Deserialize, JsonSchema, Clone, Default, Debug)] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, default)] pub(crate) struct HttpCommonAttributes { /// Describes a class of error the operation ended with. @@ -236,14 +241,14 @@ pub(crate) struct HttpCommonAttributes { /// * 500 /// Requirement level: Conditionally Required: If request has ended with an error. #[serde(rename = "error.type")] - error_type: Option, + pub(crate) error_type: Option, /// The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. /// Examples: /// * 3495 /// Requirement level: Recommended #[serde(rename = "http.request.body.size")] - http_request_body_size: Option, + pub(crate) http_request_body_size: Option, /// HTTP request method. /// Examples: @@ -252,7 +257,7 @@ pub(crate) struct HttpCommonAttributes { /// * HEAD /// Requirement level: Required #[serde(rename = "http.request.method")] - http_request_method: Option, + pub(crate) http_request_method: Option, /// Original HTTP method sent by the client in the request line. /// Examples: @@ -261,21 +266,21 @@ pub(crate) struct HttpCommonAttributes { /// * foo /// Requirement level: Conditionally Required (If and only if itโ€™s different than http.request.method) #[serde(rename = "http.request.method.original", skip)] - http_request_method_original: Option, + pub(crate) http_request_method_original: Option, /// The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. /// Examples: /// * 3495 /// Requirement level: Recommended #[serde(rename = "http.response.body.size")] - http_response_body_size: Option, + pub(crate) http_response_body_size: Option, /// HTTP response status code. /// Examples: /// * 200 /// Requirement level: Conditionally Required: If and only if one was received/sent. #[serde(rename = "http.response.status_code")] - http_response_status_code: Option, + pub(crate) http_response_status_code: Option, /// OSI application layer or non-OSI equivalent. /// Examples: @@ -283,7 +288,7 @@ pub(crate) struct HttpCommonAttributes { /// * spdy /// Requirement level: Recommended: if not default (http). #[serde(rename = "network.protocol.name")] - network_protocol_name: Option, + pub(crate) network_protocol_name: Option, /// Version of the protocol specified in network.protocol.name. /// Examples: @@ -293,7 +298,7 @@ pub(crate) struct HttpCommonAttributes { /// * 3 /// Requirement level: Recommended #[serde(rename = "network.protocol.version")] - network_protocol_version: Option, + pub(crate) network_protocol_version: Option, /// OSI transport layer. /// Examples: @@ -301,7 +306,7 @@ pub(crate) struct HttpCommonAttributes { /// * udp /// Requirement level: Conditionally Required #[serde(rename = "network.transport")] - network_transport: Option, + pub(crate) network_transport: Option, /// OSI network layer or non-OSI equivalent. /// Examples: @@ -309,7 +314,7 @@ pub(crate) struct HttpCommonAttributes { /// * ipv6 /// Requirement level: Recommended #[serde(rename = "network.type")] - network_type: Option, + pub(crate) network_type: Option, } impl DefaultForLevel for HttpCommonAttributes { @@ -362,6 +367,7 @@ impl DefaultForLevel for HttpCommonAttributes { /// Attributes for Http servers /// See https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-server #[derive(Deserialize, JsonSchema, Clone, Default, Debug)] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, default)] pub(crate) struct HttpServerAttributes { /// Client address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. @@ -369,45 +375,45 @@ pub(crate) struct HttpServerAttributes { /// * 83.164.160.102 /// Requirement level: Recommended #[serde(rename = "client.address", skip)] - client_address: Option, + pub(crate) client_address: Option, /// The port of the original client behind all proxies, if known (e.g. from Forwarded or a similar header). Otherwise, the immediate client peer port. /// Examples: /// * 65123 /// Requirement level: Recommended #[serde(rename = "client.port", skip)] - client_port: Option, + pub(crate) client_port: Option, /// The matched route (path template in the format used by the respective server framework). /// Examples: /// * /graphql /// Requirement level: Conditionally Required: If and only if itโ€™s available #[serde(rename = "http.route")] - http_route: Option, + pub(crate) http_route: Option, /// Local socket address. Useful in case of a multi-IP host. /// Examples: /// * 10.1.2.80 /// * /tmp/my.sock /// Requirement level: Opt-In #[serde(rename = "network.local.address")] - network_local_address: Option, + pub(crate) network_local_address: Option, /// Local socket port. Useful in case of a multi-port host. /// Examples: /// * 65123 /// Requirement level: Opt-In #[serde(rename = "network.local.port")] - network_local_port: Option, + pub(crate) network_local_port: Option, /// Peer address of the network connection - IP address or Unix domain socket name. /// Examples: /// * 10.1.2.80 /// * /tmp/my.sock /// Requirement level: Recommended #[serde(rename = "network.peer.address")] - network_peer_address: Option, + pub(crate) network_peer_address: Option, /// Peer port number of the network connection. /// Examples: /// * 65123 /// Requirement level: Recommended #[serde(rename = "network.peer.port")] - network_peer_port: Option, + pub(crate) network_peer_port: Option, /// Name of the local HTTP server that received the request. /// Examples: /// * example.com @@ -415,7 +421,7 @@ pub(crate) struct HttpServerAttributes { /// * /tmp/my.sock /// Requirement level: Recommended #[serde(rename = "server.address")] - server_address: Option, + pub(crate) server_address: Option, /// Port of the local HTTP server that received the request. /// Examples: /// * 80 @@ -423,19 +429,19 @@ pub(crate) struct HttpServerAttributes { /// * 443 /// Requirement level: Recommended #[serde(rename = "server.port")] - server_port: Option, + pub(crate) server_port: Option, /// The URI path component /// Examples: /// * /search /// Requirement level: Required #[serde(rename = "url.path")] - url_path: Option, + pub(crate) url_path: Option, /// The URI query component /// Examples: /// * q=OpenTelemetry /// Requirement level: Conditionally Required: If and only if one was received/sent. #[serde(rename = "url.query")] - url_query: Option, + pub(crate) url_query: Option, /// The URI scheme component identifying the used protocol. /// Examples: @@ -443,7 +449,7 @@ pub(crate) struct HttpServerAttributes { /// * https /// Requirement level: Required #[serde(rename = "url.scheme")] - url_scheme: Option, + pub(crate) url_scheme: Option, /// Value of the HTTP User-Agent header sent by the client. /// Examples: @@ -451,7 +457,7 @@ pub(crate) struct HttpServerAttributes { /// * libwww/2.17b3 /// Requirement level: Recommended #[serde(rename = "user_agent.original")] - user_agent_original: Option, + pub(crate) user_agent_original: Option, } impl DefaultForLevel for HttpServerAttributes { @@ -887,8 +893,10 @@ impl Selectors for SupergraphAttributes { attrs } - fn on_response(&self, _response: &supergraph::Response) -> Vec { - Vec::default() + fn on_response(&self, response: &supergraph::Response) -> Vec { + let mut attrs = Vec::new(); + attrs.append(&mut self.cost.on_response(response)); + attrs } fn on_error(&self, _error: &BoxError) -> Vec { @@ -1009,13 +1017,14 @@ mod test { use crate::plugins::telemetry::config_new::attributes::SUBGRAPH_GRAPHQL_OPERATION_TYPE; use crate::plugins::telemetry::config_new::attributes::SUBGRAPH_NAME; use crate::plugins::telemetry::config_new::Selectors; + use crate::plugins::telemetry::otel; use crate::services::router; use crate::services::subgraph; use crate::services::supergraph; #[test] fn test_router_trace_attributes() { - let subscriber = tracing_subscriber::registry().with(tracing_opentelemetry::layer()); + let subscriber = tracing_subscriber::registry().with(otel::layer()); subscriber::with_default(subscriber, || { let span_context = SpanContext::new( TraceId::from_u128(42), diff --git a/apollo-router/src/plugins/telemetry/config_new/conditional.rs b/apollo-router/src/plugins/telemetry/config_new/conditional.rs new file mode 100644 index 0000000000..617692214b --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/conditional.rs @@ -0,0 +1,520 @@ +use std::any::type_name; +use std::fmt::Debug; +use std::mem; +use std::sync::Arc; + +use parking_lot::Mutex; +use schemars::gen::SchemaGenerator; +use schemars::schema::Schema; +use schemars::JsonSchema; +use serde::de::Error; +use serde::de::MapAccess; +use serde::de::Visitor; +use serde::Deserialize; +use serde::Deserializer; +use serde_json::Map; +use serde_json::Value; + +use crate::plugins::telemetry::config_new::attributes::DefaultAttributeRequirementLevel; +use crate::plugins::telemetry::config_new::conditions::Condition; +use crate::plugins::telemetry::config_new::DefaultForLevel; +use crate::plugins::telemetry::config_new::Selector; +use crate::plugins::telemetry::otlp::TelemetryDataKind; + +/// The state of the conditional. +#[derive(Debug, Default)] +#[cfg_attr(test, derive(PartialEq))] +pub(crate) enum State { + /// The conditional has not been evaluated yet or no value has been set via selector. + #[default] + Pending, + /// The conditional has been evaluated and the value has been obtained. + Value(T), + /// The conditional has been evaluated and the value has been returned, no further processing should take place. + Returned, +} + +impl From for State { + fn from(value: T) -> Self { + State::Value(value) + } +} + +/// Conditional is a stateful structure that may be called multiple times during the course of a request/response cycle. +/// As each callback is called the underlying condition is updated. If the condition can eventually be evaluated then it returns +/// Some(true|false) otherwise it returns None. +#[derive(Clone, Debug, Default)] +pub(crate) struct Conditional { + pub(crate) selector: Att, + pub(crate) condition: Option>>>, + pub(crate) value: Arc>>, +} + +#[cfg(test)] +impl PartialEq for Conditional +where + Att: PartialEq, +{ + fn eq(&self, other: &Self) -> bool { + let condition_eq = match (&self.condition, &other.condition) { + (Some(l), Some(r)) => *(l.lock()) == *(r.lock()), + (None, None) => true, + _ => false, + }; + let value_eq = *(self.value.lock()) == *(other.value.lock()); + self.selector == other.selector && value_eq && condition_eq + } +} + +impl JsonSchema for Conditional +where + T: JsonSchema, +{ + fn schema_name() -> String { + format!("conditional_attribute_{}", type_name::()) + } + + fn json_schema(gen: &mut SchemaGenerator) -> Schema { + // Add condition to each variant in the schema. + //Maybe we can rearrange this for a smaller schema + let mut selector = gen.subschema_for::(); + + if let Schema::Object(schema) = &mut selector { + if let Some(object) = &mut schema.subschemas { + if let Some(any_of) = &mut object.any_of { + for mut variant in any_of { + if let Schema::Object(variant) = &mut variant { + if let Some(object) = &mut variant.object { + object.properties.insert( + "condition".to_string(), + gen.subschema_for::>(), + ); + } + } + } + } + } + } + + selector + } +} + +impl DefaultForLevel for Conditional +where + Att: DefaultForLevel, +{ + fn defaults_for_level( + &mut self, + requirement_level: DefaultAttributeRequirementLevel, + kind: TelemetryDataKind, + ) { + self.selector.defaults_for_level(requirement_level, kind); + } +} + +impl Selector for Conditional +where + Att: Selector, +{ + type Request = Request; + type Response = Response; + + fn on_request(&self, request: &Self::Request) -> Option { + match &self.condition { + Some(condition) => { + let request_condition_res = condition.lock().evaluate_request(request); + match request_condition_res { + None => { + if let Some(value) = self.selector.on_request(request) { + *self.value.lock() = value.into(); + } + None + } + Some(true) => { + // The condition evaluated to true, so we can just return the value but may need to try again on the response. + match self.selector.on_request(request) { + None => None, + Some(value) => { + *self.value.lock() = State::Returned; + Some(value) + } + } + } + Some(false) => { + // The condition has been evaluated to false, so we can return None. it will never return true. + *self.value.lock() = State::Returned; + None + } + } + } + None => { + // There is no condition to evaluate, so we can just return the value. + match self.selector.on_request(request) { + None => None, + Some(value) => { + *self.value.lock() = State::Returned; + Some(value) + } + } + } + } + } + + fn on_response(&self, response: &Self::Response) -> Option { + // We may have got the value from the request. + let value = mem::take(&mut *self.value.lock()); + + match (value, &self.condition) { + (State::Value(value), Some(condition)) => { + // We have a value already, let's see if the condition was evaluated to true. + if condition.lock().evaluate_response(response) { + *self.value.lock() = State::Returned; + Some(value) + } else { + None + } + } + (State::Pending, Some(condition)) => { + // We don't have a value already, let's try to get it from the response if the condition was evaluated to true. + if condition.lock().evaluate_response(response) { + self.selector.on_response(response) + } else { + None + } + } + (State::Pending, None) => { + // We don't have a value already, and there is no condition. + self.selector.on_response(response) + } + _ => None, + } + } +} + +/// Custom Deserializer for attributes that will deserialize into a custom field if possible, but otherwise into one of the pre-defined attributes. +impl<'de, Att> Deserialize<'de> for Conditional +where + Att: Deserialize<'de> + Debug + Sized, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct ConditionalVisitor { + _phantom: std::marker::PhantomData, + } + impl<'de, Att> Visitor<'de> for ConditionalVisitor + where + Att: Deserialize<'de> + Debug, + { + type Value = Conditional; + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(formatter, "a map structure") + } + + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + let mut condition: Option> = None; + let mut attributes = Map::new(); + // Separate out the condition from the rest of the attributes. + while let Some(key) = map.next_key::()? { + let value: Value = map.next_value()?; + if key == "condition" { + condition = Some( + Condition::::deserialize(value.clone()) + .map_err(|e| Error::custom(e.to_string()))?, + ) + } else { + attributes.insert(key.clone(), value); + } + } + + // Try to parse the attribute + let selector = + Att::deserialize(Value::Object(attributes)).map_err(A::Error::custom)?; + + Ok(Conditional { + selector, + condition: condition.map(|c| Arc::new(Mutex::new(c))), + value: Arc::new(Default::default()), + }) + } + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(Conditional { + selector: Att::deserialize(Value::String(v.to_string())) + .map_err(|e| Error::custom(e.to_string()))?, + condition: None, + value: Arc::new(Default::default()), + }) + } + } + + deserializer.deserialize_any(ConditionalVisitor:: { + _phantom: Default::default(), + }) + } +} + +#[cfg(test)] +mod test { + use http::StatusCode; + use opentelemetry_api::Value; + + use crate::plugins::telemetry::config_new::conditional::Conditional; + use crate::plugins::telemetry::config_new::selectors::RouterSelector; + use crate::plugins::telemetry::config_new::Selector; + + fn on_response(conditional: Conditional) -> Option { + conditional.on_response( + &crate::services::router::Response::fake_builder() + .status_code(StatusCode::from_u16(201).unwrap()) + .build() + .expect("resp"), + ) + } + + fn on_request(conditional: &Conditional) -> Option { + conditional.on_request( + &crate::services::router::Request::fake_builder() + .header("head", "val") + .build() + .expect("req"), + ) + } + + #[test] + fn test_value_from_response_condition_from_request() { + let config = r#" + response_status: code + condition: + any: + - eq: + - request_header: head + - "val" + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert_eq!(result.expect("expected result"), Value::I64(201)); + } + + #[test] + fn test_value_from_request_condition_from_response() { + let config = r#" + request_header: head + condition: + any: + - eq: + - response_status: code + - 201 + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert_eq!( + result.expect("expected result"), + Value::String("val".into()) + ); + } + + #[test] + fn test_value_from_request_condition_from_request() { + let config = r#" + request_header: head + condition: + any: + - eq: + - request_header: head + - val + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert_eq!( + result.expect("expected result"), + Value::String("val".into()) + ); + + let result = on_response(conditional); + assert!(result.is_none()); + } + + #[test] + fn test_value_from_response_condition_from_response() { + let config = r#" + response_status: code + condition: + any: + - eq: + - response_status: code + - 201 + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert_eq!(result.expect("expected result"), Value::I64(201)); + } + + #[test] + fn test_response_condition_from_request_fail() { + let config = r#" + response_status: code + condition: + any: + - eq: + - request_header: head + - 999 + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert!(result.is_none()); + } + #[test] + fn test_response_condition_from_response_fail() { + let config = r#" + response_status: code + condition: + any: + - eq: + - response_status: code + - 999 + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert!(result.is_none()); + } + + #[test] + fn test_request_condition_from_request_fail() { + let config = r#" + request_header: head + condition: + any: + - eq: + - request_header: head + - 999 + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert!(result.is_none()); + } + #[test] + fn test_request_condition_from_response_fail() { + let config = r#" + request_header: head + condition: + any: + - eq: + - response_status: code + - 999 + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert!(result.is_none()); + } + + #[test] + fn test_deserialization() { + let config = r#" + request_header: head + default: hmm + condition: + any: + - eq: + - response_status: code + - 201 + "#; + + let conditional: super::Conditional = serde_yaml::from_str(config).unwrap(); + let result = on_request(&conditional); + assert!(result.is_none()); + let result = on_response(conditional); + assert_eq!( + result.expect("expected result"), + Value::String("val".into()) + ); + } + + #[test] + fn test_deserialization_missing_selector() { + let config = r#" + condition: + any: + - eq: + - response_status: code + - 201 + "#; + + serde_yaml::from_str::>(config) + .expect_err("Could have failed to deserialize"); + } + + #[test] + fn test_deserialization_invalid_selector() { + let config = r#" + invalid: "foo" + condition: + any: + - eq: + - response_status: code + - 201 + "#; + + let result = serde_yaml::from_str::>(config); + assert!(result + .expect_err("should have got error") + .to_string() + .contains("data did not match any variant of untagged enum RouterSelector"),) + } + + #[test] + fn test_deserialization_invalid_condition() { + let config = r#" + static: "foo" + condition: + aaargh: "" + "#; + + let result = serde_yaml::from_str::>(config); + assert!(result + .expect_err("should have got error") + .to_string() + .contains("unknown variant `aaargh`"),) + } + + #[test] + fn test_simple_value() { + let config = r#" + "foo" + "#; + + let result = serde_yaml::from_str::>(config) + .expect("should have parsed"); + assert!(result.condition.is_none()); + assert!(matches!(result.selector, RouterSelector::Static(_))); + } +} diff --git a/apollo-router/src/plugins/telemetry/config_new/conditions.rs b/apollo-router/src/plugins/telemetry/config_new/conditions.rs index 773b4a4d82..bfb16eecb8 100644 --- a/apollo-router/src/plugins/telemetry/config_new/conditions.rs +++ b/apollo-router/src/plugins/telemetry/config_new/conditions.rs @@ -5,8 +5,8 @@ use serde::Deserialize; use crate::plugins::telemetry::config::AttributeValue; use crate::plugins::telemetry::config_new::Selector; -#[allow(dead_code)] #[derive(Deserialize, JsonSchema, Clone, Debug)] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case")] pub(crate) enum Condition { /// A condition to check a selection against a value. @@ -37,8 +37,8 @@ impl Condition<()> { } } -#[allow(dead_code)] #[derive(Deserialize, JsonSchema, Clone, Debug)] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case", untagged)] pub(crate) enum SelectorOrValue { /// A constant value. @@ -47,7 +47,6 @@ pub(crate) enum SelectorOrValue { Selector(T), } -#[allow(dead_code)] impl Condition where T: Selector, diff --git a/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual.router.yaml b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual.router.yaml new file mode 100644 index 0000000000..3221c4a78c --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual.router.yaml @@ -0,0 +1,5 @@ +telemetry: + instrumentation: + instruments: + supergraph: + cost.actual: true \ No newline at end of file diff --git a/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual_with_attributes.router.yaml b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual_with_attributes.router.yaml new file mode 100644 index 0000000000..7e28acb084 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual_with_attributes.router.yaml @@ -0,0 +1,7 @@ +telemetry: + instrumentation: + instruments: + supergraph: + cost.actual: + attributes: + cost.result: true diff --git a/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta.router.yaml b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta.router.yaml new file mode 100644 index 0000000000..4e187a7ecc --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta.router.yaml @@ -0,0 +1,5 @@ +telemetry: + instrumentation: + instruments: + supergraph: + cost.delta: true \ No newline at end of file diff --git a/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta_with_attributes.router.yaml b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta_with_attributes.router.yaml new file mode 100644 index 0000000000..244bd2181d --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta_with_attributes.router.yaml @@ -0,0 +1,7 @@ +telemetry: + instrumentation: + instruments: + supergraph: + cost.delta: + attributes: + cost.result: true \ No newline at end of file diff --git a/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated.router.yaml b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated.router.yaml new file mode 100644 index 0000000000..da12f180ef --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated.router.yaml @@ -0,0 +1,5 @@ +telemetry: + instrumentation: + instruments: + supergraph: + cost.estimated: true \ No newline at end of file diff --git a/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated_with_attributes.router.yaml b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated_with_attributes.router.yaml new file mode 100644 index 0000000000..86a76b7f5c --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated_with_attributes.router.yaml @@ -0,0 +1,7 @@ +telemetry: + instrumentation: + instruments: + supergraph: + cost.estimated: + attributes: + cost.result: true \ No newline at end of file diff --git a/apollo-router/src/plugins/telemetry/config_new/cost/mod.rs b/apollo-router/src/plugins/telemetry/config_new/cost/mod.rs new file mode 100644 index 0000000000..57f96f6e17 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/cost/mod.rs @@ -0,0 +1,351 @@ +use std::sync::Arc; + +use opentelemetry::metrics::MeterProvider; +use opentelemetry_api::KeyValue; +use parking_lot::Mutex; +use schemars::JsonSchema; +use serde::Deserialize; +use tower::BoxError; + +use crate::metrics; +use crate::plugins::demand_control::CostContext; +use crate::plugins::telemetry::config_new::attributes::SupergraphAttributes; +use crate::plugins::telemetry::config_new::conditions::Condition; +use crate::plugins::telemetry::config_new::extendable::Extendable; +use crate::plugins::telemetry::config_new::instruments::CustomHistogram; +use crate::plugins::telemetry::config_new::instruments::CustomHistogramInner; +use crate::plugins::telemetry::config_new::instruments::DefaultedStandardInstrument; +use crate::plugins::telemetry::config_new::instruments::Increment::Unit; +use crate::plugins::telemetry::config_new::instruments::Instrumented; +use crate::plugins::telemetry::config_new::selectors::SupergraphSelector; +use crate::plugins::telemetry::config_new::Selectors; +use crate::services::supergraph; +use crate::services::supergraph::Request; +use crate::services::supergraph::Response; +use crate::Context; + +static COST_ESTIMATED: &str = "cost.estimated"; +static COST_ACTUAL: &str = "cost.actual"; +static COST_DELTA: &str = "cost.delta"; + +/// Attributes for Cost +#[derive(Deserialize, JsonSchema, Clone, Default, Debug, PartialEq)] +#[serde(deny_unknown_fields, default)] +pub(crate) struct SupergraphCostAttributes { + /// The estimated cost of the operation using the currently configured cost model + #[serde(rename = "cost.estimated")] + cost_estimated: Option, + /// The actual cost of the operation using the currently configured cost model + #[serde(rename = "cost.actual")] + cost_actual: Option, + /// The delta (estimated - actual) cost of the operation using the currently configured cost model + #[serde(rename = "cost.delta")] + cost_delta: Option, + /// The cost result, this is an error code returned by the cost calculation or COST_OK + #[serde(rename = "cost.result")] + cost_result: Option, +} + +impl Selectors for SupergraphCostAttributes { + type Request = supergraph::Request; + type Response = supergraph::Response; + + fn on_request(&self, _request: &Self::Request) -> Vec { + Vec::default() + } + + fn on_response(&self, response: &Self::Response) -> Vec { + let mut attrs = Vec::with_capacity(4); + if let Some(cost_result) = &response.context.extensions().lock().get::() { + if let Some(true) = self.cost_estimated { + attrs.push(KeyValue::new("cost.estimated", cost_result.estimated)); + } + if let Some(true) = self.cost_actual { + attrs.push(KeyValue::new("cost.actual", cost_result.actual)); + } + if let Some(true) = self.cost_delta { + attrs.push(KeyValue::new("cost.delta", cost_result.delta())); + } + if let Some(true) = self.cost_result { + attrs.push(KeyValue::new("cost.result", cost_result.result)); + } + } + attrs + } + + fn on_error(&self, _error: &BoxError) -> Vec { + Vec::default() + } +} + +#[derive(Deserialize, JsonSchema, Clone, Default, Debug)] +#[serde(deny_unknown_fields, default)] +pub(crate) struct CostInstrumentsConfig { + /// A histogram of the estimated cost of the operation using the currently configured cost model + #[serde(rename = "cost.estimated")] + pub(crate) cost_estimated: + DefaultedStandardInstrument>, + /// A histogram of the actual cost of the operation using the currently configured cost model + #[serde(rename = "cost.actual")] + pub(crate) cost_actual: + DefaultedStandardInstrument>, + /// A histogram of the delta between the estimated and actual cost of the operation using the currently configured cost model + #[serde(rename = "cost.delta")] + pub(crate) cost_delta: + DefaultedStandardInstrument>, +} + +impl CostInstrumentsConfig { + pub(crate) fn to_instruments(&self) -> CostInstruments { + let cost_estimated = self.cost_estimated.is_enabled().then(|| { + Self::histogram( + COST_ESTIMATED, + &self.cost_estimated, + SupergraphSelector::Cost { + cost: CostValue::Estimated, + }, + ) + }); + + let cost_actual = self.cost_actual.is_enabled().then(|| { + Self::histogram( + COST_ACTUAL, + &self.cost_actual, + SupergraphSelector::Cost { + cost: CostValue::Actual, + }, + ) + }); + + let cost_delta = self.cost_delta.is_enabled().then(|| { + Self::histogram( + COST_DELTA, + &self.cost_delta, + SupergraphSelector::Cost { + cost: CostValue::Delta, + }, + ) + }); + CostInstruments { + cost_estimated, + cost_actual, + cost_delta, + } + } + + fn histogram( + name: &'static str, + config: &DefaultedStandardInstrument>, + selector: SupergraphSelector, + ) -> CustomHistogram { + let meter = metrics::meter_provider() + .meter(crate::plugins::telemetry::config_new::instruments::METER_NAME); + let mut nb_attributes = 0; + let selectors = match config { + DefaultedStandardInstrument::Bool(_) | DefaultedStandardInstrument::Unset => None, + DefaultedStandardInstrument::Extendable { attributes } => { + nb_attributes = attributes.custom.len(); + Some(attributes.clone()) + } + }; + CustomHistogram { + inner: Mutex::new(CustomHistogramInner { + increment: Unit, + condition: Condition::True, + histogram: Some(meter.f64_histogram(name).init()), + attributes: Vec::with_capacity(nb_attributes), + selector: Some(Arc::new(selector)), + selectors, + }), + } + } +} + +/// Instruments for cost +#[derive(Default)] +pub(crate) struct CostInstruments { + /// A histogram of the estimated cost of the operation using the currently configured cost model + cost_estimated: Option< + CustomHistogram< + supergraph::Request, + supergraph::Response, + SupergraphAttributes, + SupergraphSelector, + >, + >, + + /// A histogram of the actual cost of the operation using the currently configured cost model + cost_actual: Option< + CustomHistogram< + supergraph::Request, + supergraph::Response, + SupergraphAttributes, + SupergraphSelector, + >, + >, + /// A histogram of the delta between the estimated and actual cost of the operation using the currently configured cost model + cost_delta: Option< + CustomHistogram< + supergraph::Request, + supergraph::Response, + SupergraphAttributes, + SupergraphSelector, + >, + >, +} + +impl Instrumented for CostInstruments { + type Request = supergraph::Request; + type Response = supergraph::Response; + + fn on_request(&self, request: &Self::Request) { + if let Some(cost_estimated) = &self.cost_estimated { + cost_estimated.on_request(request); + } + if let Some(cost_actual) = &self.cost_actual { + cost_actual.on_request(request); + } + if let Some(cost_delta) = &self.cost_delta { + cost_delta.on_request(request); + } + } + + fn on_response(&self, response: &Self::Response) { + if let Some(cost_estimated) = &self.cost_estimated { + cost_estimated.on_response(response); + } + if let Some(cost_actual) = &self.cost_actual { + cost_actual.on_response(response); + } + if let Some(cost_delta) = &self.cost_delta { + cost_delta.on_response(response); + } + } + + fn on_error(&self, error: &BoxError, ctx: &Context) { + if let Some(cost_estimated) = &self.cost_estimated { + cost_estimated.on_error(error, ctx); + } + if let Some(cost_actual) = &self.cost_actual { + cost_actual.on_error(error, ctx); + } + if let Some(cost_delta) = &self.cost_delta { + cost_delta.on_error(error, ctx); + } + } +} + +#[derive(Deserialize, JsonSchema, Clone, Debug, PartialEq)] +#[serde(deny_unknown_fields, rename_all = "snake_case")] +pub(crate) enum CostValue { + /// The estimated cost of the operation using the currently configured cost model + Estimated, + /// The actual cost of the operation using the currently configured cost model + Actual, + /// The delta between the estimated and actual cost of the operation using the currently configured cost model + Delta, + /// The result of the cost calculation. This is the error code returned by the cost calculation. + Result, +} + +#[cfg(test)] +mod test { + use crate::plugins::demand_control::CostContext; + use crate::plugins::telemetry::config_new::cost::CostInstruments; + use crate::plugins::telemetry::config_new::cost::CostInstrumentsConfig; + use crate::plugins::telemetry::config_new::instruments::Instrumented; + use crate::services::supergraph; + use crate::Context; + + #[test] + fn test_default_estimated() { + let config = config(include_str!("fixtures/cost_estimated.router.yaml")); + let instruments = config.to_instruments(); + make_request(instruments); + + assert_histogram_sum!("cost.estimated", 100.0); + } + + #[test] + fn test_default_actual() { + let config = config(include_str!("fixtures/cost_actual.router.yaml")); + let instruments = config.to_instruments(); + make_request(instruments); + + assert_histogram_sum!("cost.actual", 10.0); + } + + #[test] + fn test_default_delta() { + let config = config(include_str!("fixtures/cost_delta.router.yaml")); + let instruments = config.to_instruments(); + make_request(instruments); + + assert_histogram_sum!("cost.delta", 90.0); + } + + #[test] + fn test_default_estimated_with_attributes() { + let config = config(include_str!( + "fixtures/cost_estimated_with_attributes.router.yaml" + )); + let instruments = config.to_instruments(); + make_request(instruments); + + assert_histogram_sum!("cost.estimated", 100.0, cost.result = "COST_TOO_EXPENSIVE"); + } + + #[test] + fn test_default_actual_with_attributes() { + let config = config(include_str!( + "fixtures/cost_actual_with_attributes.router.yaml" + )); + let instruments = config.to_instruments(); + make_request(instruments); + + assert_histogram_sum!("cost.actual", 10.0, cost.result = "COST_TOO_EXPENSIVE"); + } + + #[test] + fn test_default_delta_with_attributes() { + let config = config(include_str!( + "fixtures/cost_delta_with_attributes.router.yaml" + )); + let instruments = config.to_instruments(); + make_request(instruments); + + assert_histogram_sum!("cost.delta", 90.0, cost.result = "COST_TOO_EXPENSIVE"); + } + + fn config(config: &'static str) -> CostInstrumentsConfig { + let config: serde_json::Value = serde_yaml::from_str(config).expect("config"); + let supergraph_instruments = jsonpath_lib::select(&config, "$..supergraph"); + + serde_json::from_value((*supergraph_instruments.unwrap().first().unwrap()).clone()) + .expect("config") + } + + fn make_request(instruments: CostInstruments) { + let context = Context::new(); + { + let mut extensions = context.extensions().lock(); + extensions.insert(CostContext::default()); + let cost_result = extensions.get_or_default_mut::(); + cost_result.estimated = 100.0; + cost_result.actual = 10.0; + cost_result.result = "COST_TOO_EXPENSIVE" + } + instruments.on_request( + &supergraph::Request::fake_builder() + .context(context.clone()) + .build() + .expect("request"), + ); + instruments.on_response( + &supergraph::Response::fake_builder() + .context(context) + .build() + .expect("response"), + ); + } +} diff --git a/apollo-router/src/plugins/telemetry/config_new/events.rs b/apollo-router/src/plugins/telemetry/config_new/events.rs index a7dfa619b6..b558ac73cb 100644 --- a/apollo-router/src/plugins/telemetry/config_new/events.rs +++ b/apollo-router/src/plugins/telemetry/config_new/events.rs @@ -1,8 +1,19 @@ +use std::collections::HashMap; use std::fmt::Debug; +use std::sync::Arc; +#[cfg(test)] +use http::HeaderValue; +use opentelemetry::Key; +use parking_lot::Mutex; use schemars::JsonSchema; use serde::Deserialize; +use tower::BoxError; +use tracing::Span; +use super::instruments::Instrumented; +use super::Selector; +use super::Selectors; use crate::plugins::telemetry::config_new::attributes::RouterAttributes; use crate::plugins::telemetry::config_new::attributes::SubgraphAttributes; use crate::plugins::telemetry::config_new::attributes::SupergraphAttributes; @@ -11,24 +22,348 @@ use crate::plugins::telemetry::config_new::extendable::Extendable; use crate::plugins::telemetry::config_new::selectors::RouterSelector; use crate::plugins::telemetry::config_new::selectors::SubgraphSelector; use crate::plugins::telemetry::config_new::selectors::SupergraphSelector; +use crate::plugins::telemetry::dynamic_attribute::EventDynAttribute; +use crate::services::router; +use crate::services::subgraph; +use crate::services::supergraph; +use crate::Context; /// Events are -#[allow(dead_code)] #[derive(Deserialize, JsonSchema, Clone, Default, Debug)] #[serde(deny_unknown_fields, default)] pub(crate) struct Events { /// Router service events - router: Extendable>, + router: Extendable>, /// Subgraph service events - supergraph: Extendable>, + supergraph: Extendable>, /// Supergraph service events - subgraph: Extendable>, + subgraph: Extendable>, +} + +impl Events { + pub(crate) fn new_router_events(&self) -> RouterEvents { + let custom_events = self + .router + .custom + .iter() + .map(|(event_name, event_cfg)| CustomEvent { + inner: Mutex::new(CustomEventInner { + name: event_name.clone(), + level: event_cfg.level, + event_on: event_cfg.on, + message: event_cfg.message.clone(), + selectors: event_cfg.attributes.clone().into(), + condition: event_cfg.condition.clone(), + attributes: Vec::new(), + }), + }) + .collect(); + + RouterEvents { + request: self.router.attributes.request, + response: self.router.attributes.response, + error: self.router.attributes.error, + custom: custom_events, + } + } + + pub(crate) fn new_supergraph_events(&self) -> SupergraphEvents { + let custom_events = self + .supergraph + .custom + .iter() + .map(|(event_name, event_cfg)| CustomEvent { + inner: Mutex::new(CustomEventInner { + name: event_name.clone(), + level: event_cfg.level, + event_on: event_cfg.on, + message: event_cfg.message.clone(), + selectors: event_cfg.attributes.clone().into(), + condition: event_cfg.condition.clone(), + attributes: Vec::new(), + }), + }) + .collect(); + + SupergraphEvents { + request: self.supergraph.attributes.request, + response: self.supergraph.attributes.response, + error: self.supergraph.attributes.error, + custom: custom_events, + } + } + + pub(crate) fn new_subgraph_events(&self) -> SubgraphEvents { + let custom_events = self + .subgraph + .custom + .iter() + .map(|(event_name, event_cfg)| CustomEvent { + inner: Mutex::new(CustomEventInner { + name: event_name.clone(), + level: event_cfg.level, + event_on: event_cfg.on, + message: event_cfg.message.clone(), + selectors: event_cfg.attributes.clone().into(), + condition: event_cfg.condition.clone(), + attributes: Vec::new(), + }), + }) + .collect(); + + SubgraphEvents { + request: self.subgraph.attributes.request, + response: self.subgraph.attributes.response, + error: self.subgraph.attributes.error, + custom: custom_events, + } + } +} + +pub(crate) type RouterEvents = + CustomEvents; + +pub(crate) type SupergraphEvents = CustomEvents< + supergraph::Request, + supergraph::Response, + SupergraphAttributes, + SupergraphSelector, +>; + +pub(crate) type SubgraphEvents = + CustomEvents; + +pub(crate) struct CustomEvents +where + Attributes: Selectors + Default, + Sel: Selector + Debug, +{ + request: EventLevel, + response: EventLevel, + error: EventLevel, + custom: Vec>, +} + +impl Instrumented + for CustomEvents +{ + type Request = router::Request; + type Response = router::Response; + + fn on_request(&self, request: &Self::Request) { + if self.request != EventLevel::Off { + let mut attrs = HashMap::with_capacity(5); + #[cfg(test)] + let mut headers: indexmap::IndexMap = request + .router_request + .headers() + .clone() + .into_iter() + .filter_map(|(name, val)| Some((name?.to_string(), val))) + .collect(); + #[cfg(test)] + headers.sort_keys(); + #[cfg(not(test))] + let headers = request.router_request.headers(); + + attrs.insert("http.request.headers".to_string(), format!("{:?}", headers)); + attrs.insert( + "http.request.method".to_string(), + format!("{}", request.router_request.method()), + ); + attrs.insert( + "http.request.uri".to_string(), + format!("{}", request.router_request.uri()), + ); + attrs.insert( + "http.request.version".to_string(), + format!("{:?}", request.router_request.version()), + ); + attrs.insert( + "http.request.body".to_string(), + format!("{:?}", request.router_request.body()), + ); + log_event(self.request, "router.request", attrs, ""); + } + for custom_event in &self.custom { + custom_event.on_request(request); + } + } + + fn on_response(&self, response: &Self::Response) { + if self.response != EventLevel::Off { + let mut attrs = HashMap::with_capacity(4); + + #[cfg(test)] + let mut headers: indexmap::IndexMap = response + .response + .headers() + .clone() + .into_iter() + .filter_map(|(name, val)| Some((name?.to_string(), val))) + .collect(); + #[cfg(test)] + headers.sort_keys(); + #[cfg(not(test))] + let headers = response.response.headers(); + attrs.insert( + "http.response.headers".to_string(), + format!("{:?}", headers), + ); + attrs.insert( + "http.response.status".to_string(), + format!("{}", response.response.status()), + ); + attrs.insert( + "http.response.version".to_string(), + format!("{:?}", response.response.version()), + ); + attrs.insert( + "http.response.body".to_string(), + format!("{:?}", response.response.body()), + ); + log_event(self.response, "router.response", attrs, ""); + } + for custom_event in &self.custom { + custom_event.on_response(response); + } + } + + fn on_error(&self, error: &BoxError, ctx: &Context) { + if self.error != EventLevel::Off { + let mut attrs = HashMap::with_capacity(1); + attrs.insert("error".to_string(), error.to_string()); + log_event(self.error, "router.error", attrs, ""); + } + for custom_event in &self.custom { + custom_event.on_error(error, ctx); + } + } +} + +impl Instrumented + for CustomEvents< + supergraph::Request, + supergraph::Response, + SupergraphAttributes, + SupergraphSelector, + > +{ + type Request = supergraph::Request; + type Response = supergraph::Response; + + fn on_request(&self, request: &Self::Request) { + if self.request != EventLevel::Off { + let mut attrs = HashMap::with_capacity(5); + #[cfg(test)] + let mut headers: indexmap::IndexMap = request + .supergraph_request + .headers() + .clone() + .into_iter() + .filter_map(|(name, val)| Some((name?.to_string(), val))) + .collect(); + #[cfg(test)] + headers.sort_keys(); + #[cfg(not(test))] + let headers = request.supergraph_request.headers(); + attrs.insert("http.request.headers".to_string(), format!("{:?}", headers)); + attrs.insert( + "http.request.method".to_string(), + format!("{}", request.supergraph_request.method()), + ); + attrs.insert( + "http.request.uri".to_string(), + format!("{}", request.supergraph_request.uri()), + ); + attrs.insert( + "http.request.version".to_string(), + format!("{:?}", request.supergraph_request.version()), + ); + attrs.insert( + "http.request.body".to_string(), + serde_json::to_string(request.supergraph_request.body()).unwrap_or_default(), + ); + log_event(self.request, "supergraph.request", attrs, ""); + } + if self.response != EventLevel::Off { + request + .context + .extensions() + .lock() + .insert(SupergraphEventResponseLevel(self.response)); + } + for custom_event in &self.custom { + custom_event.on_request(request); + } + } + + fn on_response(&self, response: &Self::Response) { + for custom_event in &self.custom { + custom_event.on_response(response); + } + } + + fn on_error(&self, error: &BoxError, ctx: &Context) { + if self.error != EventLevel::Off { + let mut attrs = HashMap::with_capacity(1); + attrs.insert("error".to_string(), error.to_string()); + log_event(self.error, "supergraph.error", attrs, ""); + } + for custom_event in &self.custom { + custom_event.on_error(error, ctx); + } + } +} + +impl Instrumented + for CustomEvents +{ + type Request = subgraph::Request; + type Response = subgraph::Response; + + fn on_request(&self, request: &Self::Request) { + if self.request != EventLevel::Off { + request + .context + .extensions() + .lock() + .insert(SubgraphEventRequestLevel(self.request)); + } + if self.response != EventLevel::Off { + request + .context + .extensions() + .lock() + .insert(SubgraphEventResponseLevel(self.response)); + } + for custom_event in &self.custom { + custom_event.on_request(request); + } + } + + fn on_response(&self, response: &Self::Response) { + for custom_event in &self.custom { + custom_event.on_response(response); + } + } + + fn on_error(&self, error: &BoxError, ctx: &Context) { + if self.error != EventLevel::Off { + let mut attrs = HashMap::with_capacity(1); + + attrs.insert("error".to_string(), error.to_string()); + log_event(self.error, "subgraph.error", attrs, ""); + } + for custom_event in &self.custom { + custom_event.on_error(error, ctx); + } + } } -#[allow(dead_code)] #[derive(Clone, Deserialize, JsonSchema, Debug, Default)] #[serde(deny_unknown_fields, default)] -struct RouterEvents { +struct RouterEventsConfig { /// Log the router request request: EventLevel, /// Log the router response @@ -37,10 +372,16 @@ struct RouterEvents { error: EventLevel, } -#[allow(dead_code)] +#[derive(Clone)] +pub(crate) struct SupergraphEventResponseLevel(pub(crate) EventLevel); +#[derive(Clone)] +pub(crate) struct SubgraphEventResponseLevel(pub(crate) EventLevel); +#[derive(Clone)] +pub(crate) struct SubgraphEventRequestLevel(pub(crate) EventLevel); + #[derive(Clone, Deserialize, JsonSchema, Debug, Default)] #[serde(deny_unknown_fields, default)] -struct SupergraphEvents { +struct SupergraphEventsConfig { /// Log the supergraph request request: EventLevel, /// Log the supergraph response @@ -49,10 +390,9 @@ struct SupergraphEvents { error: EventLevel, } -#[allow(dead_code)] #[derive(Clone, Deserialize, JsonSchema, Debug, Default)] #[serde(deny_unknown_fields, default)] -struct SubgraphEvents { +struct SubgraphEventsConfig { /// Log the subgraph request request: EventLevel, /// Log the subgraph response @@ -61,8 +401,7 @@ struct SubgraphEvents { error: EventLevel, } -#[allow(dead_code)] -#[derive(Deserialize, JsonSchema, Clone, Debug, Default)] +#[derive(Deserialize, JsonSchema, Clone, Debug, Default, PartialEq, Copy)] #[serde(rename_all = "snake_case")] pub(crate) enum EventLevel { Info, @@ -75,7 +414,6 @@ pub(crate) enum EventLevel { /// An event that can be logged as part of a trace. /// The event has an implicit `type` attribute that matches the name of the event in the yaml /// and a message that can be used to provide additional information. -#[allow(dead_code)] #[derive(Deserialize, JsonSchema, Clone, Debug)] pub(crate) struct Event where @@ -86,14 +424,14 @@ where level: EventLevel, /// The event message. - message: String, + message: Arc, /// When to trigger the event. on: EventOn, /// The event attributes. - #[serde(default = "Extendable::empty::")] - attributes: Extendable, + #[serde(default = "Extendable::empty_arc::")] + attributes: Arc>, /// The event conditions. #[serde(default = "Condition::empty::")] @@ -101,8 +439,7 @@ where } /// When to trigger the event. -#[allow(dead_code)] -#[derive(Deserialize, JsonSchema, Clone, Debug)] +#[derive(Deserialize, JsonSchema, Clone, Debug, Copy, PartialEq)] #[serde(rename_all = "snake_case")] pub(crate) enum EventOn { /// Log the event on request @@ -112,3 +449,266 @@ pub(crate) enum EventOn { /// Log the event on error Error, } + +pub(crate) struct CustomEvent +where + A: Selectors + Default, + T: Selector + Debug, +{ + inner: Mutex>, +} + +struct CustomEventInner +where + A: Selectors + Default, + T: Selector + Debug, +{ + name: String, + level: EventLevel, + event_on: EventOn, + message: Arc, + selectors: Option>>, + condition: Condition, + attributes: Vec, +} + +impl Instrumented for CustomEvent +where + A: Selectors + Default, + T: Selector + Debug + Debug, +{ + type Request = Request; + type Response = Response; + + fn on_request(&self, request: &Self::Request) { + let mut inner = self.inner.lock(); + if inner.condition.evaluate_request(request) != Some(true) + && inner.event_on == EventOn::Request + { + return; + } + if let Some(selectors) = &inner.selectors { + inner.attributes = selectors.on_request(request); + } + + if inner.event_on == EventOn::Request + && inner.condition.evaluate_request(request) != Some(false) + { + inner.send_event(); + } + } + + fn on_response(&self, response: &Self::Response) { + let mut inner = self.inner.lock(); + if inner.event_on != EventOn::Response { + return; + } + + if !inner.condition.evaluate_response(response) { + return; + } + if let Some(selectors) = &inner.selectors { + let mut new_attributes = selectors.on_response(response); + inner.attributes.append(&mut new_attributes); + } + + inner.send_event(); + } + + fn on_error(&self, error: &BoxError, _ctx: &Context) { + let mut inner = self.inner.lock(); + if inner.event_on != EventOn::Error { + return; + } + if let Some(selectors) = &inner.selectors { + let mut new_attributes = selectors.on_error(error); + inner.attributes.append(&mut new_attributes); + } + + inner.send_event(); + } +} + +impl CustomEventInner +where + A: Selectors + Default, + T: Selector + Debug + Debug, +{ + #[inline] + fn send_event(&self) { + let attributes: HashMap = self + .attributes + .iter() + .map(|kv| (kv.key.to_string(), kv.value.to_string())) + .collect(); + + log_event(self.level, &self.name, attributes, &self.message); + } +} + +#[inline] +pub(crate) fn log_event( + level: EventLevel, + kind: &str, + attributes: HashMap, + message: &str, +) { + #[cfg(test)] + let mut attributes: indexmap::IndexMap = + attributes.clone().into_iter().collect(); + #[cfg(test)] + attributes.sort_keys(); + let span = Span::current(); + span.set_event_dyn_attributes( + attributes + .into_iter() + .map(|(key, value)| Key::from(key).string(value)), + ); + + match level { + EventLevel::Info => { + ::tracing::info!(%kind, "{}", message); + } + EventLevel::Warn => { + ::tracing::warn!(%kind, "{}", message) + } + EventLevel::Error => { + ::tracing::error!(%kind, "{}", message) + } + EventLevel::Off => {} + } +} + +#[cfg(test)] +mod tests { + use http::header::CONTENT_LENGTH; + use http::HeaderValue; + use tracing::instrument::WithSubscriber; + + use super::*; + use crate::assert_snapshot_subscriber; + use crate::graphql; + use crate::plugins::telemetry::Telemetry; + use crate::plugins::test::PluginTestHarness; + + #[tokio::test(flavor = "multi_thread")] + async fn test_router_events() { + let test_harness: PluginTestHarness = PluginTestHarness::builder() + .config(include_str!("../testdata/custom_events.router.yaml")) + .build() + .await; + + async { + test_harness + .call_router( + router::Request::fake_builder() + .header(CONTENT_LENGTH, "0") + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .build() + .unwrap(), + |_r| { + router::Response::fake_builder() + .header("custom-header", "val1") + .header(CONTENT_LENGTH, "25") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json_bytes::json!({"data": "res"})) + .build() + .expect("expecting valid response") + }, + ) + .await + .expect("expecting successful response"); + // Without the header to enable custom event + test_harness + .call_router( + router::Request::fake_builder() + .header("custom-header", "val1") + .build() + .unwrap(), + |_r| { + router::Response::fake_builder() + .header("custom-header", "val1") + .data(serde_json_bytes::json!({"data": "res"})) + .build() + .expect("expecting valid response") + }, + ) + .await + .expect("expecting successful response"); + } + .with_subscriber( + assert_snapshot_subscriber!({r#"[].span["apollo_private.duration_ns"]"# => "[duration]", r#"[].spans[]["apollo_private.duration_ns"]"# => "[duration]", "[].fields.attributes" => insta::sorted_redaction()}), + ) + .await + } + + #[tokio::test(flavor = "multi_thread")] + async fn test_supergraph_events() { + let test_harness: PluginTestHarness = PluginTestHarness::builder() + .config(include_str!("../testdata/custom_events.router.yaml")) + .build() + .await; + + async { + test_harness + .call_supergraph( + supergraph::Request::fake_builder() + .query("query { foo }") + .header("x-log-request", HeaderValue::from_static("log")) + .build() + .unwrap(), + |_r| { + supergraph::Response::fake_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"data": "res"}).to_string()) + .build() + .expect("expecting valid response") + }, + ) + .await + .expect("expecting successful response"); + } + .with_subscriber(assert_snapshot_subscriber!()) + .await + } + + #[tokio::test(flavor = "multi_thread")] + async fn test_subgraph_events() { + let test_harness: PluginTestHarness = PluginTestHarness::builder() + .config(include_str!("../testdata/custom_events.router.yaml")) + .build() + .await; + + async { + let mut subgraph_req = http::Request::new( + graphql::Request::fake_builder() + .query("query { foo }") + .build(), + ); + subgraph_req + .headers_mut() + .insert("x-log-request", HeaderValue::from_static("log")); + test_harness + .call_subgraph( + subgraph::Request::fake_builder() + .subgraph_name("subgraph") + .subgraph_request(subgraph_req) + .build(), + |_r| { + subgraph::Response::fake2_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"data": "res"}).to_string()) + .build() + .expect("expecting valid response") + }, + ) + .await + .expect("expecting successful response"); + } + .with_subscriber(assert_snapshot_subscriber!()) + .await + } +} diff --git a/apollo-router/src/plugins/telemetry/config_new/extendable.rs b/apollo-router/src/plugins/telemetry/config_new/extendable.rs index ae08b71539..ac00b72566 100644 --- a/apollo-router/src/plugins/telemetry/config_new/extendable.rs +++ b/apollo-router/src/plugins/telemetry/config_new/extendable.rs @@ -12,8 +12,6 @@ use serde::de::MapAccess; use serde::de::Visitor; use serde::Deserialize; use serde::Deserializer; -#[cfg(test)] -use serde::Serialize; use serde_json::Map; use serde_json::Value; use tower::BoxError; @@ -26,7 +24,6 @@ use crate::plugins::telemetry::otlp::TelemetryDataKind; /// This struct can be used as an attributes container, it has a custom JsonSchema implementation that will merge the schemas of the attributes and custom fields. #[derive(Clone, Debug)] -#[cfg_attr(test, derive(Serialize))] pub(crate) struct Extendable where Att: Default, @@ -49,12 +46,6 @@ where } impl Extendable<(), ()> { - pub(crate) fn empty() -> Extendable - where - A: Default, - { - Default::default() - } pub(crate) fn empty_arc() -> Arc> where A: Default, @@ -63,7 +54,7 @@ impl Extendable<(), ()> { } } -/// Custom Deserializer for attributes that will deserializse into a custom field if possible, but otherwise into one of the pre-defined attributes. +/// Custom Deserializer for attributes that will deserialize into a custom field if possible, but otherwise into one of the pre-defined attributes. impl<'de, Att, Ext> Deserialize<'de> for Extendable where Att: Default + Deserialize<'de> + Debug + Sized, @@ -90,7 +81,7 @@ where where A: MapAccess<'de>, { - let mut attributes: Map = Map::new(); + let mut attributes = Map::new(); let mut custom: HashMap = HashMap::new(); while let Some(key) = map.next_key()? { let value: Value = map.next_value()?; @@ -100,6 +91,15 @@ where } Err(_err) => { // We didn't manage to deserialize as a custom attribute, so stash the value and we'll try again later + // but let's try and deserialize it now so that we get a decent error message rather than 'unknown field' + let mut temp_attributes: Map = Map::new(); + temp_attributes.insert(key.clone(), value.clone()); + Att::deserialize(Value::Object(temp_attributes)).map_err(|e| { + A::Error::custom(format!( + "failed to parse attribute '{}': {}", + key, e + )) + })?; attributes.insert(key, value); } } @@ -196,32 +196,64 @@ where #[cfg(test)] mod test { - use insta::assert_yaml_snapshot; + use std::sync::Arc; + + use parking_lot::Mutex; + use crate::plugins::telemetry::config::AttributeValue; + use crate::plugins::telemetry::config_new::attributes::HttpCommonAttributes; + use crate::plugins::telemetry::config_new::attributes::HttpServerAttributes; + use crate::plugins::telemetry::config_new::attributes::RouterAttributes; use crate::plugins::telemetry::config_new::attributes::SupergraphAttributes; + use crate::plugins::telemetry::config_new::conditional::Conditional; + use crate::plugins::telemetry::config_new::conditions::Condition; + use crate::plugins::telemetry::config_new::conditions::SelectorOrValue; use crate::plugins::telemetry::config_new::extendable::Extendable; + use crate::plugins::telemetry::config_new::selectors::OperationName; + use crate::plugins::telemetry::config_new::selectors::ResponseStatus; + use crate::plugins::telemetry::config_new::selectors::RouterSelector; use crate::plugins::telemetry::config_new::selectors::SupergraphSelector; #[test] fn test_extendable_serde() { - let mut settings = insta::Settings::clone_current(); - settings.set_sort_maps(true); - settings.bind(|| { - let o = serde_json::from_value::>( - serde_json::json!({ - "graphql.operation.name": true, - "graphql.operation.type": true, - "custom_1": { - "operation_name": "string" - }, - "custom_2": { - "operation_name": "string" - } - }), - ) - .unwrap(); - assert_yaml_snapshot!(o); - }); + let extendable_conf = serde_json::from_value::< + Extendable, + >(serde_json::json!({ + "graphql.operation.name": true, + "graphql.operation.type": true, + "custom_1": { + "operation_name": "string" + }, + "custom_2": { + "operation_name": "string" + } + })) + .unwrap(); + assert_eq!( + extendable_conf.attributes, + SupergraphAttributes { + graphql_document: None, + graphql_operation_name: Some(true), + graphql_operation_type: Some(true), + cost: Default::default() + } + ); + assert_eq!( + extendable_conf.custom.get("custom_1"), + Some(&SupergraphSelector::OperationName { + operation_name: OperationName::String, + redact: None, + default: None + }) + ); + assert_eq!( + extendable_conf.custom.get("custom_2"), + Some(&SupergraphSelector::OperationName { + operation_name: OperationName::String, + redact: None, + default: None + }) + ); } #[test] @@ -240,4 +272,81 @@ mod test { ) .expect_err("Should have errored"); } + + #[test] + fn test_extendable_serde_conditional() { + let extendable_conf = serde_json::from_value::< + Extendable>, + >(serde_json::json!({ + "http.request.method": true, + "http.response.status_code": true, + "url.path": true, + "http.request.header.x-my-header": { + "request_header": "x-my-header", + "condition": { + "eq": [ + 200, + { + "response_status": "code" + } + ] + } + }, + "http.request.header.x-not-present": { + "request_header": "x-not-present", + "default": "nope" + } + })) + .unwrap(); + assert_eq!( + extendable_conf.attributes, + RouterAttributes { + datadog_trace_id: None, + trace_id: None, + baggage: None, + common: HttpCommonAttributes { + http_request_method: Some(true), + http_response_status_code: Some(true), + ..Default::default() + }, + server: HttpServerAttributes { + url_path: Some(true), + ..Default::default() + } + } + ); + assert_eq!( + extendable_conf + .custom + .get("http.request.header.x-my-header"), + Some(&Conditional { + selector: RouterSelector::RequestHeader { + request_header: String::from("x-my-header"), + redact: None, + default: None + }, + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(200.into()), + SelectorOrValue::Selector(RouterSelector::ResponseStatus { + response_status: ResponseStatus::Code + }) + ])))), + value: Default::default(), + }) + ); + assert_eq!( + extendable_conf + .custom + .get("http.request.header.x-not-present"), + Some(&Conditional { + selector: RouterSelector::RequestHeader { + request_header: String::from("x-not-present"), + redact: None, + default: Some(AttributeValue::String("nope".to_string())) + }, + condition: None, + value: Default::default(), + }) + ); + } } diff --git a/apollo-router/src/plugins/telemetry/config_new/fixtures/conditional-config.router.yaml b/apollo-router/src/plugins/telemetry/config_new/fixtures/conditional-config.router.yaml new file mode 100644 index 0000000000..7fdf1b9470 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/fixtures/conditional-config.router.yaml @@ -0,0 +1,15 @@ +# This config has a conditional in that will be validated by the project config files. +# The json schema for conditionals should validate this as OK. +telemetry: + instrumentation: + spans: + mode: deprecated + router: + attributes: + "http.request.header.x-my-header-condition": + request_header: "x-my-header" + condition: + eq: + - response_header: "head" + - "test" + diff --git a/apollo-router/src/plugins/telemetry/config_new/instruments.rs b/apollo-router/src/plugins/telemetry/config_new/instruments.rs index 27980ec001..543dde664c 100644 --- a/apollo-router/src/plugins/telemetry/config_new/instruments.rs +++ b/apollo-router/src/plugins/telemetry/config_new/instruments.rs @@ -26,6 +26,8 @@ use crate::plugins::telemetry::config_new::attributes::RouterAttributes; use crate::plugins::telemetry::config_new::attributes::SubgraphAttributes; use crate::plugins::telemetry::config_new::attributes::SupergraphAttributes; use crate::plugins::telemetry::config_new::conditions::Condition; +use crate::plugins::telemetry::config_new::cost::CostInstruments; +use crate::plugins::telemetry::config_new::cost::CostInstrumentsConfig; use crate::plugins::telemetry::config_new::extendable::Extendable; use crate::plugins::telemetry::config_new::selectors::RouterSelector; use crate::plugins::telemetry::config_new::selectors::SubgraphSelector; @@ -37,7 +39,7 @@ use crate::services::subgraph; use crate::services::supergraph; use crate::Context; -const METER_NAME: &str = "apollo/router"; +pub(crate) const METER_NAME: &str = "apollo/router"; #[allow(dead_code)] #[derive(Clone, Deserialize, JsonSchema, Debug, Default)] @@ -50,8 +52,10 @@ pub(crate) struct InstrumentsConfig { pub(crate) router: Extendable>, /// Supergraph service instruments. For more information see documentation on Router lifecycle. - pub(crate) supergraph: - Extendable>, + pub(crate) supergraph: Extendable< + SupergraphInstrumentsConfig, + Instrument, + >, /// Subgraph service instruments. For more information see documentation on Router lifecycle. pub(crate) subgraph: Extendable>, @@ -188,6 +192,13 @@ impl InstrumentsConfig { } } + pub(crate) fn new_supergraph_instruments(&self) -> SupergraphInstruments { + SupergraphInstruments { + cost: self.supergraph.attributes.cost.to_instruments(), + custom: CustomInstruments::new(&self.supergraph.custom), + } + } + pub(crate) fn new_subgraph_instruments(&self) -> SubgraphInstruments { let meter = metrics::meter_provider().meter(METER_NAME); let http_client_request_duration = self @@ -362,7 +373,7 @@ impl DefaultForLevel for ActiveRequestsAttributes { #[derive(Clone, Deserialize, JsonSchema, Debug, Default)] #[serde(deny_unknown_fields, untagged)] -enum DefaultedStandardInstrument { +pub(crate) enum DefaultedStandardInstrument { #[default] Unset, Bool(bool), @@ -372,7 +383,7 @@ enum DefaultedStandardInstrument { } impl DefaultedStandardInstrument { - fn is_enabled(&self) -> bool { + pub(crate) fn is_enabled(&self) -> bool { match self { Self::Unset => false, Self::Bool(enabled) => *enabled, @@ -453,9 +464,12 @@ where #[allow(dead_code)] #[derive(Clone, Deserialize, JsonSchema, Debug, Default)] #[serde(deny_unknown_fields, default)] -pub(crate) struct SupergraphInstruments {} +pub(crate) struct SupergraphInstrumentsConfig { + #[serde(flatten)] + pub(crate) cost: CostInstrumentsConfig, +} -impl DefaultForLevel for SupergraphInstruments { +impl DefaultForLevel for SupergraphInstrumentsConfig { fn defaults_for_level( &mut self, _requirement_level: DefaultAttributeRequirementLevel, @@ -830,6 +844,31 @@ impl Instrumented for RouterInstruments { } } +pub(crate) struct SupergraphInstruments { + cost: CostInstruments, + custom: SupergraphCustomInstruments, +} + +impl Instrumented for SupergraphInstruments { + type Request = supergraph::Request; + type Response = supergraph::Response; + + fn on_request(&self, request: &Self::Request) { + self.cost.on_request(request); + self.custom.on_request(request); + } + + fn on_response(&self, response: &Self::Response) { + self.cost.on_response(response); + self.custom.on_response(response); + } + + fn on_error(&self, error: &BoxError, ctx: &Context) { + self.cost.on_error(error, ctx); + self.custom.on_error(error, ctx); + } +} + pub(crate) struct SubgraphInstruments { http_client_request_duration: Option< CustomHistogram< @@ -917,7 +956,7 @@ pub(crate) type SubgraphCustomInstruments = CustomInstruments; // ---------------- Counter ----------------------- -enum Increment { +pub(crate) enum Increment { Unit, Duration(Instant), Custom(Option), @@ -1122,25 +1161,25 @@ impl Drop for ActiveRequestsCounter { // ---------------- Histogram ----------------------- -struct CustomHistogram +pub(crate) struct CustomHistogram where A: Selectors + Default, T: Selector, { - inner: Mutex>, + pub(crate) inner: Mutex>, } -struct CustomHistogramInner +pub(crate) struct CustomHistogramInner where A: Selectors + Default, T: Selector, { - increment: Increment, - condition: Condition, - selector: Option>, - selectors: Option>>, - histogram: Option>, - attributes: Vec, + pub(crate) increment: Increment, + pub(crate) condition: Condition, + pub(crate) selector: Option>, + pub(crate) selectors: Option>>, + pub(crate) histogram: Option>, + pub(crate) attributes: Vec, } impl Instrumented for CustomHistogram diff --git a/apollo-router/src/plugins/telemetry/config_new/mod.rs b/apollo-router/src/plugins/telemetry/config_new/mod.rs index 67d758456d..b2979d9d45 100644 --- a/apollo-router/src/plugins/telemetry/config_new/mod.rs +++ b/apollo-router/src/plugins/telemetry/config_new/mod.rs @@ -5,8 +5,8 @@ use opentelemetry::KeyValue; use paste::paste; use tower::BoxError; use tracing::Span; -use tracing_opentelemetry::OpenTelemetrySpanExt; +use super::otel::OpenTelemetrySpanExt; use super::otlp::TelemetryDataKind; use crate::plugins::telemetry::config::AttributeValue; use crate::plugins::telemetry::config_new::attributes::DefaultAttributeRequirementLevel; @@ -15,6 +15,8 @@ use crate::plugins::telemetry::config_new::attributes::DefaultAttributeRequireme pub(crate) mod attributes; pub(crate) mod conditions; +mod conditional; +mod cost; pub(crate) mod events; mod experimental_when_header; pub(crate) mod extendable; @@ -128,6 +130,10 @@ macro_rules! impl_to_otel_value { Some(opentelemetry::Value::Array(opentelemetry::Array::Bool( value.iter().filter_map(|v| v.as_bool()).collect(), ))) + } else if value.iter().all(|v| v.is_object()) { + Some(opentelemetry::Value::Array(opentelemetry::Array::String( + value.iter().map(|v| v.to_string().into()).collect(), + ))) } else if value.iter().all(|v| v.is_string()) { Some(opentelemetry::Value::Array(opentelemetry::Array::String( value @@ -137,10 +143,11 @@ macro_rules! impl_to_otel_value { .collect(), ))) } else { - None + Some(serde_json::to_string(value).ok()?.into()) } } - _ => None, + $type::Object(value) => Some(serde_json::to_string(value).ok()?.into()), + _ => None } } } @@ -179,6 +186,7 @@ mod test { use crate::plugins::telemetry::config_new::trace_id; use crate::plugins::telemetry::config_new::DatadogId; use crate::plugins::telemetry::config_new::ToOtelValue; + use crate::plugins::telemetry::otel; #[test] fn dd_convert() { @@ -190,7 +198,7 @@ mod test { #[test] fn test_trace_id() { // Create a span with a trace ID - let subscriber = tracing_subscriber::registry().with(tracing_opentelemetry::layer()); + let subscriber = tracing_subscriber::registry().with(otel::layer()); tracing::subscriber::with_default(subscriber, || { let span_context = SpanContext::new( TraceId::from_u128(42), @@ -212,7 +220,7 @@ mod test { #[test] fn test_baggage() { // Create a span with a trace ID - let subscriber = tracing_subscriber::registry().with(tracing_opentelemetry::layer()); + let subscriber = tracing_subscriber::registry().with(otel::layer()); tracing::subscriber::with_default(subscriber, || { let span_context = SpanContext::new( TraceId::from_u128(42), @@ -262,7 +270,13 @@ mod test { ); // Arrays must be uniform - assert!(json!(["1", 1]).maybe_to_otel_value().is_none()); - assert!(json!([1.0, 1]).maybe_to_otel_value().is_none()); + assert_eq!( + json!(["1", 1]).maybe_to_otel_value(), + Some(r#"["1",1]"#.to_string().into()) + ); + assert_eq!( + json!([1.0, 1]).maybe_to_otel_value(), + Some(r#"[1.0,1]"#.to_string().into()) + ); } } diff --git a/apollo-router/src/plugins/telemetry/config_new/selectors.rs b/apollo-router/src/plugins/telemetry/config_new/selectors.rs index 300905d96a..43af9d2ee7 100644 --- a/apollo-router/src/plugins/telemetry/config_new/selectors.rs +++ b/apollo-router/src/plugins/telemetry/config_new/selectors.rs @@ -4,16 +4,17 @@ use jsonpath_rust::JsonPathFinder; use jsonpath_rust::JsonPathInst; use schemars::JsonSchema; use serde::Deserialize; -#[cfg(test)] -use serde::Serialize; use serde_json_bytes::ByteString; use sha2::Digest; +use crate::context::CONTAINS_GRAPHQL_ERROR; use crate::context::OPERATION_KIND; use crate::context::OPERATION_NAME; use crate::plugin::serde::deserialize_json_query; use crate::plugin::serde::deserialize_jsonpath; +use crate::plugins::demand_control::CostContext; use crate::plugins::telemetry::config::AttributeValue; +use crate::plugins::telemetry::config_new::cost::CostValue; use crate::plugins::telemetry::config_new::get_baggage; use crate::plugins::telemetry::config_new::trace_id; use crate::plugins::telemetry::config_new::DatadogId; @@ -24,6 +25,7 @@ use crate::services::subgraph; use crate::services::supergraph; #[derive(Deserialize, JsonSchema, Clone, Debug)] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case")] pub(crate) enum TraceIdFormat { /// Open Telemetry trace ID, a hex string. @@ -33,7 +35,7 @@ pub(crate) enum TraceIdFormat { } #[derive(Deserialize, JsonSchema, Clone, Debug)] -#[cfg_attr(test, derive(Serialize))] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case")] pub(crate) enum OperationName { /// The raw operation name. @@ -43,7 +45,7 @@ pub(crate) enum OperationName { } #[derive(Deserialize, JsonSchema, Clone, Debug)] -#[cfg_attr(test, derive(Serialize))] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case")] pub(crate) enum Query { /// The raw query kind. @@ -51,7 +53,7 @@ pub(crate) enum Query { } #[derive(Deserialize, JsonSchema, Clone, Debug)] -#[cfg_attr(test, derive(Serialize))] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case")] pub(crate) enum ResponseStatus { /// The http status code. @@ -61,7 +63,7 @@ pub(crate) enum ResponseStatus { } #[derive(Deserialize, JsonSchema, Clone, Debug)] -#[cfg_attr(test, derive(Serialize))] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case")] pub(crate) enum OperationKind { /// The raw operation kind. @@ -69,6 +71,7 @@ pub(crate) enum OperationKind { } #[derive(Deserialize, JsonSchema, Clone, Debug)] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, untagged)] pub(crate) enum RouterSelector { /// A header from the request @@ -142,10 +145,18 @@ pub(crate) enum RouterSelector { default: Option, }, Static(String), + StaticField { + /// A static string value + r#static: String, + }, + OnGraphQLError { + /// Boolean set to true if the response body contains graphql error + on_graphql_error: bool, + }, } #[derive(Deserialize, JsonSchema, Clone, Debug)] -#[cfg_attr(test, derive(Serialize))] +#[cfg_attr(test, derive(PartialEq))] #[serde(deny_unknown_fields, untagged)] pub(crate) enum SupergraphSelector { OperationName { @@ -252,9 +263,20 @@ pub(crate) enum SupergraphSelector { default: Option, }, Static(String), + StaticField { + /// A static string value + r#static: String, + }, + /// Cost attributes + #[allow(dead_code)] + Cost { + /// The cost value to select, one of: estimated, actual, delta. + cost: CostValue, + }, } #[derive(Deserialize, JsonSchema, Clone, Derivative)] +#[cfg_attr(test, derivative(PartialEq))] #[serde(deny_unknown_fields, rename_all = "snake_case", untagged)] #[derivative(Debug)] pub(crate) enum SubgraphSelector { @@ -312,7 +334,7 @@ pub(crate) enum SubgraphSelector { SubgraphResponseData { /// The subgraph response body json path. #[schemars(with = "String")] - #[derivative(Debug = "ignore")] + #[derivative(Debug = "ignore", PartialEq = "ignore")] #[serde(deserialize_with = "deserialize_jsonpath")] subgraph_response_data: JsonPathInst, #[serde(skip)] @@ -325,7 +347,7 @@ pub(crate) enum SubgraphSelector { SubgraphResponseErrors { /// The subgraph response body json path. #[schemars(with = "String")] - #[derivative(Debug = "ignore")] + #[derivative(Debug = "ignore", PartialEq = "ignore")] #[serde(deserialize_with = "deserialize_jsonpath")] subgraph_response_errors: JsonPathInst, #[serde(skip)] @@ -448,6 +470,10 @@ pub(crate) enum SubgraphSelector { default: Option, }, Static(String), + StaticField { + /// A static string value + r#static: String, + }, } impl Selector for RouterSelector { @@ -486,6 +512,7 @@ impl Selector for RouterSelector { baggage, default, .. } => get_baggage(baggage).or_else(|| default.maybe_to_otel_value()), RouterSelector::Static(val) => Some(val.clone().into()), + RouterSelector::StaticField { r#static } => Some(r#static.clone().into()), // Related to Response _ => None, } @@ -519,15 +546,23 @@ impl Selector for RouterSelector { .. } => response .context - .get::<_, serde_json_bytes::Value>(response_context) - .ok() - .flatten() + .get_json_value(response_context) .as_ref() .and_then(|v| v.maybe_to_otel_value()) .or_else(|| default.maybe_to_otel_value()), RouterSelector::Baggage { baggage, default, .. } => get_baggage(baggage).or_else(|| default.maybe_to_otel_value()), + RouterSelector::OnGraphQLError { on_graphql_error } if *on_graphql_error => { + if response.context.get_json_value(CONTAINS_GRAPHQL_ERROR) + == Some(serde_json_bytes::Value::Bool(true)) + { + Some(opentelemetry::Value::Bool(true)) + } else { + None + } + } + RouterSelector::StaticField { r#static } => Some(r#static.clone().into()), _ => None, } } @@ -613,6 +648,7 @@ impl Selector for SupergraphSelector { .or_else(|| default.clone()) .map(opentelemetry::Value::from), SupergraphSelector::Static(val) => Some(val.clone().into()), + SupergraphSelector::StaticField { r#static } => Some(r#static.clone().into()), // For response _ => None, } @@ -647,12 +683,22 @@ impl Selector for SupergraphSelector { .. } => response .context - .get::<_, serde_json_bytes::Value>(response_context) - .ok() - .flatten() + .get_json_value(response_context) .as_ref() .and_then(|v| v.maybe_to_otel_value()) .or_else(|| default.maybe_to_otel_value()), + SupergraphSelector::StaticField { r#static } => Some(r#static.clone().into()), + SupergraphSelector::Cost { cost } => { + let extensions = response.context.extensions().lock(); + extensions + .get::() + .map(|cost_result| match cost { + CostValue::Estimated => cost_result.estimated.into(), + CostValue::Actual => cost_result.actual.into(), + CostValue::Delta => cost_result.delta().into(), + CostValue::Result => cost_result.result.into(), + }) + } // For request _ => None, } @@ -794,6 +840,7 @@ impl Selector for SubgraphSelector { .or_else(|| default.clone()) .map(opentelemetry::Value::from), SubgraphSelector::Static(val) => Some(val.clone().into()), + SubgraphSelector::StaticField { r#static } => Some(r#static.clone().into()), // For response _ => None, @@ -885,12 +932,11 @@ impl Selector for SubgraphSelector { .. } => response .context - .get::<_, serde_json_bytes::Value>(response_context) - .ok() - .flatten() + .get_json_value(response_context) .as_ref() .and_then(|v| v.maybe_to_otel_value()) .or_else(|| default.maybe_to_otel_value()), + SubgraphSelector::StaticField { r#static } => Some(r#static.clone().into()), // For request _ => None, } @@ -932,6 +978,7 @@ mod test { use crate::plugins::telemetry::config_new::selectors::SupergraphSelector; use crate::plugins::telemetry::config_new::selectors::TraceIdFormat; use crate::plugins::telemetry::config_new::Selector; + use crate::plugins::telemetry::otel; #[test] fn router_static() { @@ -1481,7 +1528,7 @@ mod test { #[test] fn router_baggage() { - let subscriber = tracing_subscriber::registry().with(tracing_opentelemetry::layer()); + let subscriber = tracing_subscriber::registry().with(otel::layer()); subscriber::with_default(subscriber, || { let selector = RouterSelector::Baggage { baggage: "baggage_key".to_string(), @@ -1519,7 +1566,7 @@ mod test { #[test] fn supergraph_baggage() { - let subscriber = tracing_subscriber::registry().with(tracing_opentelemetry::layer()); + let subscriber = tracing_subscriber::registry().with(otel::layer()); subscriber::with_default(subscriber, || { let selector = SupergraphSelector::Baggage { baggage: "baggage_key".to_string(), @@ -1557,7 +1604,7 @@ mod test { #[test] fn subgraph_baggage() { - let subscriber = tracing_subscriber::registry().with(tracing_opentelemetry::layer()); + let subscriber = tracing_subscriber::registry().with(otel::layer()); subscriber::with_default(subscriber, || { let selector = SubgraphSelector::Baggage { baggage: "baggage_key".to_string(), @@ -1588,7 +1635,7 @@ mod test { #[test] fn router_trace_id() { - let subscriber = tracing_subscriber::registry().with(tracing_opentelemetry::layer()); + let subscriber = tracing_subscriber::registry().with(otel::layer()); subscriber::with_default(subscriber, || { let selector = RouterSelector::TraceId { trace_id: TraceIdFormat::OpenTelemetry, diff --git a/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__router_events@logs.snap b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__router_events@logs.snap new file mode 100644 index 0000000000..29ce2dc07c --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__router_events@logs.snap @@ -0,0 +1,130 @@ +--- +source: apollo-router/src/plugins/telemetry/config_new/events.rs +expression: yaml +--- +- fields: + kind: router.request + level: INFO + message: "" + span: + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" + spans: + - http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" +- fields: + kind: my.request_event + level: INFO + message: my event message + span: + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" + spans: + - http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" +- fields: + kind: router.response + level: INFO + message: "" + span: + apollo_private.duration_ns: "[duration]" + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" + spans: + - apollo_private.duration_ns: "[duration]" + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" +- fields: + kind: my.response_event + level: INFO + message: my response event message + span: + apollo_private.duration_ns: "[duration]" + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" + spans: + - apollo_private.duration_ns: "[duration]" + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" +- fields: + kind: router.request + level: INFO + message: "" + span: + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" + spans: + - http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" +- fields: + kind: router.response + level: INFO + message: "" + span: + apollo_private.duration_ns: "[duration]" + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" + spans: + - apollo_private.duration_ns: "[duration]" + http.flavor: HTTP/1.1 + http.method: GET + http.request.method: GET + http.route: "http://example.com/" + name: router + otel.kind: INTERNAL + trace_id: "" diff --git a/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__subgraph_events@logs.snap b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__subgraph_events@logs.snap new file mode 100644 index 0000000000..b0d8235272 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__subgraph_events@logs.snap @@ -0,0 +1,38 @@ +--- +source: apollo-router/src/plugins/telemetry/config_new/events.rs +expression: yaml +--- +- fields: + kind: my.request.event + level: INFO + message: my event message + span: + apollo.subgraph.name: subgraph + graphql.document: "query { foo }" + graphql.operation.name: "" + name: subgraph + otel.kind: INTERNAL + spans: + - apollo.subgraph.name: subgraph + graphql.document: "query { foo }" + graphql.operation.name: "" + name: subgraph + otel.kind: INTERNAL +- fields: + kind: my.response.event + level: ERROR + message: my response event message + span: + apollo.subgraph.name: subgraph + graphql.document: "query { foo }" + graphql.operation.name: "" + name: subgraph + otel.kind: INTERNAL + otel.status_code: OK + spans: + - apollo.subgraph.name: subgraph + graphql.document: "query { foo }" + graphql.operation.name: "" + name: subgraph + otel.kind: INTERNAL + otel.status_code: OK diff --git a/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__supergraph_events@logs.snap b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__supergraph_events@logs.snap new file mode 100644 index 0000000000..e83288be4e --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__events__tests__supergraph_events@logs.snap @@ -0,0 +1,52 @@ +--- +source: apollo-router/src/plugins/telemetry/config_new/events.rs +expression: yaml +--- +- fields: + kind: supergraph.request + level: INFO + message: "" + span: + apollo_private.field_level_instrumentation_ratio: 0.01 + apollo_private.graphql.variables: "{}" + graphql.document: "query { foo }" + name: supergraph + otel.kind: INTERNAL + spans: + - apollo_private.field_level_instrumentation_ratio: 0.01 + apollo_private.graphql.variables: "{}" + graphql.document: "query { foo }" + name: supergraph + otel.kind: INTERNAL +- fields: + kind: my.request.event + level: INFO + message: my event message + span: + apollo_private.field_level_instrumentation_ratio: 0.01 + apollo_private.graphql.variables: "{}" + graphql.document: "query { foo }" + name: supergraph + otel.kind: INTERNAL + spans: + - apollo_private.field_level_instrumentation_ratio: 0.01 + apollo_private.graphql.variables: "{}" + graphql.document: "query { foo }" + name: supergraph + otel.kind: INTERNAL +- fields: + kind: my.response_event + level: WARN + message: my response event message + span: + apollo_private.field_level_instrumentation_ratio: 0.01 + apollo_private.graphql.variables: "{}" + graphql.document: "query { foo }" + name: supergraph + otel.kind: INTERNAL + spans: + - apollo_private.field_level_instrumentation_ratio: 0.01 + apollo_private.graphql.variables: "{}" + graphql.document: "query { foo }" + name: supergraph + otel.kind: INTERNAL diff --git a/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__extendable__test__extendable_serde.snap b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__extendable__test__extendable_serde.snap deleted file mode 100644 index 760c8c5b09..0000000000 --- a/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__extendable__test__extendable_serde.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: apollo-router/src/plugins/telemetry/config_new/extendable.rs -expression: o ---- -attributes: - graphql.document: ~ - graphql.operation.name: true - graphql.operation.type: true -custom: - custom_1: - operation_name: string - default: ~ - custom_2: - operation_name: string - default: ~ - diff --git a/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__extendable__test__extendable_serde_conditional.snap b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__extendable__test__extendable_serde_conditional.snap new file mode 100644 index 0000000000..1431429a85 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/config_new/snapshots/apollo_router__plugins__telemetry__config_new__extendable__test__extendable_serde_conditional.snap @@ -0,0 +1,72 @@ +--- +source: apollo-router/src/plugins/telemetry/config_new/extendable.rs +expression: o +--- +Extendable { + attributes: RouterAttributes { + datadog_trace_id: None, + trace_id: None, + baggage: None, + common: HttpCommonAttributes { + error_type: None, + http_request_body_size: None, + http_request_method: Some( + true, + ), + http_request_method_original: None, + http_response_body_size: None, + http_response_status_code: Some( + true, + ), + network_protocol_name: None, + network_protocol_version: None, + network_transport: None, + network_type: None, + }, + server: HttpServerAttributes { + client_address: None, + client_port: None, + http_route: None, + network_local_address: None, + network_local_port: None, + network_peer_address: None, + network_peer_port: None, + server_address: None, + server_port: None, + url_path: Some( + true, + ), + url_query: None, + url_scheme: None, + user_agent_original: None, + }, + }, + custom: { + "http.request.header.x-my-header": Conditional { + selector: RequestHeader { + request_header: "x-my-header", + redact: None, + default: None, + }, + condition: None, + value: Mutex { + data: Pending, + }, + }, + "http.request.header.x-not-present": Conditional { + selector: RequestHeader { + request_header: "x-not-present", + redact: None, + default: Some( + String( + "nope", + ), + ), + }, + condition: None, + value: Mutex { + data: Pending, + }, + }, + }, +} diff --git a/apollo-router/src/plugins/telemetry/config_new/spans.rs b/apollo-router/src/plugins/telemetry/config_new/spans.rs index 396077e7a1..4d85f4b9e4 100644 --- a/apollo-router/src/plugins/telemetry/config_new/spans.rs +++ b/apollo-router/src/plugins/telemetry/config_new/spans.rs @@ -1,6 +1,7 @@ use schemars::JsonSchema; use serde::Deserialize; +use super::conditional::Conditional; use crate::plugins::telemetry::config_new::attributes::DefaultAttributeRequirementLevel; use crate::plugins::telemetry::config_new::attributes::RouterAttributes; use crate::plugins::telemetry::config_new::attributes::SubgraphAttributes; @@ -58,7 +59,7 @@ impl Spans { #[serde(deny_unknown_fields, default)] pub(crate) struct RouterSpans { /// Custom attributes that are attached to the router span. - pub(crate) attributes: Extendable, + pub(crate) attributes: Extendable>, } impl DefaultForLevel for RouterSpans { @@ -75,7 +76,7 @@ impl DefaultForLevel for RouterSpans { #[serde(deny_unknown_fields, default)] pub(crate) struct SupergraphSpans { /// Custom attributes that are attached to the supergraph span. - pub(crate) attributes: Extendable, + pub(crate) attributes: Extendable>, } impl DefaultForLevel for SupergraphSpans { fn defaults_for_level( @@ -91,7 +92,7 @@ impl DefaultForLevel for SupergraphSpans { #[serde(deny_unknown_fields, default)] pub(crate) struct SubgraphSpans { /// Custom attributes that are attached to the subgraph span. - pub(crate) attributes: Extendable, + pub(crate) attributes: Extendable>, } impl DefaultForLevel for SubgraphSpans { @@ -106,16 +107,25 @@ impl DefaultForLevel for SubgraphSpans { #[cfg(test)] mod test { + use std::sync::Arc; + use http::header::USER_AGENT; use opentelemetry_semantic_conventions::trace::GRAPHQL_DOCUMENT; use opentelemetry_semantic_conventions::trace::HTTP_REQUEST_METHOD; use opentelemetry_semantic_conventions::trace::NETWORK_PROTOCOL_VERSION; use opentelemetry_semantic_conventions::trace::URL_PATH; use opentelemetry_semantic_conventions::trace::USER_AGENT_ORIGINAL; + use parking_lot::Mutex; + use crate::context::CONTAINS_GRAPHQL_ERROR; use crate::graphql; + use crate::plugins::telemetry::config::AttributeValue; use crate::plugins::telemetry::config_new::attributes::DefaultAttributeRequirementLevel; use crate::plugins::telemetry::config_new::attributes::SUBGRAPH_GRAPHQL_DOCUMENT; + use crate::plugins::telemetry::config_new::conditional::Conditional; + use crate::plugins::telemetry::config_new::conditions::Condition; + use crate::plugins::telemetry::config_new::conditions::SelectorOrValue; + use crate::plugins::telemetry::config_new::selectors::ResponseStatus; use crate::plugins::telemetry::config_new::selectors::RouterSelector; use crate::plugins::telemetry::config_new::selectors::SubgraphSelector; use crate::plugins::telemetry::config_new::selectors::SupergraphSelector; @@ -128,6 +138,7 @@ mod test { use crate::services::router; use crate::services::subgraph; use crate::services::supergraph; + use crate::Context; #[test] fn test_router_spans_level_none() { @@ -329,15 +340,182 @@ mod test { .any(|key_val| key_val.key == SUBGRAPH_GRAPHQL_DOCUMENT)); } + #[test] + fn test_router_request_static_custom_attribute_on_graphql_error() { + let mut spans = RouterSpans::default(); + spans.attributes.custom.insert( + "test".to_string(), + Conditional { + selector: RouterSelector::StaticField { + r#static: "my-static-value".to_string(), + }, + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(AttributeValue::Bool(true)), + SelectorOrValue::Selector(RouterSelector::OnGraphQLError { + on_graphql_error: true, + }), + ])))), + value: Arc::new(Default::default()), + }, + ); + let context = Context::new(); + context.insert_json_value(CONTAINS_GRAPHQL_ERROR, serde_json_bytes::Value::Bool(true)); + let values = spans.attributes.on_response( + &router::Response::fake_builder() + .header("my-header", "test_val") + .context(context) + .build() + .unwrap(), + ); + assert!(values.iter().any(|key_val| key_val.key + == opentelemetry::Key::from_static_str("test") + && key_val.value + == opentelemetry::Value::String("my-static-value".to_string().into()))); + } + + #[test] + fn test_router_request_custom_attribute_on_graphql_error() { + let mut spans = RouterSpans::default(); + spans.attributes.custom.insert( + "test".to_string(), + Conditional { + selector: RouterSelector::ResponseHeader { + response_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(AttributeValue::Bool(true)), + SelectorOrValue::Selector(RouterSelector::OnGraphQLError { + on_graphql_error: true, + }), + ])))), + value: Arc::new(Default::default()), + }, + ); + let context = Context::new(); + context.insert_json_value(CONTAINS_GRAPHQL_ERROR, serde_json_bytes::Value::Bool(true)); + let values = spans.attributes.on_response( + &router::Response::fake_builder() + .header("my-header", "test_val") + .context(context) + .build() + .unwrap(), + ); + assert!(values + .iter() + .any(|key_val| key_val.key == opentelemetry::Key::from_static_str("test"))); + } + + #[test] + fn test_router_request_custom_attribute_not_on_graphql_error() { + let mut spans = RouterSpans::default(); + spans.attributes.custom.insert( + "test".to_string(), + Conditional { + selector: RouterSelector::ResponseHeader { + response_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(AttributeValue::Bool(true)), + SelectorOrValue::Selector(RouterSelector::OnGraphQLError { + on_graphql_error: true, + }), + ])))), + value: Arc::new(Default::default()), + }, + ); + let context = Context::new(); + context.insert_json_value(CONTAINS_GRAPHQL_ERROR, serde_json_bytes::Value::Bool(false)); + let values = spans.attributes.on_response( + &router::Response::fake_builder() + .header("my-header", "test_val") + .context(context) + .build() + .unwrap(), + ); + assert!(!values + .iter() + .any(|key_val| key_val.key == opentelemetry::Key::from_static_str("test"))); + } + + #[test] + fn test_router_request_custom_attribute_condition_true() { + let mut spans = RouterSpans::default(); + let selector = RouterSelector::RequestHeader { + request_header: "my-header".to_string(), + redact: None, + default: None, + }; + spans.attributes.custom.insert( + "test".to_string(), + Conditional { + selector: selector.clone(), + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(AttributeValue::String("test_val".to_string())), + SelectorOrValue::Selector(selector), + ])))), + value: Default::default(), + }, + ); + let values = spans.attributes.on_request( + &router::Request::fake_builder() + .method(http::Method::POST) + .header("my-header", "test_val") + .build() + .unwrap(), + ); + assert!(values + .iter() + .any(|key_val| key_val.key == opentelemetry::Key::from_static_str("test"))); + } + + #[test] + fn test_router_request_custom_attribute_condition_false() { + let mut spans = RouterSpans::default(); + let selector = RouterSelector::RequestHeader { + request_header: "my-header".to_string(), + redact: None, + default: None, + }; + spans.attributes.custom.insert( + "test".to_string(), + Conditional { + selector: selector.clone(), + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(AttributeValue::String("test_val".to_string())), + SelectorOrValue::Selector(selector), + ])))), + value: Arc::new(Default::default()), + }, + ); + let values = spans.attributes.on_request( + &router::Request::fake_builder() + .method(http::Method::POST) + .header("my-header", "bar") + .build() + .unwrap(), + ); + assert!(!values + .iter() + .any(|key_val| key_val.key == opentelemetry::Key::from_static_str("test"))); + } + #[test] fn test_router_request_custom_attribute() { let mut spans = RouterSpans::default(); spans.attributes.custom.insert( "test".to_string(), - RouterSelector::RequestHeader { - request_header: "my-header".to_string(), - redact: None, - default: None, + Conditional { + selector: RouterSelector::RequestHeader { + request_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: None, + value: Arc::new(Default::default()), }, ); let values = spans.attributes.on_request( @@ -357,10 +535,14 @@ mod test { let mut spans = RouterSpans::default(); spans.attributes.custom.insert( "test".to_string(), - RouterSelector::ResponseHeader { - response_header: "my-header".to_string(), - redact: None, - default: None, + Conditional { + selector: RouterSelector::ResponseHeader { + response_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: None, + value: Arc::new(Default::default()), }, ); let values = spans.attributes.on_response( @@ -379,10 +561,14 @@ mod test { let mut spans = SupergraphSpans::default(); spans.attributes.custom.insert( "test".to_string(), - SupergraphSelector::RequestHeader { - request_header: "my-header".to_string(), - redact: None, - default: None, + Conditional { + selector: SupergraphSelector::RequestHeader { + request_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: None, + value: Arc::new(Default::default()), }, ); let values = spans.attributes.on_request( @@ -402,10 +588,14 @@ mod test { let mut spans = SupergraphSpans::default(); spans.attributes.custom.insert( "test".to_string(), - SupergraphSelector::ResponseHeader { - response_header: "my-header".to_string(), - redact: None, - default: None, + Conditional { + selector: SupergraphSelector::ResponseHeader { + response_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: None, + value: Arc::new(Default::default()), }, ); let values = spans.attributes.on_response( @@ -424,10 +614,14 @@ mod test { let mut spans = SubgraphSpans::default(); spans.attributes.custom.insert( "test".to_string(), - SubgraphSelector::SubgraphRequestHeader { - subgraph_request_header: "my-header".to_string(), - redact: None, - default: None, + Conditional { + selector: SubgraphSelector::SubgraphRequestHeader { + subgraph_request_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: None, + value: Arc::new(Default::default()), }, ); let values = spans.attributes.on_request( @@ -455,10 +649,14 @@ mod test { let mut spans = SubgraphSpans::default(); spans.attributes.custom.insert( "test".to_string(), - SubgraphSelector::SubgraphResponseHeader { - subgraph_response_header: "my-header".to_string(), - redact: None, - default: None, + Conditional { + selector: SubgraphSelector::SubgraphResponseHeader { + subgraph_response_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: None, + value: Arc::new(Default::default()), }, ); let values = spans.attributes.on_response( @@ -471,4 +669,68 @@ mod test { .iter() .any(|key_val| key_val.key == opentelemetry::Key::from_static_str("test"))); } + + #[test] + fn test_subgraph_response_custom_attribute_good_condition() { + let mut spans = SubgraphSpans::default(); + spans.attributes.custom.insert( + "test".to_string(), + Conditional { + selector: SubgraphSelector::SubgraphResponseHeader { + subgraph_response_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(AttributeValue::I64(200)), + SelectorOrValue::Selector(SubgraphSelector::SubgraphResponseStatus { + subgraph_response_status: ResponseStatus::Code, + }), + ])))), + value: Arc::new(Default::default()), + }, + ); + let values = spans.attributes.on_response( + &subgraph::Response::fake2_builder() + .header("my-header", "test_val") + .status_code(http::StatusCode::OK) + .build() + .unwrap(), + ); + assert!(values + .iter() + .any(|key_val| key_val.key == opentelemetry::Key::from_static_str("test"))); + } + + #[test] + fn test_subgraph_response_custom_attribute_bad_condition() { + let mut spans = SubgraphSpans::default(); + spans.attributes.custom.insert( + "test".to_string(), + Conditional { + selector: SubgraphSelector::SubgraphResponseHeader { + subgraph_response_header: "my-header".to_string(), + redact: None, + default: None, + }, + condition: Some(Arc::new(Mutex::new(Condition::Eq([ + SelectorOrValue::Value(AttributeValue::I64(400)), + SelectorOrValue::Selector(SubgraphSelector::SubgraphResponseStatus { + subgraph_response_status: ResponseStatus::Code, + }), + ])))), + value: Arc::new(Default::default()), + }, + ); + let values = spans.attributes.on_response( + &subgraph::Response::fake2_builder() + .header("my-header", "test_val") + .status_code(http::StatusCode::OK) + .build() + .unwrap(), + ); + assert!(!values + .iter() + .any(|key_val| key_val.key == opentelemetry::Key::from_static_str("test"))); + } } diff --git a/apollo-router/src/plugins/telemetry/dynamic_attribute.rs b/apollo-router/src/plugins/telemetry/dynamic_attribute.rs index 42cfa60703..2d1a99ce75 100644 --- a/apollo-router/src/plugins/telemetry/dynamic_attribute.rs +++ b/apollo-router/src/plugins/telemetry/dynamic_attribute.rs @@ -1,11 +1,12 @@ use opentelemetry::Key; use opentelemetry::KeyValue; -use tracing_opentelemetry::OtelData; +use opentelemetry::OrderMap; use tracing_subscriber::layer::Context; use tracing_subscriber::registry::LookupSpan; use tracing_subscriber::Layer; use tracing_subscriber::Registry; +use super::otel::OtelData; use super::reload::IsSampled; use super::tracing::APOLLO_PRIVATE_PREFIX; @@ -28,9 +29,10 @@ impl LogAttributes { } } -pub(crate) struct DynAttributeLayer; +/// To add dynamic attributes for spans +pub(crate) struct DynSpanAttributeLayer; -impl Layer for DynAttributeLayer +impl Layer for DynSpanAttributeLayer where S: tracing_core::Subscriber + for<'lookup> tracing_subscriber::registry::LookupSpan<'lookup>, { @@ -48,19 +50,20 @@ where } } -impl DynAttributeLayer { +impl DynSpanAttributeLayer { pub(crate) fn new() -> Self { Self {} } } -pub(crate) trait DynAttribute { - fn set_dyn_attribute(&self, key: Key, value: opentelemetry::Value); - fn set_dyn_attributes(&self, attributes: impl IntoIterator); +/// To add dynamic attributes for spans +pub(crate) trait SpanDynAttribute { + fn set_span_dyn_attribute(&self, key: Key, value: opentelemetry::Value); + fn set_span_dyn_attributes(&self, attributes: impl IntoIterator); } -impl DynAttribute for ::tracing::Span { - fn set_dyn_attribute(&self, key: Key, value: opentelemetry::Value) { +impl SpanDynAttribute for ::tracing::Span { + fn set_span_dyn_attribute(&self, key: Key, value: opentelemetry::Value) { self.with_subscriber(move |(id, dispatch)| { if let Some(reg) = dispatch.downcast_ref::() { match reg.span(id) { @@ -110,7 +113,7 @@ impl DynAttribute for ::tracing::Span { }); } - fn set_dyn_attributes(&self, attributes: impl IntoIterator) { + fn set_span_dyn_attributes(&self, attributes: impl IntoIterator) { let mut attributes = attributes.into_iter().peekable(); if attributes.peek().is_none() { return; @@ -166,3 +169,83 @@ impl DynAttribute for ::tracing::Span { }); } } + +/// To add dynamic attributes for spans +pub(crate) trait EventDynAttribute { + /// Always use before sending the event + fn set_event_dyn_attribute(&self, key: Key, value: opentelemetry::Value); + /// Always use before sending the event + fn set_event_dyn_attributes(&self, attributes: impl IntoIterator); +} + +impl EventDynAttribute for ::tracing::Span { + fn set_event_dyn_attribute(&self, key: Key, value: opentelemetry::Value) { + self.with_subscriber(move |(id, dispatch)| { + if let Some(reg) = dispatch.downcast_ref::() { + match reg.span(id) { + None => eprintln!("no spanref, this is a bug"), + Some(s) => { + if key.as_str().starts_with(APOLLO_PRIVATE_PREFIX) { + return; + } + let mut extensions = s.extensions_mut(); + match extensions.get_mut::() { + Some(otel_data) => match &mut otel_data.event_attributes { + Some(attributes) => { + attributes.insert(key, value); + } + None => { + let mut order_map = OrderMap::new(); + order_map.insert(key, value); + otel_data.event_attributes = Some(order_map); + } + }, + None => { + // Can't use ::tracing::error! because it could create deadlock on extensions + eprintln!("no EventsAttributes, this is a bug"); + } + } + } + }; + } else { + ::tracing::error!("no Registry, this is a bug"); + } + }); + } + + fn set_event_dyn_attributes(&self, attributes: impl IntoIterator) { + let mut attributes = attributes.into_iter().peekable(); + if attributes.peek().is_none() { + return; + } + self.with_subscriber(move |(id, dispatch)| { + if let Some(reg) = dispatch.downcast_ref::() { + match reg.span(id) { + None => eprintln!("no spanref, this is a bug"), + Some(s) => { + let mut extensions = s.extensions_mut(); + match extensions.get_mut::() { + Some(otel_data) => match &mut otel_data.event_attributes { + Some(event_attributes) => { + event_attributes + .extend(attributes.map(|kv| (kv.key, kv.value))); + } + None => { + otel_data.event_attributes = Some(OrderMap::from_iter( + attributes.map(|kv| (kv.key, kv.value)), + )); + } + }, + None => { + // Can't use ::tracing::error! because it could create deadlock on extensions + eprintln!("no EventsAttributes, this is a bug"); + } + } + } + }; + } else { + ::tracing::error!("no Registry, this is a bug"); + } + }); + } +} diff --git a/apollo-router/src/plugins/telemetry/fmt_layer.rs b/apollo-router/src/plugins/telemetry/fmt_layer.rs index ff28719fdb..450f831b0b 100644 --- a/apollo-router/src/plugins/telemetry/fmt_layer.rs +++ b/apollo-router/src/plugins/telemetry/fmt_layer.rs @@ -264,6 +264,8 @@ mod tests { use std::sync::Mutex; use std::sync::MutexGuard; + use http::header::CONTENT_LENGTH; + use http::HeaderValue; use tracing::error; use tracing::info; use tracing::info_span; @@ -271,10 +273,96 @@ mod tests { use tracing_subscriber::layer::SubscriberExt; use super::*; + use crate::graphql; + use crate::plugins::telemetry::config_new::events; + use crate::plugins::telemetry::config_new::events::log_event; + use crate::plugins::telemetry::config_new::events::EventLevel; + use crate::plugins::telemetry::config_new::instruments::Instrumented; use crate::plugins::telemetry::config_new::logging::JsonFormat; use crate::plugins::telemetry::config_new::logging::RateLimit; use crate::plugins::telemetry::config_new::logging::TextFormat; - use crate::plugins::telemetry::dynamic_attribute::DynAttribute; + use crate::plugins::telemetry::dynamic_attribute::SpanDynAttribute; + use crate::plugins::telemetry::otel; + use crate::services::router; + use crate::services::subgraph; + use crate::services::supergraph; + + const EVENT_CONFIGURATION: &str = r#" +router: + # Standard events + request: info + response: info + error: info + + # Custom events + my.request_event: + message: "my event message" + level: info + on: request + attributes: + http.request.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: info + on: response + attributes: + http.response.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - response_header: "x-log-request" +supergraph: + # Standard events + request: info + response: warn + error: info + + # Custom events + my.request.event: + message: "my event message" + level: info + on: request + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: warn + on: response + condition: + eq: + - "log" + - response_header: "x-log-request" +subgraph: + # Standard events + request: info + response: warn + error: error + + # Custom events + my.subgraph.request.event: + message: "my event message" + level: info + on: request + my.subgraph.response.event: + message: "my response event message" + level: error + on: response + attributes: + subgraph.name: true + response_status: + subgraph_response_status: code + "my.custom.attribute": + subgraph_response_data: "$.*" + default: "missing""#; #[derive(Default, Clone)] struct LogBuffer(Arc>>); @@ -311,8 +399,8 @@ mod tests { first = "one", apollo_private.should_not_display = "this should be skipped" ); - test_span.set_dyn_attribute("another".into(), 2.into()); - test_span.set_dyn_attribute("custom_dyn".into(), "test".into()); + test_span.set_span_dyn_attribute("another".into(), 2.into()); + test_span.set_span_dyn_attribute("custom_dyn".into(), "test".into()); let _enter = test_span.enter(); info!(event_attr = "foo", "Hello from test"); } @@ -323,8 +411,8 @@ mod tests { first = "one", apollo_private.should_not_display = "this should be skipped" ); - test_span.set_dyn_attribute("another".into(), 2.into()); - test_span.set_dyn_attribute("custom_dyn".into(), "test".into()); + test_span.set_span_dyn_attribute("another".into(), 2.into()); + test_span.set_span_dyn_attribute("custom_dyn".into(), "test".into()); let _enter = test_span.enter(); { let nested_test_span = info_span!( @@ -334,7 +422,7 @@ mod tests { ); let _enter = nested_test_span.enter(); - nested_test_span.set_dyn_attributes([ + nested_test_span.set_span_dyn_attributes([ KeyValue::new("inner", -42_i64), KeyValue::new("graphql.operation.kind", "Subscription"), ]); @@ -462,4 +550,363 @@ mod tests { insta::assert_display_snapshot!(buff.to_string()); } + + #[tokio::test] + async fn test_text_logging_with_custom_events() { + let buff = LogBuffer::default(); + let text_format = TextFormat { + ansi_escape_codes: false, + ..Default::default() + }; + let format = Text::new(Default::default(), text_format); + let fmt_layer = FmtLayer::new( + FilteringFormatter::new(format, filter_metric_events, &RateLimit::default()), + buff.clone(), + ) + .boxed(); + + ::tracing::subscriber::with_default( + fmt::Subscriber::new().with(otel::layer()).with(fmt_layer), + || { + let test_span = info_span!( + "test", + first = "one", + apollo_private.should_not_display = "this should be skipped" + ); + test_span.set_span_dyn_attribute("another".into(), 2.into()); + test_span.set_span_dyn_attribute("custom_dyn".into(), "test".into()); + let _enter = test_span.enter(); + let mut attributes = HashMap::new(); + attributes.insert("http.response.body.size".to_string(), "125".to_string()); + attributes.insert( + "http.response.body".to_string(), + r#"{"foo": "bar"}"#.to_string(), + ); + log_event( + EventLevel::Info, + "my_custom_event", + attributes, + "my message", + ); + + error!(http.method = "GET", "Hello from test"); + }, + ); + + insta::assert_display_snapshot!(buff.to_string()); + } + + #[tokio::test] + async fn test_json_logging_with_custom_events() { + let buff = LogBuffer::default(); + let text_format = JsonFormat { + display_span_list: false, + display_current_span: false, + display_resource: false, + ..Default::default() + }; + let format = Json::new(Default::default(), text_format); + let fmt_layer = FmtLayer::new( + FilteringFormatter::new(format, filter_metric_events, &RateLimit::default()), + buff.clone(), + ) + .boxed(); + + ::tracing::subscriber::with_default( + fmt::Subscriber::new().with(otel::layer()).with(fmt_layer), + || { + let test_span = info_span!( + "test", + first = "one", + apollo_private.should_not_display = "this should be skipped" + ); + test_span.set_span_dyn_attribute("another".into(), 2.into()); + test_span.set_span_dyn_attribute("custom_dyn".into(), "test".into()); + let _enter = test_span.enter(); + let mut attributes = HashMap::new(); + attributes.insert("http.response.body.size".to_string(), "125".to_string()); + attributes.insert( + "http.response.body".to_string(), + r#"{"foo": "bar"}"#.to_string(), + ); + log_event( + EventLevel::Info, + "my_custom_event", + attributes, + "my message", + ); + + error!(http.method = "GET", "Hello from test"); + }, + ); + + insta::assert_display_snapshot!(buff.to_string()); + } + + #[tokio::test] + async fn test_json_logging_with_custom_events_with_instrumented() { + let buff = LogBuffer::default(); + let text_format = JsonFormat { + display_span_list: false, + display_current_span: false, + display_resource: false, + ..Default::default() + }; + let format = Json::new(Default::default(), text_format); + let fmt_layer = FmtLayer::new( + FilteringFormatter::new(format, filter_metric_events, &RateLimit::default()), + buff.clone(), + ) + .boxed(); + + let event_config: events::Events = serde_yaml::from_str(EVENT_CONFIGURATION).unwrap(); + + ::tracing::subscriber::with_default( + fmt::Subscriber::new().with(otel::layer()).with(fmt_layer), + move || { + let test_span = info_span!( + "test", + first = "one", + apollo_private.should_not_display = "this should be skipped" + ); + test_span.set_span_dyn_attribute("another".into(), 2.into()); + test_span.set_span_dyn_attribute("custom_dyn".into(), "test".into()); + let _enter = test_span.enter(); + + let mut attributes = HashMap::new(); + attributes.insert("http.response.body.size".to_string(), "125".to_string()); + attributes.insert( + "http.response.body".to_string(), + r#"{"foo": "bar"}"#.to_string(), + ); + log_event( + EventLevel::Info, + "my_custom_event", + attributes, + "my message", + ); + + error!(http.method = "GET", "Hello from test"); + + let router_events = event_config.new_router_events(); + let router_req = router::Request::fake_builder() + .header(CONTENT_LENGTH, "0") + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .build() + .unwrap(); + router_events.on_request(&router_req); + + let router_resp = router::Response::fake_builder() + .header("custom-header", "val1") + .header(CONTENT_LENGTH, "25") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json_bytes::json!({"data": "res"})) + .build() + .expect("expecting valid response"); + router_events.on_response(&router_resp); + + let supergraph_events = event_config.new_supergraph_events(); + let supergraph_req = supergraph::Request::fake_builder() + .query("query { foo }") + .header("x-log-request", HeaderValue::from_static("log")) + .build() + .unwrap(); + supergraph_events.on_request(&supergraph_req); + + let supergraph_resp = supergraph::Response::fake_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"data": "res"}).to_string()) + .build() + .expect("expecting valid response"); + supergraph_events.on_response(&supergraph_resp); + + let subgraph_events = event_config.new_subgraph_events(); + let mut subgraph_req = http::Request::new( + graphql::Request::fake_builder() + .query("query { foo }") + .build(), + ); + subgraph_req + .headers_mut() + .insert("x-log-request", HeaderValue::from_static("log")); + + let subgraph_req = subgraph::Request::fake_builder() + .subgraph_name("subgraph") + .subgraph_request(subgraph_req) + .build(); + subgraph_events.on_request(&subgraph_req); + + let subgraph_resp = subgraph::Response::fake2_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"products": [{"id": 1234, "name": "first_name"}, {"id": 567, "name": "second_name"}]})) + .build() + .expect("expecting valid response"); + subgraph_events.on_response(&subgraph_resp); + + let subgraph_events = event_config.new_subgraph_events(); + let mut subgraph_req = http::Request::new( + graphql::Request::fake_builder() + .query("query { foo }") + .build(), + ); + subgraph_req + .headers_mut() + .insert("x-log-request", HeaderValue::from_static("log")); + + let subgraph_req = subgraph::Request::fake_builder() + .subgraph_name("subgraph_bis") + .subgraph_request(subgraph_req) + .build(); + subgraph_events.on_request(&subgraph_req); + + let subgraph_resp = subgraph::Response::fake2_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"products": [{"id": 1234, "name": "first_name"}, {"id": 567, "name": "second_name"}], "other": {"foo": "bar"}})) + .build() + .expect("expecting valid response"); + subgraph_events.on_response(&subgraph_resp); + }, + ); + + insta::assert_display_snapshot!(buff.to_string()); + } + + #[tokio::test] + async fn test_text_logging_with_custom_events_with_instrumented() { + let buff = LogBuffer::default(); + let text_format = TextFormat { + display_span_list: true, + display_current_span: false, + display_resource: false, + ansi_escape_codes: false, + ..Default::default() + }; + let format = Text::new(Default::default(), text_format); + let fmt_layer = FmtLayer::new( + FilteringFormatter::new(format, filter_metric_events, &RateLimit::default()), + buff.clone(), + ) + .boxed(); + + let event_config: events::Events = serde_yaml::from_str(EVENT_CONFIGURATION).unwrap(); + + ::tracing::subscriber::with_default( + fmt::Subscriber::new().with(otel::layer()).with(fmt_layer), + move || { + let test_span = info_span!( + "test", + first = "one", + apollo_private.should_not_display = "this should be skipped" + ); + test_span.set_span_dyn_attribute("another".into(), 2.into()); + test_span.set_span_dyn_attribute("custom_dyn".into(), "test".into()); + let _enter = test_span.enter(); + + let mut attributes = HashMap::new(); + attributes.insert("http.response.body.size".to_string(), "125".to_string()); + attributes.insert( + "http.response.body".to_string(), + r#"{"foo": "bar"}"#.to_string(), + ); + log_event( + EventLevel::Info, + "my_custom_event", + attributes, + "my message", + ); + + error!(http.method = "GET", "Hello from test"); + + let router_events = event_config.new_router_events(); + let router_req = router::Request::fake_builder() + .header(CONTENT_LENGTH, "0") + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .build() + .unwrap(); + router_events.on_request(&router_req); + + let router_resp = router::Response::fake_builder() + .header("custom-header", "val1") + .header(CONTENT_LENGTH, "25") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json_bytes::json!({"data": "res"})) + .build() + .expect("expecting valid response"); + router_events.on_response(&router_resp); + + let supergraph_events = event_config.new_supergraph_events(); + let supergraph_req = supergraph::Request::fake_builder() + .query("query { foo }") + .header("x-log-request", HeaderValue::from_static("log")) + .build() + .unwrap(); + supergraph_events.on_request(&supergraph_req); + + let supergraph_resp = supergraph::Response::fake_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"data": "res"}).to_string()) + .build() + .expect("expecting valid response"); + supergraph_events.on_response(&supergraph_resp); + + let subgraph_events = event_config.new_subgraph_events(); + let mut subgraph_req = http::Request::new( + graphql::Request::fake_builder() + .query("query { foo }") + .build(), + ); + subgraph_req + .headers_mut() + .insert("x-log-request", HeaderValue::from_static("log")); + + let subgraph_req = subgraph::Request::fake_builder() + .subgraph_name("subgraph") + .subgraph_request(subgraph_req) + .build(); + subgraph_events.on_request(&subgraph_req); + + let subgraph_resp = subgraph::Response::fake2_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"products": [{"id": 1234, "name": "first_name"}, {"id": 567, "name": "second_name"}]})) + .build() + .expect("expecting valid response"); + subgraph_events.on_response(&subgraph_resp); + + let subgraph_events = event_config.new_subgraph_events(); + let mut subgraph_req = http::Request::new( + graphql::Request::fake_builder() + .query("query { foo }") + .build(), + ); + subgraph_req + .headers_mut() + .insert("x-log-request", HeaderValue::from_static("log")); + + let subgraph_req = subgraph::Request::fake_builder() + .subgraph_name("subgraph_bis") + .subgraph_request(subgraph_req) + .build(); + subgraph_events.on_request(&subgraph_req); + + let subgraph_resp = subgraph::Response::fake2_builder() + .header("custom-header", "val1") + .header("x-log-request", HeaderValue::from_static("log")) + .data(serde_json::json!({"products": [{"id": 1234, "name": "first_name"}, {"id": 567, "name": "second_name"}], "other": {"foo": "bar"}})) + .build() + .expect("expecting valid response"); + subgraph_events.on_response(&subgraph_resp); + }, + ); + + insta::assert_display_snapshot!(buff.to_string()); + } + + // TODO add test using on_request/on_reponse/on_error } diff --git a/apollo-router/src/plugins/telemetry/formatters/json.rs b/apollo-router/src/plugins/telemetry/formatters/json.rs index 0af89c2a8b..668b4f146c 100644 --- a/apollo-router/src/plugins/telemetry/formatters/json.rs +++ b/apollo-router/src/plugins/telemetry/formatters/json.rs @@ -10,7 +10,6 @@ use serde::ser::Serializer as _; use serde_json::Serializer; use tracing_core::Event; use tracing_core::Subscriber; -use tracing_opentelemetry::OtelData; use tracing_serde::AsSerde; use tracing_subscriber::layer::Context; use tracing_subscriber::registry::LookupSpan; @@ -20,9 +19,11 @@ use super::get_trace_and_span_id; use super::EventFormatter; use super::APOLLO_PRIVATE_PREFIX; use super::EXCLUDED_ATTRIBUTES; +use crate::plugins::telemetry::config::AttributeValue; use crate::plugins::telemetry::config_new::logging::JsonFormat; use crate::plugins::telemetry::dynamic_attribute::LogAttributes; use crate::plugins::telemetry::formatters::to_list; +use crate::plugins::telemetry::otel::OtelData; #[derive(Debug)] pub(crate) struct Json { @@ -234,6 +235,16 @@ where .serialize_entry("span_id", &span_id.to_string()) .unwrap_or(()); } + }; + let event_attributes = { + let mut extensions = span.extensions_mut(); + let mut otel_data = extensions.get_mut::(); + otel_data.as_mut().and_then(|od| od.event_attributes.take()) + }; + if let Some(event_attributes) = event_attributes { + for (key, value) in event_attributes { + serializer.serialize_entry(key.as_str(), &AttributeValue::from(value))?; + } } } @@ -368,9 +379,10 @@ mod test { use tracing_subscriber::Layer; use tracing_subscriber::Registry; - use crate::plugins::telemetry::dynamic_attribute::DynAttribute; - use crate::plugins::telemetry::dynamic_attribute::DynAttributeLayer; + use crate::plugins::telemetry::dynamic_attribute::DynSpanAttributeLayer; + use crate::plugins::telemetry::dynamic_attribute::SpanDynAttribute; use crate::plugins::telemetry::formatters::json::extract_dd_trace_id; + use crate::plugins::telemetry::otel; struct RequiresDatadogLayer; impl Layer for RequiresDatadogLayer @@ -393,7 +405,7 @@ mod test { subscriber::with_default( Registry::default() .with(RequiresDatadogLayer) - .with(tracing_opentelemetry::layer()), + .with(otel::layer()), || { let root_span = tracing::info_span!("root", dd.trace_id = "1234"); let _root_span = root_span.enter(); @@ -407,11 +419,11 @@ mod test { subscriber::with_default( Registry::default() .with(RequiresDatadogLayer) - .with(DynAttributeLayer) - .with(tracing_opentelemetry::layer()), + .with(DynSpanAttributeLayer) + .with(otel::layer()), || { let root_span = tracing::info_span!("root"); - root_span.set_dyn_attribute("dd.trace_id".into(), "1234".into()); + root_span.set_span_dyn_attribute("dd.trace_id".into(), "1234".into()); let _root_span = root_span.enter(); tracing::info!("test"); }, @@ -424,8 +436,8 @@ mod test { subscriber::with_default( Registry::default() .with(RequiresDatadogLayer) - .with(DynAttributeLayer) - .with(tracing_opentelemetry::layer()), + .with(DynSpanAttributeLayer) + .with(otel::layer()), || { let root_span = tracing::info_span!("root"); let _root_span = root_span.enter(); diff --git a/apollo-router/src/plugins/telemetry/formatters/mod.rs b/apollo-router/src/plugins/telemetry/formatters/mod.rs index 024ac287e6..286a560668 100644 --- a/apollo-router/src/plugins/telemetry/formatters/mod.rs +++ b/apollo-router/src/plugins/telemetry/formatters/mod.rs @@ -15,7 +15,6 @@ use parking_lot::Mutex; use serde_json::Number; use tracing::Subscriber; use tracing_core::callsite::Identifier; -use tracing_opentelemetry::OtelData; use tracing_subscriber::fmt::format::Writer; use tracing_subscriber::fmt::FormatEvent; use tracing_subscriber::fmt::FormatFields; @@ -29,6 +28,7 @@ use crate::metrics::layer::METRIC_PREFIX_COUNTER; use crate::metrics::layer::METRIC_PREFIX_HISTOGRAM; use crate::metrics::layer::METRIC_PREFIX_MONOTONIC_COUNTER; use crate::metrics::layer::METRIC_PREFIX_VALUE; +use crate::plugins::telemetry::otel::OtelData; pub(crate) const APOLLO_PRIVATE_PREFIX: &str = "apollo_private."; // This list comes from Otel https://opentelemetry.io/docs/specs/semconv/attributes-registry/code/ and diff --git a/apollo-router/src/plugins/telemetry/formatters/text.rs b/apollo-router/src/plugins/telemetry/formatters/text.rs index 31a1bdc488..4b2a8e608a 100644 --- a/apollo-router/src/plugins/telemetry/formatters/text.rs +++ b/apollo-router/src/plugins/telemetry/formatters/text.rs @@ -8,12 +8,12 @@ use nu_ansi_term::Style; use opentelemetry::sdk::Resource; use serde_json::Value; use tracing_core::Event; +use tracing_core::Field; use tracing_core::Level; use tracing_core::Subscriber; -use tracing_opentelemetry::OtelData; use tracing_subscriber::field; -use tracing_subscriber::field::Visit; -use tracing_subscriber::fmt::format::DefaultVisitor; +use tracing_subscriber::field::VisitFmt; +use tracing_subscriber::field::VisitOutput; use tracing_subscriber::fmt::format::Writer; #[cfg(not(test))] use tracing_subscriber::fmt::time::FormatTime; @@ -28,6 +28,7 @@ use super::EXCLUDED_ATTRIBUTES; use crate::plugins::telemetry::config_new::logging::TextFormat; use crate::plugins::telemetry::dynamic_attribute::LogAttributes; use crate::plugins::telemetry::formatters::to_list; +use crate::plugins::telemetry::otel::OtelData; use crate::plugins::telemetry::tracing::APOLLO_PRIVATE_PREFIX; pub(crate) struct Text { @@ -357,63 +358,24 @@ where self.format_target(&mut writer, meta.target())?; } self.format_location(event, &mut writer)?; - - let mut visitor = CustomVisitor::new(DefaultVisitor::new(writer.by_ref(), true)); - event.record(&mut visitor); + let mut default_visitor = + DefaultVisitor::new(writer.by_ref(), true, self.config.ansi_escape_codes); + + if let Some(span) = ctx.event_span(event) { + let mut extensions = span.extensions_mut(); + let otel_data = extensions.get_mut::(); + if let Some(event_attributes) = otel_data.and_then(|od| od.event_attributes.take()) { + for (key, value) in event_attributes { + default_visitor.log_debug_attrs(key.as_str(), &value.as_str()); + } + } + } + event.record(&mut default_visitor); writeln!(writer) } } -struct CustomVisitor(N); - -impl CustomVisitor -where - N: field::Visit, -{ - fn new(inner: N) -> Self { - Self(inner) - } -} - -// TODO we are now able to filter fields here, for now it's just a passthrough -impl Visit for CustomVisitor -where - N: Visit, -{ - fn record_debug(&mut self, field: &tracing_core::Field, value: &dyn fmt::Debug) { - self.0.record_debug(field, value) - } - - fn record_str(&mut self, field: &tracing_core::Field, value: &str) { - self.0.record_str(field, value) - } - - fn record_error( - &mut self, - field: &tracing_core::Field, - value: &(dyn std::error::Error + 'static), - ) { - self.0.record_error(field, value) - } - - fn record_f64(&mut self, field: &tracing_core::Field, value: f64) { - self.0.record_f64(field, value) - } - - fn record_i64(&mut self, field: &tracing_core::Field, value: i64) { - self.0.record_i64(field, value) - } - - fn record_u64(&mut self, field: &tracing_core::Field, value: u64) { - self.0.record_u64(field, value) - } - - fn record_bool(&mut self, field: &tracing_core::Field, value: bool) { - self.0.record_bool(field, value) - } -} - struct FmtThreadName<'a> { name: &'a str, } @@ -456,3 +418,184 @@ impl<'a> fmt::Display for FmtThreadName<'a> { write!(f, "{:>width$}", self.name, width = max_len) } } + +/// The [visitor] produced by [`DefaultFields`]'s [`MakeVisitor`] implementation. +/// +/// [visitor]: super::super::field::Visit +/// [`MakeVisitor`]: super::super::field::MakeVisitor +#[derive(Debug)] +struct DefaultVisitor<'a> { + writer: Writer<'a>, + is_empty: bool, + is_ansi: bool, + result: fmt::Result, +} + +// === impl DefaultVisitor === + +impl<'a> DefaultVisitor<'a> { + /// Returns a new default visitor that formats to the provided `writer`. + /// + /// # Arguments + /// - `writer`: the writer to format to. + /// - `is_empty`: whether or not any fields have been previously written to + /// that writer. + fn new(writer: Writer<'a>, is_empty: bool, is_ansi: bool) -> Self { + Self { + writer, + is_empty, + is_ansi, + result: Ok(()), + } + } + + fn maybe_pad(&mut self) { + if self.is_empty { + self.is_empty = false; + } else { + self.result = write!(self.writer, " "); + } + } + + #[allow(dead_code)] + fn bold(&self) -> Style { + if self.is_ansi { + return Style::new().bold(); + } + + Style::new() + } + + fn dimmed(&self) -> Style { + if self.is_ansi { + return Style::new().dimmed(); + } + + Style::new() + } + + fn italic(&self) -> Style { + if self.is_ansi { + return Style::new().italic(); + } + + Style::new() + } + + fn log_debug_attrs(&mut self, field_name: &str, value: &dyn fmt::Debug) { + let style = self.dimmed(); + + self.result = write!(self.writer, "{}", style.prefix()); + if self.result.is_err() { + return; + } + + self.maybe_pad(); + self.result = match field_name { + name if name.starts_with("r#") => write!( + self.writer, + "{}{}{:?}", + self.italic().paint(&name[2..]), + self.dimmed().paint("="), + value + ), + name => write!( + self.writer, + "{}{}{:?}", + self.italic().paint(name), + self.dimmed().paint("="), + value + ), + }; + self.result = write!(self.writer, "{}", style.suffix()); + } + + fn log_debug(&mut self, field_name: &str, value: &dyn fmt::Debug) { + if self.result.is_err() { + return; + } + + self.maybe_pad(); + self.result = match field_name { + "message" => write!(self.writer, "{:?}", value), + name if name.starts_with("r#") => write!( + self.writer, + "{}{}{:?}", + self.italic().paint(&name[2..]), + self.dimmed().paint("="), + value + ), + name => write!( + self.writer, + "{}{}{:?}", + self.italic().paint(name), + self.dimmed().paint("="), + value + ), + }; + } +} + +impl<'a> field::Visit for DefaultVisitor<'a> { + fn record_str(&mut self, field: &Field, value: &str) { + if self.result.is_err() { + return; + } + + if field.name() == "message" { + self.record_debug(field, &format_args!("{}", value)) + } else { + self.record_debug(field, &value) + } + } + + fn record_error(&mut self, field: &Field, value: &(dyn std::error::Error + 'static)) { + if let Some(source) = value.source() { + let italic = self.italic(); + self.record_debug( + field, + &format_args!( + "{} {}{}{}{}", + value, + italic.paint(field.name()), + italic.paint(".sources"), + self.dimmed().paint("="), + ErrorSourceList(source) + ), + ) + } else { + self.record_debug(field, &format_args!("{}", value)) + } + } + + fn record_debug(&mut self, field: &Field, value: &dyn fmt::Debug) { + self.log_debug(field.name(), value) + } +} + +impl<'a> VisitOutput for DefaultVisitor<'a> { + fn finish(self) -> fmt::Result { + self.result + } +} + +impl<'a> VisitFmt for DefaultVisitor<'a> { + fn writer(&mut self) -> &mut dyn fmt::Write { + &mut self.writer + } +} + +/// Renders an error into a list of sources, *including* the error +struct ErrorSourceList<'a>(&'a (dyn std::error::Error + 'static)); + +impl<'a> std::fmt::Display for ErrorSourceList<'a> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut list = f.debug_list(); + let mut curr = Some(self.0); + while let Some(curr_err) = curr { + list.entry(&format_args!("{}", curr_err)); + curr = curr_err.source(); + } + list.finish() + } +} diff --git a/apollo-router/src/plugins/telemetry/mod.rs b/apollo-router/src/plugins/telemetry/mod.rs index 8c4e4da8c7..5d9a3a6007 100644 --- a/apollo-router/src/plugins/telemetry/mod.rs +++ b/apollo-router/src/plugins/telemetry/mod.rs @@ -48,7 +48,6 @@ use tokio::runtime::Handle; use tower::BoxError; use tower::ServiceBuilder; use tower::ServiceExt; -use tracing_opentelemetry::OpenTelemetrySpanExt; use self::apollo::ForwardValues; use self::apollo::LicensedOperationCountByType; @@ -60,10 +59,12 @@ use self::config::Conf; use self::config::Sampler; use self::config::SamplerOption; use self::config::TraceIdFormat; +use self::config_new::events::RouterEvents; +use self::config_new::events::SubgraphEvents; +use self::config_new::events::SupergraphEvents; use self::config_new::instruments::Instrumented; use self::config_new::instruments::RouterInstruments; use self::config_new::instruments::SubgraphInstruments; -use self::config_new::instruments::SupergraphCustomInstruments; use self::config_new::spans::Spans; use self::metrics::apollo::studio::SingleTypeStat; use self::metrics::AttributesForwardConf; @@ -74,6 +75,7 @@ use self::tracing::apollo_telemetry::APOLLO_PRIVATE_DURATION_NS; use self::tracing::apollo_telemetry::CLIENT_NAME_KEY; use self::tracing::apollo_telemetry::CLIENT_VERSION_KEY; use crate::axum_factory::utils::REQUEST_SPAN_NAME; +use crate::context::CONTAINS_GRAPHQL_ERROR; use crate::context::OPERATION_KIND; use crate::context::OPERATION_NAME; use crate::layers::instrument::InstrumentLayer; @@ -89,7 +91,8 @@ use crate::plugins::telemetry::apollo_exporter::proto::reports::StatsContext; use crate::plugins::telemetry::config::AttributeValue; use crate::plugins::telemetry::config::MetricsCommon; use crate::plugins::telemetry::config::TracingCommon; -use crate::plugins::telemetry::dynamic_attribute::DynAttribute; +use crate::plugins::telemetry::config_new::instruments::SupergraphInstruments; +use crate::plugins::telemetry::dynamic_attribute::SpanDynAttribute; use crate::plugins::telemetry::fmt_layer::create_fmt_layer; use crate::plugins::telemetry::metrics::apollo::studio::SingleContextualizedStats; use crate::plugins::telemetry::metrics::apollo::studio::SinglePathErrorStats; @@ -99,6 +102,7 @@ use crate::plugins::telemetry::metrics::apollo::studio::SingleStatsReport; use crate::plugins::telemetry::metrics::prometheus::commit_prometheus; use crate::plugins::telemetry::metrics::MetricsBuilder; use crate::plugins::telemetry::metrics::MetricsConfigurator; +use crate::plugins::telemetry::otel::OpenTelemetrySpanExt; use crate::plugins::telemetry::reload::metrics_layer; use crate::plugins::telemetry::reload::OPENTELEMETRY_TRACER_HANDLE; use crate::plugins::telemetry::tracing::apollo_telemetry::decode_ftv1_trace; @@ -126,13 +130,15 @@ use crate::ListenAddr; pub(crate) mod apollo; pub(crate) mod apollo_exporter; pub(crate) mod config; -mod config_new; +pub(crate) mod config_new; pub(crate) mod dynamic_attribute; mod endpoint; mod fmt_layer; pub(crate) mod formatters; mod logging; pub(crate) mod metrics; +/// Opentelemetry utils +pub(crate) mod otel; mod otlp; pub(crate) mod reload; mod resource; @@ -331,7 +337,7 @@ impl Plugin for Telemetry { if !use_legacy_request_span { let span = Span::current(); - span.set_dyn_attribute( + span.set_span_dyn_attribute( HTTP_REQUEST_METHOD, request.router_request.method().to_string().into(), ); @@ -381,15 +387,21 @@ impl Plugin for Telemetry { .new_router_instruments(); custom_instruments.on_request(request); + let custom_events: RouterEvents = + config_request.instrumentation.events.new_router_events(); + custom_events.on_request(request); + ( custom_attributes, custom_instruments, + custom_events, request.context.clone(), ) }, - move |(custom_attributes, custom_instruments, ctx): ( + move |(custom_attributes, custom_instruments, custom_events, ctx): ( Vec, RouterInstruments, + RouterEvents, Context, ), fut| { @@ -401,7 +413,7 @@ impl Plugin for Telemetry { async move { let span = Span::current(); - span.set_dyn_attributes(custom_attributes); + span.set_span_dyn_attributes(custom_attributes); let response: Result = fut.await; span.record( @@ -411,7 +423,7 @@ impl Plugin for Telemetry { let expose_trace_id = &config.exporters.tracing.response_trace_id; if let Ok(response) = &response { - span.set_dyn_attributes( + span.set_span_dyn_attributes( config .instrumentation .spans @@ -420,6 +432,7 @@ impl Plugin for Telemetry { .on_response(response), ); custom_instruments.on_response(response); + custom_events.on_response(response); if expose_trace_id.enabled { let header_name = expose_trace_id @@ -472,10 +485,11 @@ impl Plugin for Telemetry { } } else if let Err(err) = &response { span.record(OTEL_STATUS_CODE, OTEL_STATUS_CODE_ERROR); - span.set_dyn_attributes( + span.set_span_dyn_attributes( config.instrumentation.spans.router.attributes.on_error(err), ); custom_instruments.on_error(err, &ctx); + custom_events.on_error(err, &ctx); } response @@ -559,30 +573,36 @@ impl Plugin for Telemetry { move |req: &SupergraphRequest| { let custom_attributes = config.instrumentation.spans.supergraph.attributes.on_request(req); Self::populate_context(config.clone(), field_level_instrumentation_ratio, req); - let custom_instruments = SupergraphCustomInstruments::new( - &config.instrumentation.instruments.supergraph.custom, - ); + let custom_instruments = config + .instrumentation + .instruments + .new_supergraph_instruments(); custom_instruments.on_request(req); - (req.context.clone(), custom_instruments, custom_attributes) + let supergraph_events = config.instrumentation.events.new_supergraph_events(); + supergraph_events.on_request(req); + + (req.context.clone(), custom_instruments, custom_attributes, supergraph_events) }, - move |(ctx, custom_instruments, custom_attributes): (Context, SupergraphCustomInstruments, Vec), fut| { + move |(ctx, custom_instruments, custom_attributes, supergraph_events): (Context, SupergraphInstruments, Vec, SupergraphEvents), fut| { let config = config_map_res.clone(); let sender = metrics_sender.clone(); let start = Instant::now(); async move { let span = Span::current(); - span.set_dyn_attributes(custom_attributes); + span.set_span_dyn_attributes(custom_attributes); let mut result: Result = fut.await; match &result { Ok(resp) => { - span.set_dyn_attributes(config.instrumentation.spans.supergraph.attributes.on_response(resp)); + span.set_span_dyn_attributes(config.instrumentation.spans.supergraph.attributes.on_response(resp)); custom_instruments.on_response(resp); + supergraph_events.on_response(resp); }, Err(err) => { - span.set_dyn_attributes(config.instrumentation.spans.supergraph.attributes.on_error(err)); + span.set_span_dyn_attributes(config.instrumentation.spans.supergraph.attributes.on_error(err)); custom_instruments.on_error(err, &ctx); + supergraph_events.on_error(err, &ctx); }, } result = Self::update_otel_metrics( @@ -659,17 +679,21 @@ impl Plugin for Telemetry { .instruments .new_subgraph_instruments(); custom_instruments.on_request(sub_request); + let custom_events = config.instrumentation.events.new_subgraph_events(); + custom_events.on_request(sub_request); ( sub_request.context.clone(), custom_instruments, custom_attributes, + custom_events, ) }, - move |(context, custom_instruments, custom_attributes): ( + move |(context, custom_instruments, custom_attributes, custom_events): ( Context, SubgraphInstruments, Vec, + SubgraphEvents, ), f: BoxFuture<'static, Result>| { let subgraph_attribute = subgraph_attribute.clone(); @@ -679,7 +703,7 @@ impl Plugin for Telemetry { let now = Instant::now(); async move { let span = Span::current(); - span.set_dyn_attributes(custom_attributes); + span.set_span_dyn_attributes(custom_attributes); let result: Result = f.await; match &result { @@ -689,7 +713,7 @@ impl Plugin for Telemetry { } else { span.record(OTEL_STATUS_CODE, OTEL_STATUS_CODE_OK); } - span.set_dyn_attributes( + span.set_span_dyn_attributes( conf.instrumentation .spans .subgraph @@ -697,14 +721,16 @@ impl Plugin for Telemetry { .on_response(resp), ); custom_instruments.on_response(resp); + custom_events.on_response(resp); } Err(err) => { span.record(OTEL_STATUS_CODE, OTEL_STATUS_CODE_ERROR); - span.set_dyn_attributes( + span.set_span_dyn_attributes( conf.instrumentation.spans.subgraph.attributes.on_error(err), ); custom_instruments.on_error(err, &context); + custom_events.on_error(err, &context); } } @@ -1234,6 +1260,11 @@ impl Telemetry { .enumerate() .map(move |(idx, response)| { let has_errors = !response.errors.is_empty(); + // Useful for selector in spans/instruments/events + ctx.insert_json_value( + CONTAINS_GRAPHQL_ERROR, + serde_json_bytes::Value::Bool(has_errors), + ); if !matches!(sender, Sender::Noop) { if operation_kind == OperationKind::Subscription { diff --git a/apollo-router/src/plugins/telemetry/otel/layer.rs b/apollo-router/src/plugins/telemetry/otel/layer.rs new file mode 100644 index 0000000000..725a25d22b --- /dev/null +++ b/apollo-router/src/plugins/telemetry/otel/layer.rs @@ -0,0 +1,1355 @@ +use std::any::TypeId; +use std::fmt; +use std::marker; +use std::thread; +use std::time::Instant; +use std::time::SystemTime; + +use once_cell::unsync; +use opentelemetry::trace::noop; +use opentelemetry::trace::OrderMap; +use opentelemetry::trace::TraceContextExt; +use opentelemetry::trace::{self as otel}; +use opentelemetry::Context as OtelContext; +use opentelemetry::Key; +use opentelemetry::KeyValue; +use opentelemetry::StringValue; +use opentelemetry::Value; +use tracing_core::field; +use tracing_core::span; +use tracing_core::span::Attributes; +use tracing_core::span::Id; +use tracing_core::span::Record; +use tracing_core::Event; +use tracing_core::Subscriber; +use tracing_subscriber::layer::Context; +use tracing_subscriber::registry::LookupSpan; +use tracing_subscriber::Layer; + +use super::OtelData; +use super::PreSampledTracer; + +const SPAN_NAME_FIELD: &str = "otel.name"; +const SPAN_KIND_FIELD: &str = "otel.kind"; +const SPAN_STATUS_CODE_FIELD: &str = "otel.status_code"; +const SPAN_STATUS_MESSAGE_FIELD: &str = "otel.status_message"; + +const FIELD_EXCEPTION_MESSAGE: &str = "exception.message"; +const FIELD_EXCEPTION_STACKTRACE: &str = "exception.stacktrace"; + +/// An [OpenTelemetry] propagation layer for use in a project that uses +/// [tracing]. +/// +/// [OpenTelemetry]: https://opentelemetry.io +/// [tracing]: https://github.com/tokio-rs/tracing +pub(crate) struct OpenTelemetryLayer { + tracer: T, + location: bool, + tracked_inactivity: bool, + with_threads: bool, + exception_config: ExceptionFieldConfig, + get_context: WithContext, + _registry: marker::PhantomData, +} + +impl Default for OpenTelemetryLayer +where + S: Subscriber + for<'span> LookupSpan<'span>, +{ + fn default() -> Self { + OpenTelemetryLayer::new(noop::NoopTracer::new()) + } +} + +/// Construct a layer to track spans via [OpenTelemetry]. +/// +/// [OpenTelemetry]: https://opentelemetry.io +/// +/// # Examples +/// +/// ```rust,no_run +/// use tracing_subscriber::layer::SubscriberExt; +/// use tracing_subscriber::Registry; +/// +/// // Use the tracing subscriber `Registry`, or any other subscriber +/// // that impls `LookupSpan` +/// let subscriber = Registry::default().with(tracing_opentelemetry::layer()); +/// # drop(subscriber); +/// ``` +pub(crate) fn layer() -> OpenTelemetryLayer +where + S: Subscriber + for<'span> LookupSpan<'span>, +{ + OpenTelemetryLayer::default() +} + +// this function "remembers" the types of the subscriber so that we +// can downcast to something aware of them without knowing those +// types at the callsite. +// +// See https://github.com/tokio-rs/tracing/blob/4dad420ee1d4607bad79270c1520673fa6266a3d/tracing-error/src/layer.rs +pub(crate) struct WithContext( + #[allow(clippy::type_complexity)] + fn(&tracing::Dispatch, &span::Id, f: &mut dyn FnMut(&mut OtelData, &dyn PreSampledTracer)), +); + +impl WithContext { + // This function allows a function to be called in the context of the + // "remembered" subscriber. + pub(crate) fn with_context( + &self, + dispatch: &tracing::Dispatch, + id: &span::Id, + mut f: impl FnMut(&mut OtelData, &dyn PreSampledTracer), + ) { + (self.0)(dispatch, id, &mut f) + } +} + +fn str_to_span_kind(s: &str) -> Option { + match s { + s if s.eq_ignore_ascii_case("server") => Some(otel::SpanKind::Server), + s if s.eq_ignore_ascii_case("client") => Some(otel::SpanKind::Client), + s if s.eq_ignore_ascii_case("producer") => Some(otel::SpanKind::Producer), + s if s.eq_ignore_ascii_case("consumer") => Some(otel::SpanKind::Consumer), + s if s.eq_ignore_ascii_case("internal") => Some(otel::SpanKind::Internal), + _ => None, + } +} + +fn str_to_status(s: &str) -> otel::Status { + match s { + s if s.eq_ignore_ascii_case("ok") => otel::Status::Ok, + s if s.eq_ignore_ascii_case("error") => otel::Status::error(""), + _ => otel::Status::Unset, + } +} + +struct SpanEventVisitor<'a, 'b> { + event_builder: &'a mut otel::Event, + span_builder: Option<&'b mut otel::SpanBuilder>, + exception_config: ExceptionFieldConfig, + custom_event: bool, +} + +impl<'a, 'b> field::Visit for SpanEventVisitor<'a, 'b> { + /// Record events on the underlying OpenTelemetry [`Span`] from `bool` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_bool(&mut self, field: &field::Field, value: bool) { + match field.name() { + "message" => self.event_builder.name = value.to_string().into(), + name => { + self.event_builder + .attributes + .push(KeyValue::new(name, value)); + } + } + } + + /// Record events on the underlying OpenTelemetry [`Span`] from `f64` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_f64(&mut self, field: &field::Field, value: f64) { + match field.name() { + "message" => self.event_builder.name = value.to_string().into(), + name => { + self.event_builder + .attributes + .push(KeyValue::new(name, value)); + } + } + } + + /// Record events on the underlying OpenTelemetry [`Span`] from `i64` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_i64(&mut self, field: &field::Field, value: i64) { + match field.name() { + "message" => self.event_builder.name = value.to_string().into(), + name => { + self.event_builder + .attributes + .push(KeyValue::new(name, value)); + } + } + } + + /// Record events on the underlying OpenTelemetry [`Span`] from `&str` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_str(&mut self, field: &field::Field, value: &str) { + match field.name() { + "message" => self.event_builder.name = value.to_string().into(), + name => { + if name == "kind" { + self.custom_event = true; + } + self.event_builder + .attributes + .push(KeyValue::new(name, value.to_string())); + } + } + } + + /// Record events on the underlying OpenTelemetry [`Span`] from values that + /// implement Debug. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_debug(&mut self, field: &field::Field, value: &dyn fmt::Debug) { + match field.name() { + "message" => self.event_builder.name = format!("{:?}", value).into(), + name => { + if name == "kind" { + self.custom_event = true; + } + self.event_builder + .attributes + .push(KeyValue::new(name, format!("{:?}", value))); + } + } + } + + /// Set attributes on the underlying OpenTelemetry [`Span`] using a [`std::error::Error`]'s + /// [`std::fmt::Display`] implementation. Also adds the `source` chain as an extra field + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_error( + &mut self, + field: &tracing_core::Field, + value: &(dyn std::error::Error + 'static), + ) { + let mut chain: Vec = Vec::new(); + let mut next_err = value.source(); + + while let Some(err) = next_err { + chain.push(err.to_string().into()); + next_err = err.source(); + } + + let error_msg = value.to_string(); + + if self.exception_config.record { + self.event_builder + .attributes + .push(Key::new(FIELD_EXCEPTION_MESSAGE).string(error_msg.clone())); + + // NOTE: This is actually not the stacktrace of the exception. This is + // the "source chain". It represents the heirarchy of errors from the + // app level to the lowest level such as IO. It does not represent all + // of the callsites in the code that led to the error happening. + // `std::error::Error::backtrace` is a nightly-only API and cannot be + // used here until the feature is stabilized. + self.event_builder + .attributes + .push(Key::new(FIELD_EXCEPTION_STACKTRACE).array(chain.clone())); + } + + if self.exception_config.propagate { + if let Some(span) = &mut self.span_builder { + if let Some(attrs) = span.attributes.as_mut() { + attrs.insert( + Key::new(FIELD_EXCEPTION_MESSAGE), + Value::String(error_msg.clone().into()), + ); + + // NOTE: This is actually not the stacktrace of the exception. This is + // the "source chain". It represents the heirarchy of errors from the + // app level to the lowest level such as IO. It does not represent all + // of the callsites in the code that led to the error happening. + // `std::error::Error::backtrace` is a nightly-only API and cannot be + // used here until the feature is stabilized. + attrs.insert( + Key::new(FIELD_EXCEPTION_STACKTRACE), + Value::Array(chain.clone().into()), + ); + } + } + } + + self.event_builder + .attributes + .push(Key::new(field.name()).string(error_msg)); + self.event_builder + .attributes + .push(Key::new(format!("{}.chain", field.name())).array(chain)); + } +} + +/// Control over opentelemetry conventional exception fields +#[derive(Clone, Copy)] +struct ExceptionFieldConfig { + /// If an error value is recorded on an event/span, should the otel fields + /// be added + record: bool, + + /// If an error value is recorded on an event, should the otel fields be + /// added to the corresponding span + propagate: bool, +} + +struct SpanAttributeVisitor<'a> { + span_builder: &'a mut otel::SpanBuilder, + exception_config: ExceptionFieldConfig, +} + +impl<'a> SpanAttributeVisitor<'a> { + fn record(&mut self, attribute: KeyValue) { + debug_assert!(self.span_builder.attributes.is_some()); + if let Some(v) = self.span_builder.attributes.as_mut() { + v.insert(attribute.key, attribute.value); + } + } +} + +impl<'a> field::Visit for SpanAttributeVisitor<'a> { + /// Set attributes on the underlying OpenTelemetry [`Span`] from `bool` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_bool(&mut self, field: &field::Field, value: bool) { + self.record(KeyValue::new(field.name(), value)); + } + + /// Set attributes on the underlying OpenTelemetry [`Span`] from `f64` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_f64(&mut self, field: &field::Field, value: f64) { + self.record(KeyValue::new(field.name(), value)); + } + + /// Set attributes on the underlying OpenTelemetry [`Span`] from `i64` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_i64(&mut self, field: &field::Field, value: i64) { + self.record(KeyValue::new(field.name(), value)); + } + + /// Set attributes on the underlying OpenTelemetry [`Span`] from `&str` values. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_str(&mut self, field: &field::Field, value: &str) { + match field.name() { + SPAN_NAME_FIELD => self.span_builder.name = value.to_string().into(), + SPAN_KIND_FIELD => self.span_builder.span_kind = str_to_span_kind(value), + SPAN_STATUS_CODE_FIELD => self.span_builder.status = str_to_status(value), + SPAN_STATUS_MESSAGE_FIELD => { + self.span_builder.status = otel::Status::error(value.to_string()) + } + _ => self.record(KeyValue::new(field.name(), value.to_string())), + } + } + + /// Set attributes on the underlying OpenTelemetry [`Span`] from values that + /// implement Debug. + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_debug(&mut self, field: &field::Field, value: &dyn fmt::Debug) { + match field.name() { + SPAN_NAME_FIELD => self.span_builder.name = format!("{:?}", value).into(), + SPAN_KIND_FIELD => { + self.span_builder.span_kind = str_to_span_kind(&format!("{:?}", value)) + } + SPAN_STATUS_CODE_FIELD => { + self.span_builder.status = str_to_status(&format!("{:?}", value)) + } + SPAN_STATUS_MESSAGE_FIELD => { + self.span_builder.status = otel::Status::error(format!("{:?}", value)) + } + _ => self.record(Key::new(field.name()).string(format!("{:?}", value))), + } + } + + /// Set attributes on the underlying OpenTelemetry [`Span`] using a [`std::error::Error`]'s + /// [`std::fmt::Display`] implementation. Also adds the `source` chain as an extra field + /// + /// [`Span`]: opentelemetry::trace::Span + fn record_error( + &mut self, + field: &tracing_core::Field, + value: &(dyn std::error::Error + 'static), + ) { + let mut chain: Vec = Vec::new(); + let mut next_err = value.source(); + + while let Some(err) = next_err { + chain.push(err.to_string().into()); + next_err = err.source(); + } + + let error_msg = value.to_string(); + + if self.exception_config.record { + self.record(Key::new(FIELD_EXCEPTION_MESSAGE).string(error_msg.clone())); + + // NOTE: This is actually not the stacktrace of the exception. This is + // the "source chain". It represents the heirarchy of errors from the + // app level to the lowest level such as IO. It does not represent all + // of the callsites in the code that led to the error happening. + // `std::error::Error::backtrace` is a nightly-only API and cannot be + // used here until the feature is stabilized. + self.record(Key::new(FIELD_EXCEPTION_STACKTRACE).array(chain.clone())); + } + + self.record(Key::new(field.name()).string(error_msg)); + self.record(Key::new(format!("{}.chain", field.name())).array(chain)); + } +} + +impl OpenTelemetryLayer +where + S: Subscriber + for<'span> LookupSpan<'span>, + T: otel::Tracer + PreSampledTracer + 'static, +{ + /// Set the [`Tracer`] that this layer will use to produce and track + /// OpenTelemetry [`Span`]s. + /// + /// [`Tracer`]: opentelemetry::trace::Tracer + /// [`Span`]: opentelemetry::trace::Span + /// + /// # Examples + /// + /// ```no_run + /// use tracing_opentelemetry::OpenTelemetryLayer; + /// use tracing_subscriber::layer::SubscriberExt; + /// use tracing_subscriber::Registry; + /// + /// // Create a jaeger exporter pipeline for a `trace_demo` service. + /// let tracer = opentelemetry_jaeger::new_agent_pipeline() + /// .with_service_name("trace_demo") + /// .install_simple() + /// .expect("Error initializing Jaeger exporter"); + /// + /// // Create a layer with the configured tracer + /// let otel_layer = OpenTelemetryLayer::new(tracer); + /// + /// // Use the tracing subscriber `Registry`, or any other subscriber + /// // that impls `LookupSpan` + /// let subscriber = Registry::default().with(otel_layer); + /// # drop(subscriber); + /// ``` + pub(crate) fn new(tracer: T) -> Self { + OpenTelemetryLayer { + tracer, + location: true, + tracked_inactivity: true, + with_threads: true, + exception_config: ExceptionFieldConfig { + record: false, + propagate: false, + }, + get_context: WithContext(Self::get_context), + _registry: marker::PhantomData, + } + } + + /// Set the [`Tracer`] that this layer will use to produce and track + /// OpenTelemetry [`Span`]s. + /// + /// [`Tracer`]: opentelemetry::trace::Tracer + /// [`Span`]: opentelemetry::trace::Span + /// + /// # Examples + /// + /// ```no_run + /// use tracing_subscriber::layer::SubscriberExt; + /// use tracing_subscriber::Registry; + /// + /// // Create a jaeger exporter pipeline for a `trace_demo` service. + /// let tracer = opentelemetry_jaeger::new_agent_pipeline() + /// .with_service_name("trace_demo") + /// .install_simple() + /// .expect("Error initializing Jaeger exporter"); + /// + /// // Create a layer with the configured tracer + /// let otel_layer = tracing_opentelemetry::layer().with_tracer(tracer); + /// + /// // Use the tracing subscriber `Registry`, or any other subscriber + /// // that impls `LookupSpan` + /// let subscriber = Registry::default().with(otel_layer); + /// # drop(subscriber); + /// ``` + pub(crate) fn with_tracer(self, tracer: Tracer) -> OpenTelemetryLayer + where + Tracer: otel::Tracer + PreSampledTracer + 'static, + { + OpenTelemetryLayer { + tracer, + location: self.location, + tracked_inactivity: self.tracked_inactivity, + with_threads: self.with_threads, + exception_config: self.exception_config, + get_context: WithContext(OpenTelemetryLayer::::get_context), + _registry: self._registry, + } + } + + /// Sets whether or not span and event metadata should include OpenTelemetry + /// exception fields such as `exception.message` and `exception.backtrace` + /// when an `Error` value is recorded. If multiple error values are recorded + /// on the same span/event, only the most recently recorded error value will + /// show up under these fields. + /// + /// These attributes follow the [OpenTelemetry semantic conventions for + /// exceptions][conv]. + /// + /// By default, these attributes are not recorded. + /// + /// [conv]: https://github.com/open-telemetry/semantic-conventions/tree/main/docs/exceptions/ + #[allow(dead_code)] + pub(crate) fn with_exception_fields(self, exception_fields: bool) -> Self { + Self { + exception_config: ExceptionFieldConfig { + record: exception_fields, + ..self.exception_config + }, + ..self + } + } + + /// Sets whether or not reporting an `Error` value on an event will + /// propagate the OpenTelemetry exception fields such as `exception.message` + /// and `exception.backtrace` to the corresponding span. You do not need to + /// enable `with_exception_fields` in order to enable this. If multiple + /// error values are recorded on the same span/event, only the most recently + /// recorded error value will show up under these fields. + /// + /// These attributes follow the [OpenTelemetry semantic conventions for + /// exceptions][conv]. + /// + /// By default, these attributes are not propagated to the span. + /// + /// [conv]: https://github.com/open-telemetry/semantic-conventions/tree/main/docs/exceptions/ + #[allow(dead_code)] + pub(crate) fn with_exception_field_propagation( + self, + exception_field_propagation: bool, + ) -> Self { + Self { + exception_config: ExceptionFieldConfig { + propagate: exception_field_propagation, + ..self.exception_config + }, + ..self + } + } + + /// Sets whether or not spans metadata should include the _busy time_ + /// (total time for which it was entered), and _idle time_ (total time + /// the span existed but was not entered). + #[allow(dead_code)] + pub(crate) fn with_tracked_inactivity(self, tracked_inactivity: bool) -> Self { + Self { + tracked_inactivity, + ..self + } + } + + /// Sets whether or not spans record additional attributes for the thread + /// name and thread ID of the thread they were created on, following the + /// [OpenTelemetry semantic conventions for threads][conv]. + /// + /// By default, thread attributes are enabled. + /// + /// [conv]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/attributes.md#general-thread-attributes/ + #[allow(dead_code)] + pub(crate) fn with_threads(self, threads: bool) -> Self { + Self { + with_threads: threads, + ..self + } + } + + /// Retrieve the parent OpenTelemetry [`Context`] from the current tracing + /// [`span`] through the [`Registry`]. This [`Context`] links spans to their + /// parent for proper hierarchical visualization. + /// + /// [`Context`]: opentelemetry::Context + /// [`span`]: tracing::Span + /// [`Registry`]: tracing_subscriber::Registry + fn parent_context(&self, attrs: &Attributes<'_>, ctx: &Context<'_, S>) -> OtelContext { + // If a span is specified, it _should_ exist in the underlying `Registry`. + if let Some(parent) = attrs.parent() { + let span = ctx.span(parent).expect("Span not found, this is a bug"); + let mut extensions = span.extensions_mut(); + extensions + .get_mut::() + .map(|builder| self.tracer.sampled_context(builder)) + .unwrap_or_default() + // Else if the span is inferred from context, look up any available current span. + } else if attrs.is_contextual() { + ctx.lookup_current() + .and_then(|span| { + let mut extensions = span.extensions_mut(); + extensions + .get_mut::() + .map(|builder| self.tracer.sampled_context(builder)) + }) + .unwrap_or_else(OtelContext::current) + // Explicit root spans should have no parent context. + } else { + OtelContext::new() + } + } + + fn get_context( + dispatch: &tracing::Dispatch, + id: &span::Id, + f: &mut dyn FnMut(&mut OtelData, &dyn PreSampledTracer), + ) { + let subscriber = dispatch + .downcast_ref::() + .expect("subscriber should downcast to expected type; this is a bug!"); + let span = subscriber + .span(id) + .expect("registry should have a span for the current ID"); + let layer = dispatch + .downcast_ref::>() + .expect("layer should downcast to expected type; this is a bug!"); + + let mut extensions = span.extensions_mut(); + if let Some(builder) = extensions.get_mut::() { + f(builder, &layer.tracer); + } + } + + fn extra_span_attrs(&self) -> usize { + let mut extra_attrs = 0; + if self.location { + extra_attrs += 3; + } + if self.with_threads { + extra_attrs += 2; + } + extra_attrs + } +} + +thread_local! { + static THREAD_ID: unsync::Lazy = unsync::Lazy::new(|| { + // OpenTelemetry's semantic conventions require the thread ID to be + // recorded as an integer, but `std::thread::ThreadId` does not expose + // the integer value on stable, so we have to convert it to a `usize` by + // parsing it. Since this requires allocating a `String`, store it in a + // thread local so we only have to do this once. + // TODO(eliza): once `std::thread::ThreadId::as_u64` is stabilized + // (https://github.com/rust-lang/rust/issues/67939), just use that. + thread_id_integer(thread::current().id()) + }); +} + +impl Layer for OpenTelemetryLayer +where + S: Subscriber + for<'span> LookupSpan<'span>, + T: otel::Tracer + PreSampledTracer + 'static, +{ + /// Creates an [OpenTelemetry `Span`] for the corresponding [tracing `Span`]. + /// + /// [OpenTelemetry `Span`]: opentelemetry::trace::Span + /// [tracing `Span`]: tracing::Span + fn on_new_span(&self, attrs: &Attributes<'_>, id: &span::Id, ctx: Context<'_, S>) { + let span = ctx.span(id).expect("Span not found, this is a bug"); + let mut extensions = span.extensions_mut(); + + if self.tracked_inactivity && extensions.get_mut::().is_none() { + extensions.insert(Timings::new()); + } + + let parent_cx = self.parent_context(attrs, &ctx); + let mut builder = self + .tracer + .span_builder(attrs.metadata().name()) + .with_start_time(SystemTime::now()) + // Eagerly assign span id so children have stable parent id + .with_span_id(self.tracer.new_span_id()); + + // Record new trace id if there is no active parent span + if !parent_cx.has_active_span() { + builder.trace_id = Some(self.tracer.new_trace_id()); + } + + let builder_attrs = builder.attributes.get_or_insert(OrderMap::with_capacity( + attrs.fields().len() + self.extra_span_attrs(), + )); + + if self.location { + let meta = attrs.metadata(); + + if let Some(filename) = meta.file() { + builder_attrs.insert("code.filepath".into(), filename.into()); + } + + if let Some(module) = meta.module_path() { + builder_attrs.insert("code.namespace".into(), module.into()); + } + + if let Some(line) = meta.line() { + builder_attrs.insert("code.lineno".into(), (line as i64).into()); + } + } + + if self.with_threads { + THREAD_ID.with(|id| builder_attrs.insert("thread.id".into(), (**id as i64).into())); + if let Some(name) = std::thread::current().name() { + // TODO(eliza): it's a bummer that we have to allocate here, but + // we can't easily get the string as a `static`. it would be + // nice if `opentelemetry` could also take `Arc`s as + // `String` values... + builder_attrs.insert("thread.name".into(), name.to_owned().into()); + } + } + + attrs.record(&mut SpanAttributeVisitor { + span_builder: &mut builder, + exception_config: self.exception_config, + }); + extensions.insert(OtelData { + builder, + parent_cx, + event_attributes: None, + }); + } + + fn on_enter(&self, id: &span::Id, ctx: Context<'_, S>) { + if !self.tracked_inactivity { + return; + } + + let span = ctx.span(id).expect("Span not found, this is a bug"); + let mut extensions = span.extensions_mut(); + + if let Some(timings) = extensions.get_mut::() { + let now = Instant::now(); + timings.idle += (now - timings.last).as_nanos() as i64; + timings.last = now; + } + } + + fn on_exit(&self, id: &span::Id, ctx: Context<'_, S>) { + if !self.tracked_inactivity { + return; + } + + let span = ctx.span(id).expect("Span not found, this is a bug"); + let mut extensions = span.extensions_mut(); + + if let Some(timings) = extensions.get_mut::() { + let now = Instant::now(); + timings.busy += (now - timings.last).as_nanos() as i64; + timings.last = now; + } + } + + /// Record OpenTelemetry [`attributes`] for the given values. + /// + /// [`attributes`]: opentelemetry::trace::SpanBuilder::attributes + fn on_record(&self, id: &Id, values: &Record<'_>, ctx: Context<'_, S>) { + let span = ctx.span(id).expect("Span not found, this is a bug"); + let mut extensions = span.extensions_mut(); + if let Some(data) = extensions.get_mut::() { + values.record(&mut SpanAttributeVisitor { + span_builder: &mut data.builder, + exception_config: self.exception_config, + }); + } + } + + fn on_follows_from(&self, id: &Id, follows: &Id, ctx: Context) { + let span = ctx.span(id).expect("Span not found, this is a bug"); + let mut extensions = span.extensions_mut(); + let data = extensions + .get_mut::() + .expect("Missing otel data span extensions"); + + let follows_span = ctx + .span(follows) + .expect("Span to follow not found, this is a bug"); + let mut follows_extensions = follows_span.extensions_mut(); + let follows_data = follows_extensions + .get_mut::() + .expect("Missing otel data span extensions"); + + let follows_context = self + .tracer + .sampled_context(follows_data) + .span() + .span_context() + .clone(); + let follows_link = otel::Link::new(follows_context, Vec::new()); + if let Some(ref mut links) = data.builder.links { + links.push(follows_link); + } else { + data.builder.links = Some(vec![follows_link]); + } + } + + /// Records OpenTelemetry [`Event`] data on event. + /// + /// Note: an [`ERROR`]-level event will also set the OpenTelemetry span status code to + /// [`Error`], signaling that an error has occurred. + /// + /// [`Event`]: opentelemetry::trace::Event + /// [`ERROR`]: tracing::Level::ERROR + /// [`Error`]: opentelemetry::trace::StatusCode::Error + fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>) { + // Ignore events that are not in the context of a span + if let Some(span) = ctx.lookup_current() { + // Performing read operations before getting a write lock to avoid a deadlock + // See https://github.com/tokio-rs/tracing/issues/763 + let meta = event.metadata(); + let target = Key::new("target"); + + let target = target.string(meta.target()); + + let mut extensions = span.extensions_mut(); + let mut otel_data = extensions.get_mut::(); + let span_builder = otel_data.as_mut().map(|o| &mut o.builder); + + let mut otel_event = otel::Event::new( + String::new(), + SystemTime::now(), + vec![Key::new("level").string(meta.level().as_str()), target], + 0, + ); + let mut span_event_visit = SpanEventVisitor { + event_builder: &mut otel_event, + span_builder, + exception_config: self.exception_config, + custom_event: false, + }; + event.record(&mut span_event_visit); + let custom_event = span_event_visit.custom_event; + // Add custom event attributes for this event + if custom_event { + let event_attributes = otel_data.as_ref().and_then(|o| o.event_attributes.clone()); + + if let Some(event_attributes) = event_attributes { + otel_event.attributes.extend( + event_attributes + .into_iter() + .map(|(key, value)| KeyValue::new(key, value)), + ) + } + } + + if let Some(OtelData { builder, .. }) = extensions.get_mut::() { + if builder.status == otel::Status::Unset + && *meta.level() == tracing_core::Level::ERROR + { + builder.status = otel::Status::error("") + } + + if self.location { + let (file, module) = ( + event.metadata().file().map(Value::from), + event.metadata().module_path().map(Value::from), + ); + + if let Some(file) = file { + otel_event + .attributes + .push(KeyValue::new("code.filepath", file)); + } + if let Some(module) = module { + otel_event + .attributes + .push(KeyValue::new("code.namespace", module)); + } + if let Some(line) = meta.line() { + otel_event + .attributes + .push(KeyValue::new("code.lineno", line as i64)); + } + } + + if let Some(ref mut events) = builder.events { + events.push(otel_event); + } else { + builder.events = Some(vec![otel_event]); + } + } + }; + } + + /// Exports an OpenTelemetry [`Span`] on close. + /// + /// [`Span`]: opentelemetry::trace::Span + fn on_close(&self, id: span::Id, ctx: Context<'_, S>) { + let span = ctx.span(&id).expect("Span not found, this is a bug"); + let mut extensions = span.extensions_mut(); + + if let Some(OtelData { + mut builder, + parent_cx, + .. + }) = extensions.remove::() + { + if self.tracked_inactivity { + // Append busy/idle timings when enabled. + if let Some(timings) = extensions.get_mut::() { + let busy_ns = Key::new("busy_ns"); + let idle_ns = Key::new("idle_ns"); + + let attributes = builder + .attributes + .get_or_insert_with(|| OrderMap::with_capacity(2)); + attributes.insert(busy_ns, timings.busy.into()); + attributes.insert(idle_ns, timings.idle.into()); + } + } + + // Assign end time, build and start span, drop span to export + builder + .with_end_time(SystemTime::now()) + .start_with_context(&self.tracer, &parent_cx); + } + } + + // SAFETY: this is safe because the `WithContext` function pointer is valid + // for the lifetime of `&self`. + unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()> { + match id { + id if id == TypeId::of::() => Some(self as *const _ as *const ()), + id if id == TypeId::of::() => { + Some(&self.get_context as *const _ as *const ()) + } + _ => None, + } + } +} + +struct Timings { + idle: i64, + busy: i64, + last: Instant, +} + +impl Timings { + fn new() -> Self { + Self { + idle: 0, + busy: 0, + last: Instant::now(), + } + } +} + +fn thread_id_integer(id: thread::ThreadId) -> u64 { + let thread_id = format!("{:?}", id); + thread_id + .trim_start_matches("ThreadId(") + .trim_end_matches(')') + .parse::() + .expect("thread ID should parse as an integer") +} + +#[cfg(test)] +mod tests { + use std::borrow::Cow; + use std::collections::HashMap; + use std::error::Error; + use std::fmt::Display; + use std::sync::Arc; + use std::sync::Mutex; + use std::thread; + use std::time::SystemTime; + + use opentelemetry::trace::noop; + use opentelemetry::trace::TraceFlags; + use opentelemetry::StringValue; + use tracing_subscriber::prelude::*; + + use super::*; + + #[derive(Debug, Clone)] + struct TestTracer(Arc>>); + impl otel::Tracer for TestTracer { + type Span = noop::NoopSpan; + fn start_with_context(&self, _name: T, _context: &OtelContext) -> Self::Span + where + T: Into>, + { + noop::NoopSpan::new() + } + fn span_builder(&self, name: T) -> otel::SpanBuilder + where + T: Into>, + { + otel::SpanBuilder::from_name(name) + } + fn build_with_context( + &self, + builder: otel::SpanBuilder, + parent_cx: &OtelContext, + ) -> Self::Span { + *self.0.lock().unwrap() = Some(OtelData { + builder, + parent_cx: parent_cx.clone(), + event_attributes: None, + }); + noop::NoopSpan::new() + } + } + + impl PreSampledTracer for TestTracer { + fn sampled_context(&self, _builder: &mut super::OtelData) -> OtelContext { + OtelContext::new() + } + fn new_trace_id(&self) -> otel::TraceId { + otel::TraceId::INVALID + } + fn new_span_id(&self) -> otel::SpanId { + otel::SpanId::INVALID + } + } + + impl TestTracer { + fn with_data(&self, f: impl FnOnce(&OtelData) -> T) -> T { + let lock = self.0.lock().unwrap(); + let data = lock.as_ref().expect("no span data has been recorded yet"); + f(data) + } + } + + #[derive(Debug, Clone)] + struct TestSpan(otel::SpanContext); + impl otel::Span for TestSpan { + fn add_event_with_timestamp>>( + &mut self, + _: T, + _: SystemTime, + _: Vec, + ) { + } + fn span_context(&self) -> &otel::SpanContext { + &self.0 + } + fn is_recording(&self) -> bool { + false + } + fn set_attribute(&mut self, _attribute: KeyValue) {} + fn set_status(&mut self, _status: otel::Status) {} + fn update_name>>(&mut self, _new_name: T) {} + fn end_with_timestamp(&mut self, _timestamp: SystemTime) {} + } + + #[derive(Debug)] + struct TestDynError { + msg: &'static str, + source: Option>, + } + impl Display for TestDynError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.msg) + } + } + impl Error for TestDynError { + fn source(&self) -> Option<&(dyn Error + 'static)> { + match &self.source { + Some(source) => Some(source), + None => None, + } + } + } + impl TestDynError { + fn new(msg: &'static str) -> Self { + Self { msg, source: None } + } + fn with_parent(self, parent_msg: &'static str) -> Self { + Self { + msg: parent_msg, + source: Some(Box::new(self)), + } + } + } + + #[test] + fn dynamic_span_names() { + let dynamic_name = "GET http://example.com".to_string(); + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with(layer().with_tracer(tracer.clone())); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("static_name", otel.name = dynamic_name.as_str()); + }); + + let recorded_name = tracer + .0 + .lock() + .unwrap() + .as_ref() + .map(|b| b.builder.name.clone()); + assert_eq!(recorded_name, Some(dynamic_name.into())) + } + + #[test] + fn span_kind() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with(layer().with_tracer(tracer.clone())); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request", otel.kind = "server"); + }); + + let recorded_kind = tracer.with_data(|data| data.builder.span_kind.clone()); + assert_eq!(recorded_kind, Some(otel::SpanKind::Server)) + } + + #[test] + fn span_status_code() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with(layer().with_tracer(tracer.clone())); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request", otel.status_code = ?otel::Status::Ok); + }); + + let recorded_status = tracer.with_data(|data| data.builder.status.clone()); + assert_eq!(recorded_status, otel::Status::Ok) + } + + #[test] + fn span_status_message() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with(layer().with_tracer(tracer.clone())); + + let message = "message"; + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request", otel.status_message = message); + }); + + let recorded_status_message = tracer + .0 + .lock() + .unwrap() + .as_ref() + .unwrap() + .builder + .status + .clone(); + + assert_eq!(recorded_status_message, otel::Status::error(message)) + } + + #[test] + fn trace_id_from_existing_context() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with(layer().with_tracer(tracer.clone())); + let trace_id = otel::TraceId::from(42u128); + let existing_cx = OtelContext::current_with_span(TestSpan(otel::SpanContext::new( + trace_id, + otel::SpanId::from(1u64), + TraceFlags::default(), + false, + Default::default(), + ))); + let _g = existing_cx.attach(); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request", otel.kind = "server"); + }); + + let recorded_trace_id = + tracer.with_data(|data| data.parent_cx.span().span_context().trace_id()); + assert_eq!(recorded_trace_id, trace_id) + } + + #[test] + fn includes_timings() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with( + layer() + .with_tracer(tracer.clone()) + .with_tracked_inactivity(true), + ); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request"); + }); + + let attributes = tracer.with_data(|data| data.builder.attributes.as_ref().unwrap().clone()); + let keys = attributes + .iter() + .map(|(key, _)| key.as_str()) + .collect::>(); + assert!(keys.contains(&"idle_ns")); + assert!(keys.contains(&"busy_ns")); + } + + #[test] + fn records_error_fields() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with( + layer() + .with_tracer(tracer.clone()) + .with_exception_fields(true), + ); + + let err = TestDynError::new("base error") + .with_parent("intermediate error") + .with_parent("user error"); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!( + "request", + error = &err as &(dyn std::error::Error + 'static) + ); + }); + + let attributes = tracer + .0 + .lock() + .unwrap() + .as_ref() + .unwrap() + .builder + .attributes + .as_ref() + .unwrap() + .clone(); + + let key_values = attributes + .into_iter() + .map(|(key, value)| (key.as_str().to_owned(), value)) + .collect::>(); + + assert_eq!(key_values["error"].as_str(), "user error"); + assert_eq!( + key_values["error.chain"], + Value::Array( + vec![ + StringValue::from("intermediate error"), + StringValue::from("base error") + ] + .into() + ) + ); + + assert_eq!(key_values[FIELD_EXCEPTION_MESSAGE].as_str(), "user error"); + assert_eq!( + key_values[FIELD_EXCEPTION_STACKTRACE], + Value::Array( + vec![ + StringValue::from("intermediate error"), + StringValue::from("base error") + ] + .into() + ) + ); + } + + #[test] + fn includes_span_location() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with(layer().with_tracer(tracer.clone())); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request"); + }); + + let attributes = tracer.with_data(|data| data.builder.attributes.as_ref().unwrap().clone()); + let keys = attributes + .iter() + .map(|(key, _)| key.as_str()) + .collect::>(); + assert!(keys.contains(&"code.filepath")); + assert!(keys.contains(&"code.namespace")); + assert!(keys.contains(&"code.lineno")); + } + + #[test] + fn includes_thread() { + let thread = thread::current(); + let expected_name = thread + .name() + .map(|name| Value::String(name.to_owned().into())); + let expected_id = Value::I64(thread_id_integer(thread.id()) as i64); + + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry() + .with(layer().with_tracer(tracer.clone()).with_threads(true)); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request"); + }); + + let attributes = tracer + .with_data(|data| data.builder.attributes.as_ref().unwrap().clone()) + .drain(..) + .map(|(key, value)| (key.as_str().to_string(), value)) + .collect::>(); + assert_eq!(attributes.get("thread.name"), expected_name.as_ref()); + assert_eq!(attributes.get("thread.id"), Some(&expected_id)); + } + + #[test] + fn excludes_thread() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry() + .with(layer().with_tracer(tracer.clone()).with_threads(false)); + + tracing::subscriber::with_default(subscriber, || { + tracing::debug_span!("request"); + }); + + let attributes = tracer.with_data(|data| data.builder.attributes.as_ref().unwrap().clone()); + let keys = attributes + .iter() + .map(|(key, _)| key.as_str()) + .collect::>(); + assert!(!keys.contains(&"thread.name")); + assert!(!keys.contains(&"thread.id")); + } + + #[test] + fn propagates_error_fields_from_event_to_span() { + let tracer = TestTracer(Arc::new(Mutex::new(None))); + let subscriber = tracing_subscriber::registry().with( + layer() + .with_tracer(tracer.clone()) + .with_exception_field_propagation(true), + ); + + let err = TestDynError::new("base error") + .with_parent("intermediate error") + .with_parent("user error"); + + tracing::subscriber::with_default(subscriber, || { + let _guard = tracing::debug_span!("request",).entered(); + + tracing::error!( + error = &err as &(dyn std::error::Error + 'static), + "request error!" + ) + }); + + let attributes = tracer + .0 + .lock() + .unwrap() + .as_ref() + .unwrap() + .builder + .attributes + .as_ref() + .unwrap() + .clone(); + + let key_values = attributes + .into_iter() + .map(|(key, value)| (key.as_str().to_owned(), value)) + .collect::>(); + + assert_eq!(key_values[FIELD_EXCEPTION_MESSAGE].as_str(), "user error"); + assert_eq!( + key_values[FIELD_EXCEPTION_STACKTRACE], + Value::Array( + vec![ + StringValue::from("intermediate error"), + StringValue::from("base error") + ] + .into() + ) + ); + } +} diff --git a/apollo-router/src/plugins/telemetry/otel/mod.rs b/apollo-router/src/plugins/telemetry/otel/mod.rs new file mode 100644 index 0000000000..85ec219012 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/otel/mod.rs @@ -0,0 +1,29 @@ +/// Implementation of the trace::Layer as a source of OpenTelemetry data. +pub(crate) mod layer; +/// Span extension which enables OpenTelemetry context management. +pub(crate) mod span_ext; +/// Protocols for OpenTelemetry Tracers that are compatible with Tracing +pub(crate) mod tracer; + +pub(crate) use layer::layer; +pub(crate) use layer::OpenTelemetryLayer; +use opentelemetry::Key; +use opentelemetry::OrderMap; +use opentelemetry::Value; +pub(crate) use span_ext::OpenTelemetrySpanExt; +pub(crate) use tracer::PreSampledTracer; + +/// Per-span OpenTelemetry data tracked by this crate. +/// +/// Useful for implementing [PreSampledTracer] in alternate otel SDKs. +#[derive(Debug, Clone)] +pub(crate) struct OtelData { + /// The parent otel `Context` for the current tracing span. + pub(crate) parent_cx: opentelemetry::Context, + + /// The otel span data recorded during the current tracing span. + pub(crate) builder: opentelemetry::trace::SpanBuilder, + + /// Attributes gathered for the next event + pub(crate) event_attributes: Option>, +} diff --git a/apollo-router/src/plugins/telemetry/otel/span_ext.rs b/apollo-router/src/plugins/telemetry/otel/span_ext.rs new file mode 100644 index 0000000000..4474a8232c --- /dev/null +++ b/apollo-router/src/plugins/telemetry/otel/span_ext.rs @@ -0,0 +1,213 @@ +use opentelemetry::trace::SpanContext; +use opentelemetry::Context; +use opentelemetry::Key; +use opentelemetry::KeyValue; +use opentelemetry::Value; + +use super::layer::WithContext; +/// Utility functions to allow tracing [`Span`]s to accept and return +/// [OpenTelemetry] [`Context`]s. +/// +/// [`Span`]: tracing::Span +/// [OpenTelemetry]: https://opentelemetry.io +/// [`Context`]: opentelemetry::Context +pub(crate) trait OpenTelemetrySpanExt { + /// Associates `self` with a given OpenTelemetry trace, using the provided + /// parent [`Context`]. + /// + /// [`Context`]: opentelemetry::Context + /// + /// # Examples + /// + /// ```rust + /// use opentelemetry::{propagation::TextMapPropagator, trace::TraceContextExt}; + /// use opentelemetry_sdk::propagation::TraceContextPropagator; + /// use tracing_opentelemetry::OpenTelemetrySpanExt; + /// use std::collections::HashMap; + /// use tracing::Span; + /// + /// // Example carrier, could be a framework header map that impls otel's `Extractor`. + /// let mut carrier = HashMap::new(); + /// + /// // Propagator can be swapped with b3 propagator, jaeger propagator, etc. + /// let propagator = TraceContextPropagator::new(); + /// + /// // Extract otel parent context via the chosen propagator + /// let parent_context = propagator.extract(&carrier); + /// + /// // Generate a tracing span as usual + /// let app_root = tracing::span!(tracing::Level::INFO, "app_start"); + /// + /// // Assign parent trace from external context + /// app_root.set_parent(parent_context.clone()); + /// + /// // Or if the current span has been created elsewhere: + /// Span::current().set_parent(parent_context); + /// ``` + fn set_parent(&self, cx: Context); + + /// Associates `self` with a given OpenTelemetry trace, using the provided + /// followed span [`SpanContext`]. + /// + /// [`SpanContext`]: opentelemetry::trace::SpanContext + /// + /// # Examples + /// + /// ```rust + /// use opentelemetry::{propagation::TextMapPropagator, trace::TraceContextExt}; + /// use opentelemetry_sdk::propagation::TraceContextPropagator; + /// use tracing_opentelemetry::OpenTelemetrySpanExt; + /// use std::collections::HashMap; + /// use tracing::Span; + /// + /// // Example carrier, could be a framework header map that impls otel's `Extractor`. + /// let mut carrier = HashMap::new(); + /// + /// // Propagator can be swapped with b3 propagator, jaeger propagator, etc. + /// let propagator = TraceContextPropagator::new(); + /// + /// // Extract otel context of linked span via the chosen propagator + /// let linked_span_otel_context = propagator.extract(&carrier); + /// + /// // Extract the linked span context from the otel context + /// let linked_span_context = linked_span_otel_context.span().span_context().clone(); + /// + /// // Generate a tracing span as usual + /// let app_root = tracing::span!(tracing::Level::INFO, "app_start"); + /// + /// // Assign linked trace from external context + /// app_root.add_link(linked_span_context); + /// + /// // Or if the current span has been created elsewhere: + /// let linked_span_context = linked_span_otel_context.span().span_context().clone(); + /// Span::current().add_link(linked_span_context); + /// ``` + fn add_link(&self, cx: SpanContext); + + /// Associates `self` with a given OpenTelemetry trace, using the provided + /// followed span [`SpanContext`] and attributes. + /// + /// [`SpanContext`]: opentelemetry::trace::SpanContext + fn add_link_with_attributes(&self, cx: SpanContext, attributes: Vec); + + /// Extracts an OpenTelemetry [`Context`] from `self`. + /// + /// [`Context`]: opentelemetry::Context + /// + /// # Examples + /// + /// ```rust + /// use opentelemetry::Context; + /// use tracing_opentelemetry::OpenTelemetrySpanExt; + /// use tracing::Span; + /// + /// fn make_request(cx: Context) { + /// // perform external request after injecting context + /// // e.g. if the request's headers impl `opentelemetry::propagation::Injector` + /// // then `propagator.inject_context(cx, request.headers_mut())` + /// } + /// + /// // Generate a tracing span as usual + /// let app_root = tracing::span!(tracing::Level::INFO, "app_start"); + /// + /// // To include tracing context in client requests from _this_ app, + /// // extract the current OpenTelemetry context. + /// make_request(app_root.context()); + /// + /// // Or if the current span has been created elsewhere: + /// make_request(Span::current().context()) + /// ``` + fn context(&self) -> Context; + + /// Sets an OpenTelemetry attribute directly for this span, bypassing `tracing`. + /// If fields set here conflict with `tracing` fields, the `tracing` fields will supersede fields set with `set_attribute`. + /// This allows for more than 32 fields. + /// + /// # Examples + /// + /// ```rust + /// use opentelemetry::Context; + /// use tracing_opentelemetry::OpenTelemetrySpanExt; + /// use tracing::Span; + /// + /// // Generate a tracing span as usual + /// let app_root = tracing::span!(tracing::Level::INFO, "app_start"); + /// + /// // Set the `http.request.header.x_forwarded_for` attribute to `example`. + /// app_root.set_attribute("http.request.header.x_forwarded_for", "example"); + /// ``` + fn set_attribute(&self, key: impl Into, value: impl Into); +} + +impl OpenTelemetrySpanExt for tracing::Span { + fn set_parent(&self, cx: Context) { + let mut cx = Some(cx); + self.with_subscriber(move |(id, subscriber)| { + if let Some(get_context) = subscriber.downcast_ref::() { + get_context.with_context(subscriber, id, move |data, _tracer| { + if let Some(cx) = cx.take() { + data.parent_cx = cx; + } + }); + } + }); + } + + fn add_link(&self, cx: SpanContext) { + self.add_link_with_attributes(cx, Vec::new()) + } + + fn add_link_with_attributes(&self, cx: SpanContext, attributes: Vec) { + if cx.is_valid() { + let mut cx = Some(cx); + let mut att = Some(attributes); + self.with_subscriber(move |(id, subscriber)| { + if let Some(get_context) = subscriber.downcast_ref::() { + get_context.with_context(subscriber, id, move |data, _tracer| { + if let Some(cx) = cx.take() { + let attr = att.take().unwrap_or_default(); + let follows_link = opentelemetry::trace::Link::new(cx, attr); + data.builder + .links + .get_or_insert_with(|| Vec::with_capacity(1)) + .push(follows_link); + } + }); + } + }); + } + } + + fn context(&self) -> Context { + let mut cx = None; + self.with_subscriber(|(id, subscriber)| { + if let Some(get_context) = subscriber.downcast_ref::() { + get_context.with_context(subscriber, id, |builder, tracer| { + cx = Some(tracer.sampled_context(builder)); + }) + } + }); + + cx.unwrap_or_default() + } + + fn set_attribute(&self, key: impl Into, value: impl Into) { + self.with_subscriber(move |(id, subscriber)| { + if let Some(get_context) = subscriber.downcast_ref::() { + let mut key = Some(key.into()); + let mut value = Some(value.into()); + get_context.with_context(subscriber, id, move |builder, _| { + if builder.builder.attributes.is_none() { + builder.builder.attributes = Some(Default::default()); + } + builder + .builder + .attributes + .as_mut() + .unwrap() + .insert(key.take().unwrap(), value.take().unwrap()); + }) + } + }); + } +} diff --git a/apollo-router/src/plugins/telemetry/otel/tracer.rs b/apollo-router/src/plugins/telemetry/otel/tracer.rs new file mode 100644 index 0000000000..4a369568d3 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/otel/tracer.rs @@ -0,0 +1,253 @@ +use opentelemetry::trace as otel; +use opentelemetry::trace::noop; +use opentelemetry::trace::OrderMap; +use opentelemetry::trace::SamplingDecision; +use opentelemetry::trace::SamplingResult; +use opentelemetry::trace::SpanBuilder; +use opentelemetry::trace::SpanContext; +use opentelemetry::trace::SpanId; +use opentelemetry::trace::SpanKind; +use opentelemetry::trace::TraceContextExt; +use opentelemetry::trace::TraceFlags; +use opentelemetry::trace::TraceId; +use opentelemetry::trace::TraceState; +use opentelemetry::Context as OtelContext; +use opentelemetry_sdk::trace::Tracer as SdkTracer; +use opentelemetry_sdk::trace::TracerProvider as SdkTracerProvider; + +use super::OtelData; + +/// An interface for authors of OpenTelemetry SDKs to build pre-sampled tracers. +/// +/// The OpenTelemetry spec does not allow trace ids to be updated after a span +/// has been created. In order to associate extracted parent trace ids with +/// existing `tracing` spans, `tracing-opentelemetry` builds up otel span data +/// using a [`SpanBuilder`] instead, and creates / exports full otel spans only +/// when the associated `tracing` span is closed. However, in order to properly +/// inject otel [`Context`] information to downstream requests, the sampling +/// state must now be known _before_ the otel span has been created. +/// +/// The logic for coming to a sampling decision and creating an injectable span +/// context from a [`SpanBuilder`] is encapsulated in the +/// [`PreSampledTracer::sampled_context`] method and has been implemented +/// for the standard OpenTelemetry SDK, but this trait may be implemented by +/// authors of alternate OpenTelemetry SDK implementations if they wish to have +/// `tracing` compatibility. +/// +/// See the [`OpenTelemetrySpanExt::set_parent`] and +/// [`OpenTelemetrySpanExt::context`] methods for example usage. +/// +/// [`Tracer`]: opentelemetry::trace::Tracer +/// [`SpanBuilder`]: opentelemetry::trace::SpanBuilder +/// [`PreSampledTracer::sampled_span_context`]: crate::PreSampledTracer::sampled_span_context +/// [`OpenTelemetrySpanExt::set_parent`]: crate::OpenTelemetrySpanExt::set_parent +/// [`OpenTelemetrySpanExt::context`]: crate::OpenTelemetrySpanExt::context +/// [`Context`]: opentelemetry::Context +pub(crate) trait PreSampledTracer { + /// Produce an otel context containing an active and pre-sampled span for + /// the given span builder data. + /// + /// The sampling decision, span context information, and parent context + /// values must match the values recorded when the tracing span is closed. + fn sampled_context(&self, data: &mut OtelData) -> OtelContext; + + /// Generate a new trace id. + fn new_trace_id(&self) -> otel::TraceId; + + /// Generate a new span id. + fn new_span_id(&self) -> otel::SpanId; +} + +impl PreSampledTracer for noop::NoopTracer { + fn sampled_context(&self, data: &mut OtelData) -> OtelContext { + data.parent_cx.clone() + } + + fn new_trace_id(&self) -> otel::TraceId { + otel::TraceId::INVALID + } + + fn new_span_id(&self) -> otel::SpanId { + otel::SpanId::INVALID + } +} + +impl PreSampledTracer for SdkTracer { + fn sampled_context(&self, data: &mut OtelData) -> OtelContext { + // Ensure tracing pipeline is still installed. + if self.provider().is_none() { + return OtelContext::new(); + } + let provider = self.provider().unwrap(); + let parent_cx = &data.parent_cx; + let builder = &mut data.builder; + + // Gather trace state + let (trace_id, parent_trace_flags) = current_trace_state(builder, parent_cx, &provider); + + // Sample or defer to existing sampling decisions + let (flags, trace_state) = if let Some(result) = &builder.sampling_result { + process_sampling_result(result, parent_trace_flags) + } else { + builder.sampling_result = Some(provider.config().sampler.should_sample( + Some(parent_cx), + trace_id, + &builder.name, + builder.span_kind.as_ref().unwrap_or(&SpanKind::Internal), + builder.attributes.as_ref().unwrap_or(&OrderMap::default()), + builder.links.as_deref().unwrap_or(&[]), + )); + + process_sampling_result( + builder.sampling_result.as_ref().unwrap(), + parent_trace_flags, + ) + } + .unwrap_or_default(); + + let span_id = builder.span_id.unwrap_or(SpanId::INVALID); + let span_context = SpanContext::new(trace_id, span_id, flags, false, trace_state); + parent_cx.with_remote_span_context(span_context) + } + + fn new_trace_id(&self) -> otel::TraceId { + self.provider() + .map(|provider| provider.config().id_generator.new_trace_id()) + .unwrap_or(otel::TraceId::INVALID) + } + + fn new_span_id(&self) -> otel::SpanId { + self.provider() + .map(|provider| provider.config().id_generator.new_span_id()) + .unwrap_or(otel::SpanId::INVALID) + } +} + +fn current_trace_state( + builder: &SpanBuilder, + parent_cx: &OtelContext, + provider: &SdkTracerProvider, +) -> (TraceId, TraceFlags) { + if parent_cx.has_active_span() { + let span = parent_cx.span(); + let sc = span.span_context(); + (sc.trace_id(), sc.trace_flags()) + } else { + ( + builder + .trace_id + .unwrap_or_else(|| provider.config().id_generator.new_trace_id()), + Default::default(), + ) + } +} + +fn process_sampling_result( + sampling_result: &SamplingResult, + trace_flags: TraceFlags, +) -> Option<(TraceFlags, TraceState)> { + match sampling_result { + SamplingResult { + decision: SamplingDecision::Drop, + .. + } => None, + SamplingResult { + decision: SamplingDecision::RecordOnly, + trace_state, + .. + } => Some((trace_flags & !TraceFlags::SAMPLED, trace_state.clone())), + SamplingResult { + decision: SamplingDecision::RecordAndSample, + trace_state, + .. + } => Some((trace_flags | TraceFlags::SAMPLED, trace_state.clone())), + } +} + +#[cfg(test)] +mod tests { + use opentelemetry::trace::SpanBuilder; + use opentelemetry::trace::SpanId; + use opentelemetry::trace::TracerProvider as _; + use opentelemetry_sdk::trace::config; + use opentelemetry_sdk::trace::Sampler; + use opentelemetry_sdk::trace::TracerProvider; + + use super::*; + + #[test] + fn assigns_default_trace_id_if_missing() { + let provider = TracerProvider::default(); + let tracer = provider.tracer("test"); + let mut builder = SpanBuilder::from_name("empty".to_string()); + builder.span_id = Some(SpanId::from(1u64)); + builder.trace_id = None; + let parent_cx = OtelContext::new(); + let cx = tracer.sampled_context(&mut OtelData { + builder, + parent_cx, + event_attributes: None, + }); + let span = cx.span(); + let span_context = span.span_context(); + + assert!(span_context.is_valid()); + } + + #[rustfmt::skip] + fn sampler_data() -> Vec<(&'static str, Sampler, OtelContext, Option, bool)> { + vec![ + // No parent samples + ("empty_parent_cx_always_on", Sampler::AlwaysOn, OtelContext::new(), None, true), + ("empty_parent_cx_always_off", Sampler::AlwaysOff, OtelContext::new(), None, false), + + // Remote parent samples + ("remote_parent_cx_always_on", Sampler::AlwaysOn, OtelContext::new().with_remote_span_context(span_context(TraceFlags::SAMPLED, true)), None, true), + ("remote_parent_cx_always_off", Sampler::AlwaysOff, OtelContext::new().with_remote_span_context(span_context(TraceFlags::SAMPLED, true)), None, false), + ("sampled_remote_parent_cx_parent_based", Sampler::ParentBased(Box::new(Sampler::AlwaysOff)), OtelContext::new().with_remote_span_context(span_context(TraceFlags::SAMPLED, true)), None, true), + ("unsampled_remote_parent_cx_parent_based", Sampler::ParentBased(Box::new(Sampler::AlwaysOn)), OtelContext::new().with_remote_span_context(span_context(TraceFlags::default(), true)), None, false), + + // Existing sampling result defers + ("previous_drop_result_always_on", Sampler::AlwaysOn, OtelContext::new(), Some(SamplingResult { decision: SamplingDecision::Drop, attributes: vec![], trace_state: Default::default() }), false), + ("previous_record_and_sample_result_always_off", Sampler::AlwaysOff, OtelContext::new(), Some(SamplingResult { decision: SamplingDecision::RecordAndSample, attributes: vec![], trace_state: Default::default() }), true), + + // Existing local parent, defers + ("previous_drop_result_always_on", Sampler::AlwaysOn, OtelContext::new(), Some(SamplingResult { decision: SamplingDecision::Drop, attributes: vec![], trace_state: Default::default() }), false), + ("previous_record_and_sample_result_always_off", Sampler::AlwaysOff, OtelContext::new(), Some(SamplingResult { decision: SamplingDecision::RecordAndSample, attributes: vec![], trace_state: Default::default() }), true), + ] + } + + #[test] + fn sampled_context() { + for (name, sampler, parent_cx, previous_sampling_result, is_sampled) in sampler_data() { + let provider = TracerProvider::builder() + .with_config(config().with_sampler(sampler)) + .build(); + let tracer = provider.tracer("test"); + let mut builder = SpanBuilder::from_name("parent".to_string()); + builder.sampling_result = previous_sampling_result; + let sampled = tracer.sampled_context(&mut OtelData { + builder, + parent_cx, + event_attributes: None, + }); + + assert_eq!( + sampled.span().span_context().is_sampled(), + is_sampled, + "{}", + name + ) + } + } + + fn span_context(trace_flags: TraceFlags, is_remote: bool) -> SpanContext { + SpanContext::new( + TraceId::from(1u128), + SpanId::from(1u64), + trace_flags, + is_remote, + Default::default(), + ) + } +} diff --git a/apollo-router/src/plugins/telemetry/reload.rs b/apollo-router/src/plugins/telemetry/reload.rs index 58a8c39e0e..350dce62d5 100644 --- a/apollo-router/src/plugins/telemetry/reload.rs +++ b/apollo-router/src/plugins/telemetry/reload.rs @@ -16,8 +16,6 @@ use rand::thread_rng; use rand::Rng; use tower::BoxError; use tracing_core::Subscriber; -use tracing_opentelemetry::OpenTelemetryLayer; -use tracing_opentelemetry::PreSampledTracer; use tracing_subscriber::filter::Filtered; use tracing_subscriber::fmt::FormatFields; use tracing_subscriber::layer::Filter; @@ -33,7 +31,7 @@ use tracing_subscriber::Registry; use super::config::SamplerOption; use super::config_new::logging::RateLimit; -use super::dynamic_attribute::DynAttributeLayer; +use super::dynamic_attribute::DynSpanAttributeLayer; use super::fmt_layer::FmtLayer; use super::formatters::json::Json; use super::metrics::span_metrics_exporter::SpanMetricsLayer; @@ -44,10 +42,14 @@ use crate::metrics::meter_provider; use crate::plugins::telemetry::formatters::filter_metric_events; use crate::plugins::telemetry::formatters::text::Text; use crate::plugins::telemetry::formatters::FilteringFormatter; +use crate::plugins::telemetry::otel; +use crate::plugins::telemetry::otel::OpenTelemetryLayer; +use crate::plugins::telemetry::otel::PreSampledTracer; use crate::plugins::telemetry::tracing::reload::ReloadTracer; use crate::router_factory::STARTING_SPAN_NAME; -pub(crate) type LayeredRegistry = Layered>; +pub(crate) type LayeredRegistry = + Layered>; pub(super) type LayeredTracer = Layered< Filtered< @@ -84,7 +86,7 @@ pub(crate) fn init_telemetry(log_level: &str) -> Result<()> { None, ), ); - let opentelemetry_layer = tracing_opentelemetry::layer() + let opentelemetry_layer = otel::layer() .with_tracer(hot_tracer.clone()) .with_filter(SamplingFilter::new()); @@ -116,7 +118,7 @@ pub(crate) fn init_telemetry(log_level: &str) -> Result<()> { // Env filter is separate because of https://github.com/tokio-rs/tracing/issues/1629 // the tracing registry is only created once tracing_subscriber::registry() - .with(DynAttributeLayer::new()) + .with(DynSpanAttributeLayer::new()) .with(SpanMetricsLayer::default()) .with(opentelemetry_layer) .with(fmt_layer) diff --git a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_with_custom_events.snap b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_with_custom_events.snap new file mode 100644 index 0000000000..9557356f67 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_with_custom_events.snap @@ -0,0 +1,6 @@ +--- +source: apollo-router/src/plugins/telemetry/fmt_layer.rs +expression: buff.to_string() +--- +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","http.response.body":"{\"foo\": \"bar\"}","http.response.body.size":"125","message":"my message","kind":"my_custom_event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"ERROR","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","message":"Hello from test","http.method":"GET","target":"apollo_router::plugins::telemetry::fmt_layer::tests"} diff --git a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_with_custom_events_with_instrumented.snap b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_with_custom_events_with_instrumented.snap new file mode 100644 index 0000000000..e45d69951a --- /dev/null +++ b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_with_custom_events_with_instrumented.snap @@ -0,0 +1,17 @@ +--- +source: apollo-router/src/plugins/telemetry/fmt_layer.rs +expression: buff.to_string() +--- +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","http.response.body":"{\"foo\": \"bar\"}","http.response.body.size":"125","message":"my message","kind":"my_custom_event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"ERROR","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","message":"Hello from test","http.method":"GET","target":"apollo_router::plugins::telemetry::fmt_layer::tests"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","http.request.body":"Body(Empty)","http.request.headers":"{\"content-length\": \"0\", \"custom-header\": \"val1\", \"x-log-request\": \"log\"}","http.request.method":"GET","http.request.uri":"http://example.com/","http.request.version":"HTTP/1.1","message":"","kind":"router.request","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","http.request.body.size":"0","message":"my event message","kind":"my.request_event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","http.response.body":"Body(Full(b\"{\\\"data\\\":{\\\"data\\\":\\\"res\\\"}}\"))","http.response.headers":"{\"content-length\": \"25\", \"custom-header\": \"val1\", \"x-log-request\": \"log\"}","http.response.status":"200 OK","http.response.version":"HTTP/1.1","message":"","kind":"router.response","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","http.response.body.size":"25","message":"my response event message","kind":"my.response_event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","http.request.body":"{\"query\":\"query { foo }\"}","http.request.headers":"{\"content-type\": \"application/json\", \"x-log-request\": \"log\"}","http.request.method":"POST","http.request.uri":"http://default/","http.request.version":"HTTP/1.1","message":"","kind":"supergraph.request","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","message":"my event message","kind":"my.request.event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"WARN","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","message":"my response event message","kind":"my.response_event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","message":"my event message","kind":"my.subgraph.request.event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"ERROR","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","my.custom.attribute":"[\"{\"id\":1234,\"name\":\"first_name\"}\",\"{\"id\":567,\"name\":\"second_name\"}\"]","response_status":"200","subgraph.name":"subgraph","message":"my response event message","kind":"my.subgraph.response.event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"INFO","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","message":"my event message","kind":"my.subgraph.request.event","target":"apollo_router::plugins::telemetry::config_new::events"} +{"timestamp":"[timestamp]","level":"ERROR","trace_id":"00000000000000000000000000000000","span_id":"0000000000000000","my.custom.attribute":"[[{\"id\":1234,\"name\":\"first_name\"},{\"id\":567,\"name\":\"second_name\"}],{\"foo\":\"bar\"}]","response_status":"200","subgraph.name":"subgraph_bis","message":"my response event message","kind":"my.subgraph.response.event","target":"apollo_router::plugins::telemetry::config_new::events"} diff --git a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes.snap b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes.snap index 171af540d6..d175c52858 100644 --- a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes.snap +++ b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes.snap @@ -2,5 +2,4 @@ source: apollo-router/src/plugins/telemetry/fmt_layer.rs expression: buff --- -[timestamp] INFO test{another=2,custom_dyn=test,first=one,}  Hello from test event_attr="foo" - +[timestamp] INFO test{another=2,custom_dyn=test,first=one,}  Hello from test event_attr="foo" diff --git a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes_nested_spans.snap b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes_nested_spans.snap index 83ee3a15d0..2827f39a47 100644 --- a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes_nested_spans.snap +++ b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes_nested_spans.snap @@ -2,6 +2,5 @@ source: apollo-router/src/plugins/telemetry/fmt_layer.rs expression: buff.to_string() --- -[timestamp] ERROR nested_test{graphql.operation.kind=Subscription,inner=-42,two=two,} test{another=2,custom_dyn=test,first=one,}  Hello from nested test http.method="GET" -[timestamp] INFO test{another=2,custom_dyn=test,first=one,}  Hello from test event_attr="foo" - +[timestamp] ERROR nested_test{graphql.operation.kind=Subscription,inner=-42,two=two,} test{another=2,custom_dyn=test,first=one,}  Hello from nested test http.method="GET" +[timestamp] INFO test{another=2,custom_dyn=test,first=one,}  Hello from test event_attr="foo" diff --git a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events.snap b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events.snap new file mode 100644 index 0000000000..4739acb547 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events.snap @@ -0,0 +1,6 @@ +--- +source: apollo-router/src/plugins/telemetry/fmt_layer.rs +expression: buff.to_string() +--- +[timestamp] INFO test{another=2,custom_dyn=test,first=one,first=one,} http.response.body="{\"foo\": \"bar\"}" http.response.body.size="125" my message kind=my_custom_event +[timestamp] ERROR test{another=2,custom_dyn=test,first=one,first=one,} Hello from test http.method="GET" diff --git a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events_with_instrumented.snap b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events_with_instrumented.snap new file mode 100644 index 0000000000..fe8c933416 --- /dev/null +++ b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events_with_instrumented.snap @@ -0,0 +1,17 @@ +--- +source: apollo-router/src/plugins/telemetry/fmt_layer.rs +expression: buff.to_string() +--- +[timestamp] INFO http.response.body="{\"foo\": \"bar\"}" http.response.body.size="125" my message kind=my_custom_event +[timestamp] ERROR Hello from test http.method="GET" +[timestamp] INFO http.request.body="Body(Empty)" http.request.headers="{\"content-length\": \"0\", \"custom-header\": \"val1\", \"x-log-request\": \"log\"}" http.request.method="GET" http.request.uri="http://example.com/" http.request.version="HTTP/1.1" kind=router.request +[timestamp] INFO http.request.body.size="0" my event message kind=my.request_event +[timestamp] INFO http.response.body="Body(Full(b\"{\\\"data\\\":{\\\"data\\\":\\\"res\\\"}}\"))" http.response.headers="{\"content-length\": \"25\", \"custom-header\": \"val1\", \"x-log-request\": \"log\"}" http.response.status="200 OK" http.response.version="HTTP/1.1" kind=router.response +[timestamp] INFO http.response.body.size="25" my response event message kind=my.response_event +[timestamp] INFO http.request.body="{\"query\":\"query { foo }\"}" http.request.headers="{\"content-type\": \"application/json\", \"x-log-request\": \"log\"}" http.request.method="POST" http.request.uri="http://default/" http.request.version="HTTP/1.1" kind=supergraph.request +[timestamp] INFO my event message kind=my.request.event +[timestamp] WARN my response event message kind=my.response_event +[timestamp] INFO my event message kind=my.subgraph.request.event +[timestamp] ERROR my.custom.attribute="[\"{\"id\":1234,\"name\":\"first_name\"}\",\"{\"id\":567,\"name\":\"second_name\"}\"]" response_status="200" subgraph.name="subgraph" my response event message kind=my.subgraph.response.event +[timestamp] INFO my event message kind=my.subgraph.request.event +[timestamp] ERROR my.custom.attribute="[[{\"id\":1234,\"name\":\"first_name\"},{\"id\":567,\"name\":\"second_name\"}],{\"foo\":\"bar\"}]" response_status="200" subgraph.name="subgraph_bis" my response event message kind=my.subgraph.response.event diff --git a/apollo-router/src/plugins/telemetry/testdata/config.router.yaml b/apollo-router/src/plugins/telemetry/testdata/config.router.yaml index 602416bb16..39bc874c65 100644 --- a/apollo-router/src/plugins/telemetry/testdata/config.router.yaml +++ b/apollo-router/src/plugins/telemetry/testdata/config.router.yaml @@ -1,4 +1,146 @@ telemetry: + instrumentation: + spans: + mode: spec_compliant + default_attribute_requirement_level: recommended + router: + attributes: + "custom_one": + request_header: host + supergraph: + attributes: + graphql.document: true + subgraph: + attributes: + subgraph.graphql.document: true + instruments: + router: + http.server.request.body.size: + attributes: + # Standard attributes + http.response.status_code: true + "my_attribute": + response_header: "content-type" + http.server.request.duration: + attributes: + # Standard attributes + http.response.status_code: true + http.request.method: true + # Custom attribute + "my_attribute": + response_header: "content-type" + my.request.duration: # The name of your custom instrument/metric + value: duration + type: counter + unit: s + description: "my description" + acme.request.size: # The name of your custom instrument/metric + value: + request_header: "content-length" + type: counter + unit: s + description: "my description" + + acme.request.length: # The name of your custom instrument/metric + value: + request_header: "content-length" + type: histogram + unit: s + description: "my description" + supergraph: + acme.graphql.requests: + value: unit + type: counter + unit: request + description: "supergraph requests" + attributes: + static: hello + graphql_operation_kind: + operation_kind: string + subgraph: + request_including_price1: + value: unit + type: counter + unit: request + description: "supergraph requests" + condition: + exists: + subgraph_response_data: "$.products[*].price1" + attributes: + subgraph.name: true + events: + router: + # Standard events + request: info + response: info + error: info + + # Custom events + my.request_event: + message: "my event message" + level: info + on: request + attributes: + http.request.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: info + on: response + attributes: + http.response.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - response_header: "x-log-request" + supergraph: + # Standard events + request: info + response: info + error: info + + # Custom events + my.request.event: + message: "my event message" + level: info + on: request + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: warn + on: response + condition: + eq: + - "log" + - response_header: "x-log-request" + subgraph: + # Standard events + request: info + response: warn + error: error + + # Custom events + my.request.event: + message: "my event message" + level: info + on: request + my.response.event: + message: "my response event message" + level: error + on: response + attributes: + subgraph.name: true + response_status: + subgraph_response_status: code exporters: tracing: common: diff --git a/apollo-router/src/plugins/telemetry/testdata/custom_events.router.yaml b/apollo-router/src/plugins/telemetry/testdata/custom_events.router.yaml new file mode 100644 index 0000000000..a8c0efa3fb --- /dev/null +++ b/apollo-router/src/plugins/telemetry/testdata/custom_events.router.yaml @@ -0,0 +1,81 @@ +telemetry: + apollo: + client_name_header: name_header + client_version_header: version_header + instrumentation: + events: + router: + # Standard events + request: info + response: info + error: info + + # Custom events + my.request_event: + message: "my event message" + level: info + on: request + attributes: + http.request.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: info + on: response + attributes: + http.response.body.size: true + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - response_header: "x-log-request" + supergraph: + # Standard events + request: info + response: info + error: info + + # Custom events + my.request.event: + message: "my event message" + level: info + on: request + # Only log when the x-log-request header is `log` + condition: + eq: + - "log" + - request_header: "x-log-request" + my.response_event: + message: "my response event message" + level: warn + on: response + condition: + eq: + - "log" + - response_header: "x-log-request" + subgraph: + # Standard events + request: info + response: warn + error: error + + # Custom events + my.request.event: + message: "my event message" + level: info + on: request + my.response.event: + message: "my response event message" + level: error + on: response + attributes: + subgraph.name: true + response_status: + subgraph_response_status: code + "my.custom.attribute": + subgraph_response_data: "$.*" + default: "missing" \ No newline at end of file diff --git a/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs b/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs index d30370badb..006dc58656 100644 --- a/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs +++ b/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs @@ -533,8 +533,8 @@ impl Exporter { .unwrap_or_default() .iter() .map(|d| DeferredNodeDepends { - id: d.id.clone(), - defer_label: d.defer_label.clone().unwrap_or_default(), + id: d.id.to_string(), + defer_label: "".to_owned(), }) .collect(), label: span diff --git a/apollo-router/src/plugins/telemetry/tracing/reload.rs b/apollo-router/src/plugins/telemetry/tracing/reload.rs index fcf7d1a395..c058ede1a6 100644 --- a/apollo-router/src/plugins/telemetry/tracing/reload.rs +++ b/apollo-router/src/plugins/telemetry/tracing/reload.rs @@ -4,7 +4,9 @@ use std::sync::RwLock; use opentelemetry::trace::SpanBuilder; use opentelemetry::trace::Tracer; -use tracing_opentelemetry::PreSampledTracer; + +use crate::plugins::telemetry::otel::OtelData; +use crate::plugins::telemetry::otel::PreSampledTracer; #[derive(Clone)] pub(crate) struct ReloadTracer { @@ -12,10 +14,7 @@ pub(crate) struct ReloadTracer { } impl PreSampledTracer for ReloadTracer { - fn sampled_context( - &self, - data: &mut tracing_opentelemetry::OtelData, - ) -> opentelemetry::Context { + fn sampled_context(&self, data: &mut OtelData) -> opentelemetry::Context { self.parent .read() .expect("parent tracer must be available") diff --git a/apollo-router/src/plugins/test.rs b/apollo-router/src/plugins/test.rs index 25955b1cb6..92b5e6b14a 100644 --- a/apollo-router/src/plugins/test.rs +++ b/apollo-router/src/plugins/test.rs @@ -1,4 +1,5 @@ use std::any::TypeId; +use std::ops::Deref; use std::str::FromStr; use std::sync::Arc; @@ -12,6 +13,7 @@ use crate::plugin::DynPlugin; use crate::plugin::Plugin; use crate::plugin::PluginInit; use crate::query_planner::BridgeQueryPlanner; +use crate::services::execution; use crate::services::http; use crate::services::router; use crate::services::subgraph; @@ -91,7 +93,7 @@ impl PluginTestHarness { .unwrap(); ( schema.to_string(), - planner.schema().definitions.clone(), + planner.schema().supergraph_schema().clone(), planner.subgraph_schemas(), ) } else { @@ -148,6 +150,20 @@ impl PluginTestHarness { self.plugin.supergraph_service(service).call(request).await } + #[allow(dead_code)] + pub(crate) async fn call_execution( + &self, + request: execution::Request, + response_fn: fn(execution::Request) -> execution::Response, + ) -> Result { + let service: execution::BoxService = execution::BoxService::new( + ServiceBuilder::new() + .service_fn(move |req: execution::Request| async move { Ok((response_fn)(req)) }), + ); + + self.plugin.execution_service(service).call(request).await + } + #[allow(dead_code)] pub(crate) async fn call_subgraph( &self, @@ -183,3 +199,17 @@ impl PluginTestHarness { .await } } + +impl Deref for PluginTestHarness +where + T: Plugin, +{ + type Target = T; + + fn deref(&self) -> &Self::Target { + self.plugin + .as_any() + .downcast_ref() + .expect("plugin should be of type T") + } +} diff --git a/apollo-router/src/query_planner/bridge_query_planner.rs b/apollo-router/src/query_planner/bridge_query_planner.rs index 62e7197e66..29de239fab 100644 --- a/apollo-router/src/query_planner/bridge_query_planner.rs +++ b/apollo-router/src/query_planner/bridge_query_planner.rs @@ -7,6 +7,8 @@ use std::sync::Arc; use apollo_compiler::ast; use apollo_compiler::validation::Valid; +use apollo_compiler::ExecutableDocument; +use apollo_federation::query_plan::query_planner::QueryPlanner; use futures::future::BoxFuture; use opentelemetry_api::metrics::MeterProvider as _; use opentelemetry_api::metrics::ObservableGauge; @@ -28,10 +30,13 @@ use super::QueryKey; use crate::apollo_studio_interop::generate_usage_reporting; use crate::apollo_studio_interop::UsageReportingComparisonResult; use crate::configuration::ApolloMetricsGenerationMode; +use crate::configuration::QueryPlannerMode; use crate::error::PlanErrors; use crate::error::QueryPlannerError; use crate::error::SchemaError; use crate::error::ServiceBuildError; +use crate::error::ValidationErrors; +use crate::executable::USING_CATCH_UNWIND; use crate::graphql; use crate::introspection::Introspection; use crate::json_ext::Object; @@ -42,6 +47,7 @@ use crate::plugins::authorization::CacheKeyMetadata; use crate::plugins::authorization::UnauthorizedPaths; use crate::plugins::progressive_override::LABELS_TO_OVERRIDE_KEY; use crate::query_planner::fetch::QueryHash; +use crate::query_planner::fetch::SubgraphSchemas; use crate::query_planner::labeler::add_defer_labels; use crate::services::layers::query_analysis::ParsedDocument; use crate::services::layers::query_analysis::ParsedDocumentInner; @@ -59,7 +65,7 @@ use crate::Configuration; /// /// No caching is performed. To cache, wrap in a [`CachingQueryPlanner`]. pub(crate) struct BridgeQueryPlanner { - planner: Arc>, + planner: PlannerMode, schema: Arc, subgraph_schemas: Arc>>>, introspection: Option>, @@ -68,6 +74,20 @@ pub(crate) struct BridgeQueryPlanner { _federation_instrument: ObservableGauge, } +#[derive(Clone)] +enum PlannerMode { + Js(Arc>), + Both { + js: Arc>, + rust: Arc, + }, + Rust { + rust: Arc, + // TODO: remove when those other uses are fully ported to Rust + js_for_api_schema_and_introspection_and_operation_signature: Arc>, + }, +} + fn federation_version_instrument(federation_version: Option) -> ObservableGauge { meter_provider() .meter("apollo/router") @@ -84,15 +104,74 @@ fn federation_version_instrument(federation_version: Option) -> ObservableG .init() } -impl BridgeQueryPlanner { - pub(crate) async fn new( - sdl: String, - configuration: Arc, +impl PlannerMode { + async fn new( + schema: &Schema, + configuration: &Configuration, ) -> Result { - let schema = Schema::parse(&sdl)?; + Ok(match configuration.experimental_query_planner_mode { + QueryPlannerMode::New => Self::Rust { + js_for_api_schema_and_introspection_and_operation_signature: Self::js( + &schema.raw_sdl, + configuration, + ) + .await?, + rust: Self::rust(schema, configuration)?, + }, + QueryPlannerMode::Legacy => Self::Js(Self::js(&schema.raw_sdl, configuration).await?), + QueryPlannerMode::Both => Self::Both { + js: Self::js(&schema.raw_sdl, configuration).await?, + rust: Self::rust(schema, configuration)?, + }, + }) + } + fn from_js( + js: Arc>, + schema: &Schema, + configuration: &Configuration, + ) -> Result { + Ok(match configuration.experimental_query_planner_mode { + QueryPlannerMode::New => Self::Rust { + js_for_api_schema_and_introspection_and_operation_signature: js, + rust: Self::rust(schema, configuration)?, + }, + QueryPlannerMode::Legacy => Self::Js(js), + QueryPlannerMode::Both => Self::Both { + js, + rust: Self::rust(schema, configuration)?, + }, + }) + } + + fn rust( + schema: &Schema, + configuration: &Configuration, + ) -> Result, ServiceBuildError> { + let config = apollo_federation::query_plan::query_planner::QueryPlannerConfig { + reuse_query_fragments: configuration + .supergraph + .reuse_query_fragments + .unwrap_or(true), + subgraph_graphql_validation: false, + incremental_delivery: + apollo_federation::query_plan::query_planner::QueryPlanIncrementalDeliveryConfig { + enable_defer: configuration.supergraph.defer_support, + }, + debug: Default::default(), + }; + Ok(Arc::new(QueryPlanner::new( + schema.federation_supergraph(), + config, + )?)) + } + + async fn js( + sdl: &str, + configuration: &Configuration, + ) -> Result>, ServiceBuildError> { let planner = Planner::new( - sdl, + sdl.to_owned(), QueryPlannerConfig { reuse_query_fragments: configuration.supergraph.reuse_query_fragments, generate_query_fragments: Some(configuration.supergraph.generate_query_fragments), @@ -112,99 +191,264 @@ impl BridgeQueryPlanner { .query_planning .experimental_paths_limit, }), + type_conditioned_fetching: configuration.experimental_type_conditioned_fetching, }, ) .await?; + Ok(Arc::new(planner)) + } + + fn js_for_api_schema_and_introspection_and_operation_signature( + &self, + ) -> &Arc> { + match self { + PlannerMode::Js(js) => js, + PlannerMode::Both { js, .. } => js, + PlannerMode::Rust { + js_for_api_schema_and_introspection_and_operation_signature, + .. + } => js_for_api_schema_and_introspection_and_operation_signature, + } + } - let planner = Arc::new(planner); + async fn plan( + &self, + schema: &Schema, + filtered_query: String, + operation: Option, + plan_options: PlanOptions, + ) -> Result, QueryPlannerError> { + match self { + PlannerMode::Js(js) => js + .plan(filtered_query, operation, plan_options) + .await + .map_err(QueryPlannerError::RouterBridgeError)? + .into_result() + .map_err(|err| QueryPlannerError::from(PlanErrors::from(err))), + PlannerMode::Rust { rust, .. } => { + // TODO:ย avoid reparsing and revalidating + let document = ExecutableDocument::parse_and_validate( + schema.api_schema(), + &filtered_query, + "query.graphql", + ) + .map_err(|e| QueryPlannerError::OperationValidationErrors(e.errors.into()))?; + + let plan = rust + .build_query_plan(&document, operation.as_deref()) + .map_err(|e| QueryPlannerError::FederationError(e.to_string()))?; + + // Dummy value overwritten below in `BrigeQueryPlanner::plan` + // `Configuration::validate` ensures that we only take this path + // when we also have `ApolloMetricsGenerationMode::New`` + let usage_reporting = UsageReporting { + stats_report_key: Default::default(), + referenced_fields_by_type: Default::default(), + }; + + Ok(PlanSuccess { + usage_reporting, + data: QueryPlanResult { + formatted_query_plan: Some(plan.to_string()), + query_plan: (&plan).into(), + }, + }) + } + PlannerMode::Both { js, rust } => { + // TODO:ย avoid reparsing and revalidating + let document = ExecutableDocument::parse_and_validate( + schema.api_schema(), + &filtered_query, + "query.graphql", + ) + .map_err(|e| QueryPlannerError::OperationValidationErrors(e.errors.into()))?; + + // TODO: once the Rust query planner does not use `todo!()` anymore, + // remove `USING_CATCH_UNWIND` and this use of `catch_unwind`. + let rust_result = std::panic::catch_unwind(|| { + USING_CATCH_UNWIND.set(true); + let result = rust.build_query_plan(&document, operation.as_deref()); + USING_CATCH_UNWIND.set(false); + result + }) + .unwrap_or_else(|panic| { + USING_CATCH_UNWIND.set(false); + Err( + apollo_federation::error::FederationError::SingleFederationError( + apollo_federation::error::SingleFederationError::Internal { + message: format!( + "query planner panicked: {}", + panic + .downcast_ref::() + .map(|s| s.as_str()) + .or_else(|| panic.downcast_ref::<&str>().copied()) + .unwrap_or_default() + ), + }, + ), + ) + }); + + let js_result = js + .plan(filtered_query, operation, plan_options) + .await + .map_err(QueryPlannerError::RouterBridgeError)? + .into_result() + .map_err(PlanErrors::from); + + let is_matched; + match (&js_result, &rust_result) { + (Err(js_error), Ok(_)) => { + tracing::warn!("JS query planner error: {}", js_error); + is_matched = false; + } + (Ok(_), Err(rust_error)) => { + tracing::warn!("Rust query planner error: {}", rust_error); + is_matched = false; + } + (Err(_), Err(_)) => { + is_matched = true; + } + + (Ok(js_plan), Ok(rust_plan)) => { + is_matched = js_plan.data.query_plan == rust_plan.into(); + if !is_matched { + // TODO: tracing::debug!(diff) + } + } + } + + u64_counter!( + "apollo.router.operations.query_planner.both", + "Comparing JS v.s. Rust query plans", + 1, + "generation.is_matched" = is_matched, + "generation.js_error" = js_result.is_err(), + "generation.rust_error" = rust_result.is_err() + ); + + Ok(js_result?) + } + } + } + + async fn subgraphs( + &self, + ) -> Result>>, ServiceBuildError> { + let js = match self { + PlannerMode::Js(js) => js, + PlannerMode::Both { js, .. } => js, + PlannerMode::Rust { rust, .. } => { + return Ok(rust + .subgraph_schemas() + .iter() + .map(|(name, schema)| (name.to_string(), Arc::new(schema.schema().clone()))) + .collect()) + } + }; + js.subgraphs() + .await? + .into_iter() + .map(|(name, schema_str)| { + let schema = apollo_compiler::Schema::parse_and_validate(schema_str, "") + .map_err(|errors| SchemaError::Validate(errors.into()))?; + Ok((name, Arc::new(schema))) + }) + .collect() + } +} + +impl BridgeQueryPlanner { + pub(crate) async fn new( + sdl: String, + configuration: Arc, + ) -> Result { + let schema = Schema::parse(&sdl, &configuration)?; + let planner = PlannerMode::new(&schema, &configuration).await?; let api_schema_string = match configuration.experimental_api_schema_generation_mode { crate::configuration::ApiSchemaMode::Legacy => { - let api_schema = planner.api_schema().await?; + let api_schema = planner + .js_for_api_schema_and_introspection_and_operation_signature() + .api_schema() + .await?; api_schema.schema } crate::configuration::ApiSchemaMode::New => schema.create_api_schema(&configuration)?, crate::configuration::ApiSchemaMode::Both => { - let api_schema = planner + let js_result = planner + .js_for_api_schema_and_introspection_and_operation_signature() .api_schema() .await .map(|api_schema| api_schema.schema); - let new_api_schema = schema.create_api_schema(&configuration); + let rust_result = schema.create_api_schema(&configuration); - match (&api_schema, &new_api_schema) { + let is_matched; + match (&js_result, &rust_result) { (Err(js_error), Ok(_)) => { tracing::warn!("JS API schema error: {}", js_error); - tracing::warn!( - monotonic_counter.apollo.router.lifecycle.api_schema = 1u64, - generation.is_matched = false, - "API schema generation mismatch: JS returns error but Rust does not" - ); + is_matched = false; } (Ok(_), Err(rs_error)) => { tracing::warn!("Rust API schema error: {}", rs_error); - tracing::warn!( - monotonic_counter.apollo.router.lifecycle.api_schema = 1u64, - generation.is_matched = false, - "API schema generation mismatch: JS returns API schema but Rust errors out" - ); + is_matched = false; } (Ok(left), Ok(right)) => { // To compare results, we re-parse, standardize, and print with apollo-rs, // so the formatting is identical. - if let (Ok(left), Ok(right)) = ( + let (left, right) = if let (Ok(parsed_left), Ok(parsed_right)) = ( apollo_compiler::Schema::parse(left, "js.graphql"), apollo_compiler::Schema::parse(right, "rust.graphql"), ) { - let left = standardize_schema(left).to_string(); - let right = standardize_schema(right).to_string(); - - if left == right { - tracing::warn!( - monotonic_counter.apollo.router.lifecycle.api_schema = 1u64, - generation.is_matched = true, - ); - } else { - tracing::warn!( - monotonic_counter.apollo.router.lifecycle.api_schema = 1u64, - generation.is_matched = false, - "API schema generation mismatch: apollo-federation and router-bridge write different schema" - ); - - let differences = diff::lines(&left, &right); - tracing::debug!( - "different API schema between apollo-federation and router-bridge:\n{}", - render_diff(&differences), - ); - } + ( + standardize_schema(parsed_left).to_string(), + standardize_schema(parsed_right).to_string(), + ) + } else { + (left.clone(), right.clone()) + }; + is_matched = left == right; + if !is_matched { + let differences = diff::lines(&left, &right); + tracing::debug!( + "different API schema between apollo-federation and router-bridge:\n{}", + render_diff(&differences), + ); } } (Err(_), Err(_)) => { - tracing::warn!( - monotonic_counter.apollo.router.lifecycle.api_schema = 1u64, - generation.is_matched = true, - ); + is_matched = true; } } - api_schema? + u64_counter!( + "apollo.router.lifecycle.api_schema", + "Comparing JS v.s. Rust API schema generation", + 1, + "generation.is_matched" = is_matched, + "generation.js_error" = js_result.is_err(), + "generation.rust_error" = rust_result.is_err() + ); + + js_result? } }; - let api_schema = Schema::parse(&api_schema_string)?; + let api_schema = Schema::parse_compiler_schema(&api_schema_string)?; let schema = Arc::new(schema.with_api_schema(api_schema)); - let mut subgraph_schemas: HashMap>> = - HashMap::new(); - for (name, schema_str) in planner.subgraphs().await? { - let schema = apollo_compiler::Schema::parse_and_validate(schema_str, "") - .map_err(|errors| SchemaError::Validate(errors.into()))?; - subgraph_schemas.insert(name, Arc::new(schema)); - } - let subgraph_schemas = Arc::new(subgraph_schemas); + let subgraph_schemas = Arc::new(planner.subgraphs().await?); let introspection = if configuration.supergraph.introspection { - Some(Arc::new(Introspection::new(planner.clone()).await?)) + Some(Arc::new( + Introspection::new( + planner + .js_for_api_schema_and_introspection_and_operation_signature() + .clone(), + ) + .await?, + )) } else { None }; @@ -253,14 +497,16 @@ impl BridgeQueryPlanner { .query_planning .experimental_paths_limit, }), + type_conditioned_fetching: configuration + .experimental_type_conditioned_fetching, }, ) .await?, ); let api_schema = planner.api_schema().await?; - let api_schema = Schema::parse(&api_schema.schema)?; - let schema = Arc::new(Schema::parse(&schema)?.with_api_schema(api_schema)); + let api_schema = Schema::parse_compiler_schema(&api_schema.schema)?; + let schema = Arc::new(Schema::parse(&schema, &configuration)?.with_api_schema(api_schema)); let mut subgraph_schemas: HashMap>> = HashMap::new(); @@ -280,6 +526,7 @@ impl BridgeQueryPlanner { let enable_authorization_directives = AuthorizationPlugin::enable_directives(&configuration, &schema)?; let federation_instrument = federation_version_instrument(schema.federation_version()); + let planner = PlannerMode::from_js(planner, &schema, &configuration)?; Ok(Self { planner, schema, @@ -292,7 +539,9 @@ impl BridgeQueryPlanner { } pub(crate) fn planner(&self) -> Arc> { - self.planner.clone() + self.planner + .js_for_api_schema_and_introspection_and_operation_signature() + .clone() } pub(crate) fn schema(&self) -> Arc { @@ -371,27 +620,23 @@ impl BridgeQueryPlanner { plan_options: PlanOptions, doc: &ParsedDocument, ) -> Result { - let planner_result = match self + let mut plan_success = self .planner - .plan(filtered_query.clone(), operation.clone(), plan_options) - .await - .map_err(QueryPlannerError::RouterBridgeError)? - .into_result() - { - Ok(mut plan) => { - plan.data - .query_plan - .hash_subqueries(&self.subgraph_schemas, &self.schema.raw_sdl); - plan.data - .query_plan - .extract_authorization_metadata(&self.schema.definitions, &key); - plan - } - Err(err) => { - let plan_errors: PlanErrors = err.into(); - return Err(QueryPlannerError::from(plan_errors)); - } - }; + .plan( + &self.schema, + filtered_query.clone(), + operation.clone(), + plan_options, + ) + .await?; + plan_success + .data + .query_plan + .hash_subqueries(&self.subgraph_schemas, &self.schema.raw_sdl)?; + plan_success + .data + .query_plan + .extract_authorization_metadata(self.schema.supergraph_schema(), &key); // the `statsReportKey` field should match the original query instead of the filtered query, to index them all under the same query let operation_signature = if matches!( @@ -402,6 +647,7 @@ impl BridgeQueryPlanner { { Some( self.planner + .js_for_api_schema_and_introspection_and_operation_signature() .operation_signature(original_query.clone(), operation.clone()) .await .map_err(QueryPlannerError::RouterBridgeError)?, @@ -410,7 +656,7 @@ impl BridgeQueryPlanner { None }; - match planner_result { + match plan_success { PlanSuccess { data: QueryPlanResult { @@ -446,7 +692,7 @@ impl BridgeQueryPlanner { &signature_doc.executable, &doc.executable, &operation, - &self.schema.definitions, + self.schema.supergraph_schema(), ); // Ignore comparison if the operation name is an empty string since there is a known issue where @@ -470,10 +716,11 @@ impl BridgeQueryPlanner { "apollo.router.operations.telemetry.studio.signature", "The match status of the Apollo reporting signature generated by the JS implementation vs the Rust implementation", 1, - "generation.is_matched" = "false" + "generation.is_matched" = false ); tracing::debug!( - "Different signatures generated between router and router-bridge:\n{}\n{}", + "Different signatures generated between router and router-bridge.\nQuery:\n{}\nRouter:\n{}\nRouter Bridge:\n{}", + filtered_query, generated_usage_reporting.result.stats_report_key, usage_reporting.stats_report_key, ); @@ -482,7 +729,7 @@ impl BridgeQueryPlanner { "apollo.router.operations.telemetry.studio.signature", "The match status of the Apollo reporting signature generated by the JS implementation vs the Rust implementation", 1, - "generation.is_matched" = "true" + "generation.is_matched" = true ); } @@ -495,10 +742,11 @@ impl BridgeQueryPlanner { "apollo.router.operations.telemetry.studio.references", "The match status of the Apollo reporting references generated by the JS implementation vs the Rust implementation", 1, - "generation.is_matched" = "false" + "generation.is_matched" = false ); tracing::debug!( - "Different referenced fields generated between router and router-bridge:\n{:?}\n{:?}", + "Different referenced fields generated between router and router-bridge.\nQuery:\n{}\nRouter:\n{:?}\nRouter Bridge:\n{:?}", + filtered_query, generated_usage_reporting.result.referenced_fields_by_type, usage_reporting.referenced_fields_by_type, ); @@ -507,7 +755,7 @@ impl BridgeQueryPlanner { "apollo.router.operations.telemetry.studio.references", "The match status of the Apollo reporting references generated by the JS implementation vs the Rust implementation", 1, - "generation.is_matched" = "true" + "generation.is_matched" = true ); } } else if matches!( @@ -586,8 +834,7 @@ impl Service for BridgeQueryPlanner { }; let api_schema = this.schema.api_schema(); - let api_schema_definitions = &api_schema.definitions; - match add_defer_labels(api_schema_definitions, &doc.ast) { + match add_defer_labels(api_schema, &doc.ast) { Err(e) => { return Err(QueryPlannerError::SpecError(SpecError::TransformError( e.to_string(), @@ -595,12 +842,12 @@ impl Service for BridgeQueryPlanner { } Ok(modified_query) => { let executable_document = modified_query - .to_executable_validate(api_schema_definitions) + .to_executable_validate(api_schema) // Assume transformation creates a valid document: ignore conversion errors .map_err(|e| SpecError::ValidationError(e.into()))?; let hash = QueryHashVisitor::hash_query( - api_schema_definitions, - &api_schema.raw_sdl, + this.schema.supergraph_schema(), + &this.schema.raw_sdl, &executable_document, operation_name.as_deref(), ) @@ -716,10 +963,10 @@ impl BridgeQueryPlanner { if let Some((unauthorized_paths, new_doc)) = filter_res { key.filtered_query = new_doc.to_string(); let executable_document = new_doc - .to_executable_validate(&self.schema.api_schema().definitions) + .to_executable_validate(self.schema.api_schema()) .map_err(|e| SpecError::ValidationError(e.into()))?; let hash = QueryHashVisitor::hash_query( - &self.schema.definitions, + self.schema.supergraph_schema(), &self.schema.raw_sdl, &executable_document, key.operation_name.as_deref(), @@ -800,32 +1047,33 @@ impl BridgeQueryPlanner { #[derive(Debug, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] pub(crate) struct QueryPlanResult { - formatted_query_plan: Option, - query_plan: QueryPlan, + pub(super) formatted_query_plan: Option, + pub(super) query_plan: QueryPlan, } #[derive(Debug, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] /// The root query plan container. -struct QueryPlan { +pub(super) struct QueryPlan { /// The hierarchical nodes that make up the query plan - node: Option, + pub(super) node: Option, } impl QueryPlan { fn hash_subqueries( &mut self, - schemas: &HashMap>>, + subgraph_schemas: &SubgraphSchemas, supergraph_schema_hash: &str, - ) { + ) -> Result<(), ValidationErrors> { if let Some(node) = self.node.as_mut() { - node.hash_subqueries(schemas, supergraph_schema_hash); + node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; } + Ok(()) } fn extract_authorization_metadata( &mut self, - schema: &apollo_compiler::Schema, + schema: &Valid, key: &CacheKeyMetadata, ) { if let Some(node) = self.node.as_mut() { @@ -997,10 +1245,12 @@ mod tests { use serde_json::json; use test_log::test; + use tower::Service; + use tower::ServiceExt; use super::*; - use crate::json_ext::Path; use crate::metrics::FutureMetricsExt as _; + use crate::services::supergraph; use crate::spec::query::subselections::SubSelectionKey; use crate::spec::query::subselections::SubSelectionValue; @@ -1075,7 +1325,7 @@ mod tests { #[test(tokio::test)] async fn empty_query_plan_should_be_a_planner_error() { - let schema = Schema::parse(EXAMPLE_SCHEMA).unwrap(); + let schema = Schema::parse_test(EXAMPLE_SCHEMA, &Default::default()).unwrap(); let query = include_str!("testdata/unknown_introspection_query.graphql"); let planner = BridgeQueryPlanner::new(EXAMPLE_SCHEMA.to_string(), Default::default()) @@ -1314,18 +1564,17 @@ mod tests { async fn subselections_keys(query: &str) -> String { fn check_query_plan_coverage( node: &PlanNode, - path: &Path, - parent_label: Option, + parent_label: Option<&str>, subselections: &HashMap, ) { match node { PlanNode::Defer { primary, deferred } => { if let Some(subselection) = primary.subselection.clone() { - let path = path.join(primary.path.clone().unwrap_or_default()); assert!( - subselections.keys().any(|k| k.defer_label == parent_label), - "Missing key: '{}' '{:?}' '{}' in {:?}", - path, + subselections + .keys() + .any(|k| k.defer_label.as_deref() == parent_label), + "Missing key: '{:?}' '{}' in {:?}", parent_label, subselection, subselections.keys().collect::>() @@ -1337,7 +1586,7 @@ mod tests { assert!( subselections .keys() - .any(|k| k.defer_label == deferred.label), + .any(|k| k.defer_label.as_deref() == deferred.label.as_deref()), "Missing key: '{}' '{:?}' '{}'", path, deferred.label, @@ -1347,8 +1596,7 @@ mod tests { if let Some(node) = &deferred.node { check_query_plan_coverage( node, - &deferred.query_path, - deferred.label.clone(), + deferred.label.as_ref().map(|l| l.as_str()), subselections, ) } @@ -1356,12 +1604,12 @@ mod tests { } PlanNode::Sequence { nodes } | PlanNode::Parallel { nodes } => { for node in nodes { - check_query_plan_coverage(node, path, parent_label.clone(), subselections) + check_query_plan_coverage(node, parent_label, subselections) } } PlanNode::Fetch(_) => {} PlanNode::Flatten(flatten) => { - check_query_plan_coverage(&flatten.node, path, parent_label, subselections) + check_query_plan_coverage(&flatten.node, parent_label, subselections) } PlanNode::Condition { condition: _, @@ -1369,15 +1617,15 @@ mod tests { else_clause, } => { if let Some(node) = if_clause { - check_query_plan_coverage(node, path, parent_label.clone(), subselections) + check_query_plan_coverage(node, parent_label, subselections) } if let Some(node) = else_clause { - check_query_plan_coverage(node, path, parent_label, subselections) + check_query_plan_coverage(node, parent_label, subselections) } } PlanNode::Subscription { rest, .. } => { if let Some(node) = rest { - check_query_plan_coverage(node, path, parent_label, subselections) + check_query_plan_coverage(node, parent_label, subselections) } } } @@ -1430,7 +1678,7 @@ mod tests { .await .unwrap(); if let QueryPlannerContent::Plan { plan, .. } = result { - check_query_plan_coverage(&plan.root, &Path::empty(), None, &plan.query.subselections); + check_query_plan_coverage(&plan.root, None, &plan.query.subselections); let mut keys: Vec = Vec::new(); for (key, value) in plan.query.subselections.iter() { @@ -1466,7 +1714,7 @@ mod tests { let doc = Query::parse_document( original_query, operation_name.as_deref(), - planner.schema().api_schema(), + &planner.schema(), &configuration, ) .unwrap(); @@ -1506,4 +1754,28 @@ mod tests { "router-bridge in Cargo.toml is not pinned with a '=' prefix" ); } + + #[tokio::test] + async fn test_both_mode() { + let mut harness = crate::TestHarness::builder() + // auth is not relevant here, but supergraph.graphql uses join/v0.1 + // which is not supported by the Rust query planner + .schema(include_str!("../../tests/fixtures/supergraph-auth.graphql")) + .configuration_json(serde_json::json!({ + "experimental_query_planner_mode": "both", + })) + .unwrap() + .build_supergraph() + .await + .unwrap(); + + let request = supergraph::Request::fake_builder() + .query("{ topProducts { name }}") + .build() + .unwrap(); + let mut response = harness.ready().await.unwrap().call(request).await.unwrap(); + assert!(response.response.status().is_success()); + let response = response.next_response().await.unwrap(); + assert!(response.errors.is_empty()); + } } diff --git a/apollo-router/src/query_planner/caching_query_planner.rs b/apollo-router/src/query_planner/caching_query_planner.rs index 4e8172bd76..2772e87db0 100644 --- a/apollo-router/src/query_planner/caching_query_planner.rs +++ b/apollo-router/src/query_planner/caching_query_planner.rs @@ -240,7 +240,7 @@ where } }; - let schema = &self.schema.api_schema().definitions; + let schema = self.schema.api_schema(); if let Ok(modified_query) = add_defer_labels(schema, &doc.ast) { query = modified_query.to_string(); } @@ -402,7 +402,7 @@ where context, } = request; - let schema = &self.schema.api_schema().definitions; + let schema = self.schema.api_schema(); if let Ok(modified_query) = add_defer_labels(schema, &doc.ast) { query = modified_query.to_string(); } @@ -641,17 +641,16 @@ mod tests { }); let configuration = Arc::new(crate::Configuration::default()); - let schema = Arc::new(Schema::parse(include_str!("testdata/schema.graphql")).unwrap()); + let schema = include_str!("testdata/schema.graphql"); + let schema = Arc::new(Schema::parse_test(schema, &configuration).unwrap()); let mut planner = - CachingQueryPlanner::new(delegate, schema, &configuration, IndexMap::new()) + CachingQueryPlanner::new(delegate, schema.clone(), &configuration, IndexMap::new()) .await .unwrap(); let configuration = Configuration::default(); - let schema = Schema::parse(include_str!("testdata/schema.graphql")).unwrap(); - let doc1 = Query::parse_document( "query Me { me { username } }", None, @@ -730,7 +729,8 @@ mod tests { let configuration = Configuration::default(); - let schema = Schema::parse(include_str!("testdata/schema.graphql")).unwrap(); + let schema = + Schema::parse_test(include_str!("testdata/schema.graphql"), &configuration).unwrap(); let doc = Query::parse_document( "query Me { me { username } }", diff --git a/apollo-router/src/query_planner/convert.rs b/apollo-router/src/query_planner/convert.rs new file mode 100644 index 0000000000..79478bb120 --- /dev/null +++ b/apollo-router/src/query_planner/convert.rs @@ -0,0 +1,329 @@ +use std::sync::Arc; + +use apollo_compiler::executable; +use apollo_federation::query_plan as next; + +use crate::query_planner::bridge_query_planner as bridge; +use crate::query_planner::fetch::SubgraphOperation; +use crate::query_planner::plan; +use crate::query_planner::rewrites; +use crate::query_planner::selection; +use crate::query_planner::subscription; + +impl From<&'_ next::QueryPlan> for bridge::QueryPlan { + fn from(value: &'_ next::QueryPlan) -> Self { + let next::QueryPlan { node } = value; + Self { node: option(node) } + } +} + +impl From<&'_ next::TopLevelPlanNode> for plan::PlanNode { + fn from(value: &'_ next::TopLevelPlanNode) -> Self { + match value { + next::TopLevelPlanNode::Subscription(node) => node.into(), + next::TopLevelPlanNode::Fetch(node) => node.into(), + next::TopLevelPlanNode::Sequence(node) => node.into(), + next::TopLevelPlanNode::Parallel(node) => node.into(), + next::TopLevelPlanNode::Flatten(node) => node.into(), + next::TopLevelPlanNode::Defer(node) => node.into(), + next::TopLevelPlanNode::Condition(node) => node.into(), + } + } +} + +impl From<&'_ next::PlanNode> for plan::PlanNode { + fn from(value: &'_ next::PlanNode) -> Self { + match value { + next::PlanNode::Fetch(node) => node.as_ref().into(), + next::PlanNode::Sequence(node) => node.as_ref().into(), + next::PlanNode::Parallel(node) => node.as_ref().into(), + next::PlanNode::Flatten(node) => node.as_ref().into(), + next::PlanNode::Defer(node) => node.as_ref().into(), + next::PlanNode::Condition(node) => node.as_ref().into(), + } + } +} + +impl From<&'_ next::SubscriptionNode> for plan::PlanNode { + fn from(value: &'_ next::SubscriptionNode) -> Self { + let next::SubscriptionNode { primary, rest } = value; + Self::Subscription { + primary: primary.into(), + rest: option(rest).map(Box::new), + } + } +} + +impl From<&'_ next::FetchNode> for plan::PlanNode { + fn from(value: &'_ next::FetchNode) -> Self { + let next::FetchNode { + subgraph_name, + id, + variable_usages, + requires, + operation_document, + operation_name, + operation_kind, + input_rewrites, + output_rewrites, + } = value; + Self::Fetch(super::fetch::FetchNode { + service_name: subgraph_name.clone(), + requires: vec(requires), + variable_usages: variable_usages.iter().map(|v| v.clone().into()).collect(), + // TODO: use Arc in apollo_federation to avoid this clone + operation: SubgraphOperation::from_parsed(Arc::new(operation_document.clone())), + operation_name: operation_name.clone(), + operation_kind: (*operation_kind).into(), + id: id.clone(), + input_rewrites: option_vec(input_rewrites), + output_rewrites: option_vec(output_rewrites), + schema_aware_hash: Default::default(), + authorization: Default::default(), + }) + } +} + +impl From<&'_ next::SequenceNode> for plan::PlanNode { + fn from(value: &'_ next::SequenceNode) -> Self { + let next::SequenceNode { nodes } = value; + Self::Sequence { nodes: vec(nodes) } + } +} + +impl From<&'_ next::ParallelNode> for plan::PlanNode { + fn from(value: &'_ next::ParallelNode) -> Self { + let next::ParallelNode { nodes } = value; + Self::Parallel { nodes: vec(nodes) } + } +} + +impl From<&'_ next::FlattenNode> for plan::PlanNode { + fn from(value: &'_ next::FlattenNode) -> Self { + let next::FlattenNode { path, node } = value; + Self::Flatten(plan::FlattenNode { + path: crate::json_ext::Path(vec(path)), + node: Box::new(node.into()), + }) + } +} + +impl From<&'_ next::DeferNode> for plan::PlanNode { + fn from(value: &'_ next::DeferNode) -> Self { + let next::DeferNode { primary, deferred } = value; + Self::Defer { + primary: primary.into(), + deferred: vec(deferred), + } + } +} + +impl From<&'_ next::ConditionNode> for plan::PlanNode { + fn from(value: &'_ next::ConditionNode) -> Self { + let next::ConditionNode { + condition_variable, + if_clause, + else_clause, + } = value; + Self::Condition { + condition: condition_variable.to_string(), + if_clause: if_clause.as_ref().map(Into::into).map(Box::new), + else_clause: else_clause.as_ref().map(Into::into).map(Box::new), + } + } +} + +impl From<&'_ next::FetchNode> for subscription::SubscriptionNode { + fn from(value: &'_ next::FetchNode) -> Self { + let next::FetchNode { + subgraph_name, + id: _, + variable_usages, + requires: _, + operation_document, + operation_name, + operation_kind, + input_rewrites, + output_rewrites, + } = value; + Self { + service_name: subgraph_name.clone(), + variable_usages: variable_usages.iter().map(|v| v.clone().into()).collect(), + // TODO: use Arc in apollo_federation to avoid this clone + operation: SubgraphOperation::from_parsed(Arc::new(operation_document.clone())), + operation_name: operation_name.clone(), + operation_kind: (*operation_kind).into(), + input_rewrites: option_vec(input_rewrites), + output_rewrites: option_vec(output_rewrites), + } + } +} + +impl From<&'_ next::PrimaryDeferBlock> for plan::Primary { + fn from(value: &'_ next::PrimaryDeferBlock) -> Self { + let next::PrimaryDeferBlock { + sub_selection, + node, + } = value; + Self { + node: option(node).map(Box::new), + subselection: sub_selection.as_ref().map(|s| s.to_string()), + } + } +} + +impl From<&'_ next::DeferredDeferBlock> for plan::DeferredNode { + fn from(value: &'_ next::DeferredDeferBlock) -> Self { + let next::DeferredDeferBlock { + depends, + label, + query_path, + sub_selection, + node, + } = value; + Self { + depends: vec(depends), + label: label.clone(), + query_path: crate::json_ext::Path( + query_path + .iter() + .filter_map(|e| match e { + next::QueryPathElement::Field(field) => Some( + // TODO: type conditioned fetching once it s available in the rust planner + crate::graphql::JsonPathElement::Key( + field.response_key().to_string(), + None, + ), + ), + next::QueryPathElement::InlineFragment(inline) => { + inline.type_condition.as_ref().map(|cond| { + crate::graphql::JsonPathElement::Fragment(cond.to_string()) + }) + } + }) + .collect(), + ), + node: option(node).map(Arc::new), + subselection: sub_selection.as_ref().map(|s| s.to_string()), + } + } +} + +impl From<&'_ next::DeferredDependency> for plan::Depends { + fn from(value: &'_ next::DeferredDependency) -> Self { + let next::DeferredDependency { id } = value; + Self { id: id.clone() } + } +} + +impl From<&'_ executable::Selection> for selection::Selection { + fn from(value: &'_ executable::Selection) -> Self { + match value { + executable::Selection::Field(field) => Self::Field(field.as_ref().into()), + executable::Selection::InlineFragment(inline) => { + Self::InlineFragment(inline.as_ref().into()) + } + executable::Selection::FragmentSpread(_) => unreachable!(), + } + } +} + +impl From<&'_ executable::Field> for selection::Field { + fn from(value: &'_ executable::Field) -> Self { + let executable::Field { + definition: _, + alias, + name, + arguments: _, + directives: _, + selection_set, + } = value; + Self { + alias: alias.clone(), + name: name.clone(), + selections: option_vec(&selection_set.selections), + } + } +} + +impl From<&'_ executable::InlineFragment> for selection::InlineFragment { + fn from(value: &'_ executable::InlineFragment) -> Self { + let executable::InlineFragment { + type_condition, + directives: _, + selection_set, + } = value; + Self { + type_condition: type_condition.clone(), + selections: vec(&selection_set.selections), + } + } +} + +impl From<&'_ next::FetchDataRewrite> for rewrites::DataRewrite { + fn from(value: &'_ next::FetchDataRewrite) -> Self { + match value { + next::FetchDataRewrite::ValueSetter(setter) => Self::ValueSetter(setter.into()), + next::FetchDataRewrite::KeyRenamer(renamer) => Self::KeyRenamer(renamer.into()), + } + } +} + +impl From<&'_ next::FetchDataValueSetter> for rewrites::DataValueSetter { + fn from(value: &'_ next::FetchDataValueSetter) -> Self { + let next::FetchDataValueSetter { path, set_value_to } = value; + Self { + path: crate::json_ext::Path(vec(path)), + set_value_to: set_value_to.clone(), + } + } +} + +impl From<&'_ next::FetchDataKeyRenamer> for rewrites::DataKeyRenamer { + fn from(value: &'_ next::FetchDataKeyRenamer) -> Self { + let next::FetchDataKeyRenamer { + path, + rename_key_to, + } = value; + Self { + path: crate::json_ext::Path(vec(path)), + rename_key_to: rename_key_to.clone(), + } + } +} + +impl From<&'_ next::FetchDataPathElement> for crate::json_ext::PathElement { + fn from(value: &'_ next::FetchDataPathElement) -> Self { + match value { + // TODO: Type conditioned fetching once it's available in the rust planner + next::FetchDataPathElement::Key(value) => Self::Key(value.to_string(), None), + next::FetchDataPathElement::AnyIndex => Self::Flatten(None), + next::FetchDataPathElement::TypenameEquals(value) => Self::Fragment(value.to_string()), + } + } +} + +fn vec<'a, T, U>(value: &'a [T]) -> Vec +where + U: From<&'a T>, +{ + value.iter().map(Into::into).collect() +} + +fn option<'a, T, U>(value: &'a Option) -> Option +where + U: From<&'a T>, +{ + value.as_ref().map(Into::into) +} + +fn option_vec<'a, T, U>(value: &'a [T]) -> Option> +where + U: From<&'a T>, +{ + if value.is_empty() { + None + } else { + Some(vec(value)) + } +} diff --git a/apollo-router/src/query_planner/execution.rs b/apollo-router/src/query_planner/execution.rs index 7e1d94b678..801069afd1 100644 --- a/apollo-router/src/query_planner/execution.rs +++ b/apollo-router/src/query_planner/execution.rs @@ -1,6 +1,7 @@ use std::collections::HashMap; use std::sync::Arc; +use apollo_compiler::NodeStr; use futures::future::join_all; use futures::prelude::*; use tokio::sync::broadcast; @@ -100,7 +101,7 @@ pub(crate) struct ExecutionParameters<'a> { pub(crate) service_factory: &'a Arc, pub(crate) schema: &'a Arc, pub(crate) supergraph_request: &'a Arc>, - pub(crate) deferred_fetches: &'a HashMap)>>, + pub(crate) deferred_fetches: &'a HashMap)>>, pub(crate) query: &'a Arc, pub(crate) root_node: &'a PlanNode, pub(crate) subscription_handle: &'a Option, @@ -175,7 +176,7 @@ impl PlanNode { } PlanNode::Flatten(FlattenNode { path, node }) => { // Note that the span must be `info` as we need to pick this up in apollo tracing - let current_dir = current_dir.join(path); + let current_dir = current_dir.join(path.remove_empty_key_root()); let (v, err) = node .execute_recursively( parameters, @@ -190,7 +191,6 @@ impl PlanNode { "otel.kind" = "INTERNAL" )) .await; - value = v; errors = err; } @@ -247,19 +247,14 @@ impl PlanNode { } } PlanNode::Defer { - primary: - Primary { - path: _primary_path, - node, - .. - }, + primary: Primary { node, .. }, deferred, } => { value = parent_value.clone(); errors = Vec::new(); async { let mut deferred_fetches: HashMap< - String, + NodeStr, broadcast::Sender<(Value, Vec)>, > = HashMap::new(); let mut futures = Vec::new(); @@ -408,7 +403,7 @@ impl DeferredNode { parent_value: &Value, sender: mpsc::Sender, primary_sender: &broadcast::Sender<(Value, Vec)>, - deferred_fetches: &mut HashMap)>>, + deferred_fetches: &mut HashMap)>>, ) -> impl Future { let mut deferred_receivers = Vec::new(); @@ -437,7 +432,7 @@ impl DeferredNode { //FIXME/ is there a solution without cloning the entire node? Maybe it could be moved instead? let deferred_inner = self.node.clone(); let deferred_path = self.query_path.clone(); - let label = self.label.clone(); + let label = self.label.as_ref().map(|l| l.to_string()); let tx = sender; let sc = parameters.schema.clone(); let orig = parameters.supergraph_request.clone(); diff --git a/apollo-router/src/query_planner/fetch.rs b/apollo-router/src/query_planner/fetch.rs index 58c22cae0d..f76a6a2d2d 100644 --- a/apollo-router/src/query_planner/fetch.rs +++ b/apollo-router/src/query_planner/fetch.rs @@ -1,9 +1,12 @@ +use std::collections::HashMap; use std::fmt::Display; use std::sync::Arc; use apollo_compiler::validation::Valid; use apollo_compiler::ExecutableDocument; +use apollo_compiler::NodeStr; use indexmap::IndexSet; +use once_cell::sync::OnceCell as OnceLock; use serde::Deserialize; use serde::Serialize; use tower::ServiceExt; @@ -16,6 +19,7 @@ use super::selection::execute_selection_set; use super::selection::Selection; use crate::error::Error; use crate::error::FetchError; +use crate::error::ValidationErrors; use crate::graphql; use crate::graphql::Request; use crate::http_ext; @@ -43,12 +47,12 @@ pub enum OperationKind { impl Display for OperationKind { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.as_str()) + write!(f, "{}", self.default_type_name()) } } impl OperationKind { - pub(crate) const fn as_str(&self) -> &'static str { + pub(crate) const fn default_type_name(&self) -> &'static str { match self { OperationKind::Query => "Query", OperationKind::Mutation => "Mutation", @@ -86,12 +90,14 @@ impl From for OperationKind { } } +pub(crate) type SubgraphSchemas = HashMap>>; + /// A fetch node. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub(crate) struct FetchNode { /// The name of the service or subgraph that the fetch is querying. - pub(crate) service_name: String, + pub(crate) service_name: NodeStr, /// The data that is required for the subgraph fetch. #[serde(skip_serializing_if = "Vec::is_empty")] @@ -99,19 +105,19 @@ pub(crate) struct FetchNode { pub(crate) requires: Vec, /// The variables that are used for the subgraph fetch. - pub(crate) variable_usages: Vec, + pub(crate) variable_usages: Vec, /// The GraphQL subquery that is used for the fetch. - pub(crate) operation: String, + pub(crate) operation: SubgraphOperation, /// The GraphQL subquery operation name. - pub(crate) operation_name: Option, + pub(crate) operation_name: Option, /// The GraphQL operation kind that is used for the fetch. pub(crate) operation_kind: OperationKind, /// Optional id used by Deferred nodes - pub(crate) id: Option, + pub(crate) id: Option, // Optionally describes a number of "rewrites" that query plan executors should apply to the data that is sent as input of this fetch. pub(crate) input_rewrites: Option>, @@ -129,6 +135,94 @@ pub(crate) struct FetchNode { pub(crate) authorization: Arc, } +#[derive(Clone)] +pub(crate) struct SubgraphOperation { + // At least one of these two must be initialized + serialized: OnceLock, + parsed: OnceLock>>, +} + +impl SubgraphOperation { + pub(crate) fn from_string(serialized: impl Into) -> Self { + Self { + serialized: OnceLock::from(serialized.into()), + parsed: OnceLock::new(), + } + } + + pub(crate) fn from_parsed(parsed: impl Into>>) -> Self { + Self { + serialized: OnceLock::new(), + parsed: OnceLock::from(parsed.into()), + } + } + + pub(crate) fn as_serialized(&self) -> &str { + self.serialized.get_or_init(|| { + self.parsed + .get() + .expect("SubgraphOperation has neither representation initialized") + .to_string() + }) + } + + pub(crate) fn as_parsed( + &self, + subgraph_schema: &Valid, + ) -> Result<&Arc>, ValidationErrors> { + self.parsed.get_or_try_init(|| { + let serialized = self + .serialized + .get() + .expect("SubgraphOperation has neither representation initialized"); + Ok(Arc::new( + ExecutableDocument::parse_and_validate( + subgraph_schema, + serialized, + "operation.graphql", + ) + .map_err(|e| e.errors)?, + )) + }) + } +} + +impl Serialize for SubgraphOperation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + self.as_serialized().serialize(serializer) + } +} + +impl<'de> Deserialize<'de> for SubgraphOperation { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + Ok(Self::from_string(String::deserialize(deserializer)?)) + } +} + +impl PartialEq for SubgraphOperation { + fn eq(&self, other: &Self) -> bool { + self.as_serialized() == other.as_serialized() + } +} + +impl std::fmt::Debug for SubgraphOperation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Debug::fmt(self.as_serialized(), f) + } +} + +impl std::fmt::Display for SubgraphOperation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.as_serialized(), f) + } +} + #[derive(Clone, Default, Hash, PartialEq, Eq, Deserialize, Serialize)] pub(crate) struct QueryHash(#[serde(with = "hex")] pub(crate) Vec); @@ -156,7 +250,7 @@ impl Variables { #[allow(clippy::too_many_arguments)] pub(super) fn new( requires: &[Selection], - variable_usages: &[String], + variable_usages: &[NodeStr], data: &Value, current_dir: &Path, request: &Arc>, @@ -200,7 +294,6 @@ impl Variables { let representations = Value::Array(Vec::from_iter(values)); variables.insert("representations", representations); - Some(Variables { variables, inverted_paths, @@ -236,6 +329,14 @@ impl Variables { } impl FetchNode { + pub(crate) fn parsed_operation( + &self, + subgraph_schemas: &SubgraphSchemas, + ) -> Result<&Arc>, ValidationErrors> { + self.operation + .as_parsed(&subgraph_schemas[self.service_name.as_str()]) + } + #[allow(clippy::too_many_arguments)] pub(crate) async fn fetch_node<'a>( &'a self, @@ -256,7 +357,7 @@ impl FetchNode { inverted_paths: paths, } = match Variables::new( &self.requires, - self.variable_usages.as_ref(), + &self.variable_usages, data, current_dir, // Needs the original request here @@ -288,15 +389,15 @@ impl FetchNode { ) .body( Request::builder() - .query(operation) - .and_operation_name(operation_name.clone()) + .query(operation.as_serialized()) + .and_operation_name(operation_name.as_ref().map(|n| n.to_string())) .variables(variables.clone()) .build(), ) .build() .expect("it won't fail because the url is correct and already checked; qed"), ) - .subgraph_name(self.service_name.clone()) + .subgraph_name(self.service_name.to_string()) .operation_kind(*operation_kind) .context(parameters.context.clone()) .build(); @@ -340,13 +441,18 @@ impl FetchNode { Ok(res) => res.response.into_parts(), }; - super::log::trace_subfetch(service_name, operation, &variables, &response); + super::log::trace_subfetch( + service_name, + operation.as_serialized(), + &variables, + &response, + ); if !response.is_primary() { return ( Value::default(), vec![FetchError::SubrequestUnexpectedPatchResponse { - service: service_name.to_owned(), + service: service_name.to_string(), } .to_graphql_error(Some(current_dir.to_owned()))], ); @@ -374,7 +480,10 @@ impl FetchNode { response: graphql::Response, ) -> (Value, Vec) { if !self.requires.is_empty() { - let entities_path = Path(vec![json_ext::PathElement::Key("_entities".to_string())]); + let entities_path = Path(vec![json_ext::PathElement::Key( + "_entities".to_string(), + None, + )]); let mut errors: Vec = vec![]; for mut error in response.errors { @@ -460,11 +569,12 @@ impl FetchNode { (Value::Null, errors) } else { - let current_slice = if current_dir.last() == Some(&json_ext::PathElement::Flatten) { - ¤t_dir.0[..current_dir.0.len() - 1] - } else { - ¤t_dir.0[..] - }; + let current_slice = + if matches!(current_dir.last(), Some(&json_ext::PathElement::Flatten(_))) { + ¤t_dir.0[..current_dir.0.len() - 1] + } else { + ¤t_dir.0[..] + }; let errors: Vec = response .errors @@ -499,30 +609,31 @@ impl FetchNode { pub(crate) fn hash_subquery( &mut self, - schema: &Valid, + subgraph_schemas: &SubgraphSchemas, supergraph_schema_hash: &str, - ) { - let doc = ExecutableDocument::parse(schema, &self.operation, "query.graphql") - .expect("subgraph queries should be valid"); + ) -> Result<(), ValidationErrors> { + let doc = self.parsed_operation(subgraph_schemas)?; + let schema = &subgraph_schemas[self.service_name.as_str()]; if let Ok(hash) = QueryHashVisitor::hash_query( schema, supergraph_schema_hash, - &doc, + doc, self.operation_name.as_deref(), ) { self.schema_aware_hash = Arc::new(QueryHash(hash)); } + Ok(()) } pub(crate) fn extract_authorization_metadata( &mut self, - schema: &apollo_compiler::Schema, + schema: &Valid, global_authorisation_cache_key: &CacheKeyMetadata, ) { let doc = ExecutableDocument::parse( - Valid::assume_valid_ref(schema), - &self.operation, + schema, + self.operation.as_serialized().to_string(), "query.graphql", ) // Assume query planing creates a valid document: ignore parse errors diff --git a/apollo-router/src/query_planner/mod.rs b/apollo-router/src/query_planner/mod.rs index 25d409c711..a11a5cb072 100644 --- a/apollo-router/src/query_planner/mod.rs +++ b/apollo-router/src/query_planner/mod.rs @@ -5,20 +5,22 @@ pub(crate) use bridge_query_planner::*; pub(crate) use bridge_query_planner_pool::*; pub(crate) use caching_query_planner::*; +pub use plan::QueryPlan; +pub(crate) use plan::*; pub use self::fetch::OperationKind; mod bridge_query_planner; mod bridge_query_planner_pool; mod caching_query_planner; +mod convert; mod execution; pub(crate) mod fetch; +mod labeler; mod plan; pub(crate) mod rewrites; mod selection; pub(crate) mod subscription; -pub use plan::*; -mod labeler; pub(crate) const FETCH_SPAN_NAME: &str = "fetch"; pub(crate) const SUBSCRIBE_SPAN_NAME: &str = "subscribe"; diff --git a/apollo-router/src/query_planner/plan.rs b/apollo-router/src/query_planner/plan.rs index c734541fb3..5acd3ec8b4 100644 --- a/apollo-router/src/query_planner/plan.rs +++ b/apollo-router/src/query_planner/plan.rs @@ -1,7 +1,7 @@ -use std::collections::HashMap; use std::sync::Arc; use apollo_compiler::validation::Valid; +use apollo_compiler::NodeStr; use router_bridge::planner::PlanOptions; use router_bridge::planner::UsageReporting; use serde::Deserialize; @@ -10,12 +10,15 @@ use serde::Serialize; pub(crate) use self::fetch::OperationKind; use super::fetch; use super::subscription::SubscriptionNode; +use crate::configuration::Batching; use crate::error::CacheResolverError; +use crate::error::ValidationErrors; use crate::json_ext::Object; use crate::json_ext::Path; use crate::json_ext::Value; use crate::plugins::authorization::CacheKeyMetadata; use crate::query_planner::fetch::QueryHash; +use crate::query_planner::fetch::SubgraphSchemas; use crate::spec::Query; /// A planner key. @@ -77,10 +80,12 @@ impl QueryPlan { pub(crate) fn query_hashes( &self, + batching_config: Batching, operation: Option<&str>, variables: &Object, ) -> Result>, CacheResolverError> { - self.root.query_hashes(operation, variables, &self.query) + self.root + .query_hashes(batching_config, operation, variables, &self.query) } } @@ -216,6 +221,7 @@ impl PlanNode { /// details and don't use _ so that future node types must be handled here. pub(crate) fn query_hashes( &self, + batching_config: Batching, operation: Option<&str>, variables: &Object, query: &Query, @@ -236,8 +242,10 @@ impl PlanNode { new_targets.extend(nodes); } PlanNode::Fetch(node) => { - // If requires.is_empty() we can batch it! - if node.requires.is_empty() { + // If requires.is_empty() we may be able to batch it! + if node.requires.is_empty() + && batching_config.batch_include(&node.service_name) + { query_hashes.push(node.schema_aware_hash.clone()); } } @@ -314,44 +322,42 @@ impl PlanNode { pub(crate) fn hash_subqueries( &mut self, - schemas: &HashMap>>, + subgraph_schemas: &SubgraphSchemas, supergraph_schema_hash: &str, - ) { + ) -> Result<(), ValidationErrors> { match self { PlanNode::Fetch(fetch_node) => { - if let Some(schema) = schemas.get(&fetch_node.service_name) { - fetch_node.hash_subquery(schema, supergraph_schema_hash); - } + fetch_node.hash_subquery(subgraph_schemas, supergraph_schema_hash)?; } PlanNode::Sequence { nodes } => { for node in nodes { - node.hash_subqueries(schemas, supergraph_schema_hash); + node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; } } PlanNode::Parallel { nodes } => { for node in nodes { - node.hash_subqueries(schemas, supergraph_schema_hash); + node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; } } PlanNode::Flatten(flatten) => flatten .node - .hash_subqueries(schemas, supergraph_schema_hash), + .hash_subqueries(subgraph_schemas, supergraph_schema_hash)?, PlanNode::Defer { primary, deferred } => { if let Some(node) = primary.node.as_mut() { - node.hash_subqueries(schemas, supergraph_schema_hash); + node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; } for deferred_node in deferred { if let Some(node) = deferred_node.node.take() { let mut new_node = (*node).clone(); - new_node.hash_subqueries(schemas, supergraph_schema_hash); + new_node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; deferred_node.node = Some(Arc::new(new_node)); } } } PlanNode::Subscription { primary: _, rest } => { if let Some(node) = rest.as_mut() { - node.hash_subqueries(schemas, supergraph_schema_hash); + node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; } } PlanNode::Condition { @@ -360,13 +366,14 @@ impl PlanNode { else_clause, } => { if let Some(node) = if_clause.as_mut() { - node.hash_subqueries(schemas, supergraph_schema_hash); + node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; } if let Some(node) = else_clause.as_mut() { - node.hash_subqueries(schemas, supergraph_schema_hash); + node.hash_subqueries(subgraph_schemas, supergraph_schema_hash)?; } } } + Ok(()) } #[cfg(test)] @@ -420,7 +427,7 @@ impl PlanNode { pub(crate) fn extract_authorization_metadata( &mut self, - schema: &apollo_compiler::Schema, + schema: &Valid, key: &CacheKeyMetadata, ) { match self { @@ -487,10 +494,6 @@ pub(crate) struct FlattenNode { #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub(crate) struct Primary { - /// Optional path, set if and only if the defer node is a - /// nested defer. If set, `subselection` starts at that `path`. - pub(crate) path: Option, - /// The part of the original query that "selects" the data to /// send in that primary response (once the plan in `node` completes). pub(crate) subselection: Option, @@ -511,7 +514,7 @@ pub(crate) struct DeferredNode { pub(crate) depends: Vec, /// The optional defer label. - pub(crate) label: Option, + pub(crate) label: Option, /// Path to the @defer this correspond to. `subselection` start at that `path`. pub(crate) query_path: Path, /// The part of the original query that "selects" the data to send @@ -526,6 +529,5 @@ pub(crate) struct DeferredNode { #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub(crate) struct Depends { - pub(crate) id: String, - pub(crate) defer_label: Option, + pub(crate) id: NodeStr, } diff --git a/apollo-router/src/query_planner/rewrites.rs b/apollo-router/src/query_planner/rewrites.rs index 90e92c6465..94453630df 100644 --- a/apollo-router/src/query_planner/rewrites.rs +++ b/apollo-router/src/query_planner/rewrites.rs @@ -8,6 +8,7 @@ //! every appear on the input side, while other will only appear on outputs, but it does not hurt //! to be future-proof by supporting all types of rewrites on both "sides". +use apollo_compiler::NodeStr; use serde::Deserialize; use serde::Serialize; @@ -42,7 +43,7 @@ pub(crate) struct DataValueSetter { #[serde(rename_all = "camelCase")] pub(crate) struct DataKeyRenamer { pub(crate) path: Path, - pub(crate) rename_key_to: String, + pub(crate) rename_key_to: NodeStr, } impl DataRewrite { @@ -54,7 +55,9 @@ impl DataRewrite { // `Key` and we ignore other cases (in theory, it could be `Fragment` needs // to be supported someday if we ever need to rewrite full object values, // but that can be added then). - if let Some((parent, PathElement::Key(k))) = split_path_last_element(&setter.path) { + if let Some((parent, PathElement::Key(k, _))) = + split_path_last_element(&setter.path) + { data.select_values_and_paths_mut(schema, &parent, |_path, obj| { if let Some(value) = obj.get_mut(k) { *value = setter.set_value_to.clone() @@ -65,12 +68,13 @@ impl DataRewrite { DataRewrite::KeyRenamer(renamer) => { // As the name implies, this only applies to renaming "keys", so we're // guaranteed the last element is one and can ignore other cases. - if let Some((parent, PathElement::Key(k))) = split_path_last_element(&renamer.path) + if let Some((parent, PathElement::Key(k, _))) = + split_path_last_element(&renamer.path) { data.select_values_and_paths_mut(schema, &parent, |_path, selected| { if let Some(obj) = selected.as_object_mut() { if let Some(value) = obj.remove(k.as_str()) { - obj.insert(renamer.rename_key_to.clone(), value); + obj.insert(renamer.rename_key_to.as_str(), value); } } @@ -78,7 +82,7 @@ impl DataRewrite { for item in arr { if let Some(obj) = item.as_object_mut() { if let Some(value) = obj.remove(k.as_str()) { - obj.insert(renamer.rename_key_to.clone(), value); + obj.insert(renamer.rename_key_to.as_str(), value); } } } @@ -156,7 +160,7 @@ mod tests { let dr = DataRewrite::KeyRenamer(DataKeyRenamer { path: "data/testField__alias_0".into(), - rename_key_to: "testField".to_string(), + rename_key_to: "testField".into(), }); dr.maybe_apply( @@ -194,7 +198,7 @@ mod tests { let dr = DataRewrite::KeyRenamer(DataKeyRenamer { path: "data/testField__alias_0".into(), - rename_key_to: "testField".to_string(), + rename_key_to: "testField".into(), }); dr.maybe_apply( diff --git a/apollo-router/src/query_planner/selection.rs b/apollo-router/src/query_planner/selection.rs index 572199762e..80c5ed3902 100644 --- a/apollo-router/src/query_planner/selection.rs +++ b/apollo-router/src/query_planner/selection.rs @@ -1,3 +1,4 @@ +use apollo_compiler::ast::Name; use apollo_compiler::schema::ExtendedType; use serde::Deserialize; use serde::Serialize; @@ -28,10 +29,10 @@ pub(crate) enum Selection { pub(crate) struct Field { /// An optional alias for the field. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) alias: Option, + pub(crate) alias: Option, /// The name of the field. - pub(crate) name: String, + pub(crate) name: Name, /// The selections for the field. #[serde(skip_serializing_if = "Option::is_none")] @@ -44,7 +45,7 @@ pub(crate) struct Field { pub(crate) struct InlineFragment { /// The required fragment type. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) type_condition: Option, + pub(crate) type_condition: Option, /// The selections from the fragment. pub(crate) selections: Vec, @@ -74,17 +75,21 @@ pub(crate) fn execute_selection_set<'a>( name, selections, }) => { - let selection_name = alias.as_deref().unwrap_or(name.as_str()); + let selection_name = alias.as_ref().map(|a| a.as_str()).unwrap_or(name.as_str()); let field_type = current_type.and_then(|t| { - schema.definitions.types.get(t).and_then(|ty| match ty { - apollo_compiler::schema::ExtendedType::Object(o) => { - o.fields.get(name.as_str()).map(|f| &f.ty) - } - apollo_compiler::schema::ExtendedType::Interface(i) => { - i.fields.get(name.as_str()).map(|f| &f.ty) - } - _ => None, - }) + schema + .supergraph_schema() + .types + .get(t) + .and_then(|ty| match ty { + apollo_compiler::schema::ExtendedType::Object(o) => { + o.fields.get(name.as_str()).map(|f| &f.ty) + } + apollo_compiler::schema::ExtendedType::Interface(i) => { + i.fields.get(name.as_str()).map(|f| &f.ty) + } + _ => None, + }) }); match content.get_key_value(selection_name) { @@ -200,12 +205,12 @@ fn type_condition_matches( return true; } - let current_type = match schema.definitions.types.get(current_type) { + let current_type = match schema.supergraph_schema().types.get(current_type) { None => return false, Some(t) => t, }; - let conditional_type = match schema.definitions.types.get(type_condition) { + let conditional_type = match schema.supergraph_schema().types.get(type_condition) { None => return false, Some(t) => t, }; diff --git a/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__defer_if_condition-2.snap b/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__defer_if_condition-2.snap index 21eb4fc8de..eab1f2264a 100644 --- a/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__defer_if_condition-2.snap +++ b/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__defer_if_condition-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/query_planner/mod.rs +source: apollo-router/src/query_planner/tests.rs expression: deferred_response --- { diff --git a/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__query_plan_from_json.snap b/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__query_plan_from_json.snap index 24ee161d3f..ef8a64f2a6 100644 --- a/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__query_plan_from_json.snap +++ b/apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__query_plan_from_json.snap @@ -37,8 +37,11 @@ Sequence { [ Key( "topProducts", + None, + ), + Flatten( + None, ), - Flatten, ], ), node: Fetch( @@ -96,8 +99,11 @@ Sequence { [ Key( "topProducts", + None, + ), + Flatten( + None, ), - Flatten, ], ), node: Fetch( @@ -171,6 +177,7 @@ Sequence { [ Key( "product", + None, ), ], ), @@ -227,6 +234,7 @@ Sequence { [ Key( "product", + None, ), ], ), diff --git a/apollo-router/src/query_planner/subscription.rs b/apollo-router/src/query_planner/subscription.rs index 1d99b64208..caf90730e6 100644 --- a/apollo-router/src/query_planner/subscription.rs +++ b/apollo-router/src/query_planner/subscription.rs @@ -1,6 +1,7 @@ use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; +use apollo_compiler::NodeStr; use futures::future; use serde::Deserialize; use serde::Serialize; @@ -56,16 +57,16 @@ impl SubscriptionHandle { #[serde(rename_all = "camelCase")] pub(crate) struct SubscriptionNode { /// The name of the service or subgraph that the subscription is querying. - pub(crate) service_name: String, + pub(crate) service_name: NodeStr, /// The variables that are used for the subgraph subscription. - pub(crate) variable_usages: Vec, + pub(crate) variable_usages: Vec, /// The GraphQL subquery that is used for the subscription. - pub(crate) operation: String, + pub(crate) operation: super::fetch::SubgraphOperation, /// The GraphQL subquery operation name. - pub(crate) operation_name: Option, + pub(crate) operation_name: Option, /// The GraphQL operation kind that is used for the fetch. pub(crate) operation_kind: OperationKind, @@ -150,7 +151,7 @@ impl SubscriptionNode { subscription_handle, subscription_config, stream_rx: rx_handle.into(), - service_name: self.service_name.clone(), + service_name: self.service_name.to_string(), }; if let Err(err) = subscription_conf_tx.send(subs_params).await { @@ -200,7 +201,7 @@ impl SubscriptionNode { let Variables { variables, .. } = match Variables::new( &[], - self.variable_usages.as_ref(), + &self.variable_usages, data, current_dir, // Needs the original request here @@ -232,8 +233,8 @@ impl SubscriptionNode { ) .body( Request::builder() - .query(operation) - .and_operation_name(operation_name.clone()) + .query(operation.as_serialized()) + .and_operation_name(operation_name.as_ref().map(|n| n.to_string())) .variables(variables.clone()) .build(), ) @@ -242,7 +243,7 @@ impl SubscriptionNode { ) .operation_kind(OperationKind::Subscription) .context(parameters.context.clone()) - .subgraph_name(self.service_name.clone()) + .subgraph_name(self.service_name.to_string()) .subscription_stream(tx_gql) .and_connection_closed_signal(parameters.subscription_handle.as_ref().map(|s| s.closed_signal.resubscribe())) .build(); diff --git a/apollo-router/src/query_planner/tests.rs b/apollo-router/src/query_planner/tests.rs index c67a3b55d3..02cc1ce6c2 100644 --- a/apollo-router/src/query_planner/tests.rs +++ b/apollo-router/src/query_planner/tests.rs @@ -3,6 +3,7 @@ use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; use std::sync::Arc; +use apollo_compiler::name; use futures::StreamExt; use http::Method; use router_bridge::planner::UsageReporting; @@ -23,6 +24,7 @@ use crate::plugin; use crate::plugin::test::MockSubgraph; use crate::query_planner; use crate::query_planner::fetch::FetchNode; +use crate::query_planner::fetch::SubgraphOperation; use crate::query_planner::BridgeQueryPlanner; use crate::request; use crate::services::subgraph_service::MakeSubgraphService; @@ -253,16 +255,15 @@ async fn defer() { formatted_query_plan: Default::default(), root: PlanNode::Defer { primary: Primary { - path: None, subselection: Some("{ t { x } }".to_string()), node: Some(Box::new(PlanNode::Fetch(FetchNode { - service_name: "X".to_string(), + service_name: "X".into(), requires: vec![], variable_usages: vec![], - operation: "{ t { id __typename x } }".to_string(), - operation_name: Some("t".to_string()), + operation: SubgraphOperation::from_string("{ t { id __typename x } }"), + operation_name: Some("t".into()), operation_kind: OperationKind::Query, - id: Some("fetch1".to_string()), + id: Some("fetch1".into()), input_rewrites: None, output_rewrites: None, schema_aware_hash: Default::default(), @@ -271,31 +272,30 @@ async fn defer() { }, deferred: vec![DeferredNode { depends: vec![Depends { - id: "fetch1".to_string(), - defer_label: None, + id: "fetch1".into(), }], label: None, - query_path: Path(vec![PathElement::Key("t".to_string())]), + query_path: Path(vec![PathElement::Key("t".to_string(), None)]), subselection: Some("{ y }".to_string()), node: Some(Arc::new(PlanNode::Flatten(FlattenNode { - path: Path(vec![PathElement::Key("t".to_string())]), + path: Path(vec![PathElement::Key("t".to_string(), None)]), node: Box::new(PlanNode::Fetch(FetchNode { - service_name: "Y".to_string(), + service_name: "Y".into(), requires: vec![query_planner::selection::Selection::InlineFragment( query_planner::selection::InlineFragment { - type_condition: Some("T".into()), + type_condition: Some(name!("T")), selections: vec![ query_planner::selection::Selection::Field( query_planner::selection::Field { alias: None, - name: "id".into(), + name: name!("id"), selections: None, }, ), query_planner::selection::Selection::Field( query_planner::selection::Field { alias: None, - name: "__typename".into(), + name: name!("__typename"), selections: None, }, ), @@ -303,10 +303,12 @@ async fn defer() { }, )], variable_usages: vec![], - operation: "query($representations:[_Any!]!){_entities(representations:$representations){...on T{y}}}".to_string(), + operation: SubgraphOperation::from_string( + "query($representations:[_Any!]!){_entities(representations:$representations){...on T{y}}}" + ), operation_name: None, operation_kind: OperationKind::Query, - id: Some("fetch2".to_string()), + id: Some("fetch2".into()), input_rewrites: None, output_rewrites: None, schema_aware_hash: Default::default(), @@ -1780,3 +1782,39 @@ async fn typename_propagation3() { let response = stream.next_response().await.unwrap(); insta::assert_json_snapshot!(serde_json::to_value(&response).unwrap()); } + +#[test] +fn broken_plan_does_not_panic() { + let operation = "{ invalid }"; + let subgraph_schema = "type Query { field: Int }"; + let mut plan = QueryPlan { + root: PlanNode::Fetch(FetchNode { + service_name: "X".into(), + requires: vec![], + variable_usages: vec![], + operation: SubgraphOperation::from_string(operation), + operation_name: Some("t".into()), + operation_kind: OperationKind::Query, + id: Some("fetch1".into()), + input_rewrites: None, + output_rewrites: None, + schema_aware_hash: Default::default(), + authorization: Default::default(), + }), + formatted_query_plan: Default::default(), + usage_reporting: UsageReporting { + stats_report_key: "this is a test report key".to_string(), + referenced_fields_by_type: Default::default(), + } + .into(), + query: Arc::new(Query::empty()), + }; + let subgraph_schema = apollo_compiler::Schema::parse_and_validate(subgraph_schema, "").unwrap(); + let mut subgraph_schemas = HashMap::new(); + subgraph_schemas.insert("X".to_owned(), Arc::new(subgraph_schema)); + let result = plan.root.hash_subqueries(&subgraph_schemas, ""); + assert_eq!( + result.unwrap_err().to_string(), + r#"[1:3] Cannot query field "invalid" on type "Query"."# + ); +} diff --git a/apollo-router/src/router_factory.rs b/apollo-router/src/router_factory.rs index 8274993c10..85bef7ea84 100644 --- a/apollo-router/src/router_factory.rs +++ b/apollo-router/src/router_factory.rs @@ -518,7 +518,7 @@ pub(crate) async fn create_plugins( initial_telemetry_plugin: Option>, extra_plugins: Option)>>, ) -> Result { - let supergraph_schema = Arc::new(schema.definitions.clone()); + let supergraph_schema = Arc::new(schema.supergraph_schema().clone()); let mut apollo_plugins_config = configuration.apollo_plugins.clone().plugins; let user_plugins_config = configuration.plugins.clone().plugins.unwrap_or_default(); let extra = extra_plugins.unwrap_or_default(); @@ -742,7 +742,6 @@ mod test { use crate::router_factory::inject_schema_id; use crate::router_factory::RouterSuperServiceFactory; use crate::router_factory::YamlRouterFactory; - use crate::spec::Schema; #[derive(Debug)] struct PluginError; @@ -869,18 +868,16 @@ mod test { #[test] fn test_inject_schema_id() { - let schema = include_str!("testdata/starstuff@current.graphql"); let mut config = json!({ "apollo": {} }); - let schema = Schema::parse_test(schema, &Default::default()).unwrap(); inject_schema_id( - Some(&Schema::schema_id(&schema.api_schema().raw_sdl)), + Some("8e2021d131b23684671c3b85f82dfca836908c6a541bbd5c3772c66e7f8429d8"), &mut config, ); let config = serde_json::from_value::(config).unwrap(); assert_eq!( &config.apollo.schema_id, - "6af283f857f47055b0069547a8ee21c942c2c72ceebbcaabf78a42f0d1786318" + "8e2021d131b23684671c3b85f82dfca836908c6a541bbd5c3772c66e7f8429d8" ); } } diff --git a/apollo-router/src/services/external.rs b/apollo-router/src/services/external.rs index b1f0982a12..cf75320b62 100644 --- a/apollo-router/src/services/external.rs +++ b/apollo-router/src/services/external.rs @@ -20,8 +20,8 @@ use serde::Serialize; use strum_macros::Display; use tower::BoxError; use tower::Service; -use tracing_opentelemetry::OpenTelemetrySpanExt; +use crate::plugins::telemetry::otel::OpenTelemetrySpanExt; use crate::plugins::telemetry::reload::prepare_context; use crate::query_planner::QueryPlan; use crate::Context; diff --git a/apollo-router/src/services/http/service.rs b/apollo-router/src/services/http/service.rs index 89c95ec7cf..cb6eba3a34 100644 --- a/apollo-router/src/services/http/service.rs +++ b/apollo-router/src/services/http/service.rs @@ -31,7 +31,6 @@ use tower_http::decompression::Decompression; use tower_http::decompression::DecompressionBody; use tower_http::decompression::DecompressionLayer; use tracing::Instrument; -use tracing_opentelemetry::OpenTelemetrySpanExt; use super::HttpRequest; use super::HttpResponse; @@ -39,6 +38,7 @@ use crate::axum_factory::compression::Compressor; use crate::configuration::TlsClientAuth; use crate::error::FetchError; use crate::plugins::authentication::subgraph::SigningParamsConfig; +use crate::plugins::telemetry::otel::OpenTelemetrySpanExt; use crate::plugins::telemetry::reload::prepare_context; use crate::plugins::telemetry::LOGGING_DISPLAY_BODY; use crate::plugins::telemetry::LOGGING_DISPLAY_HEADERS; diff --git a/apollo-router/src/services/layers/query_analysis.rs b/apollo-router/src/services/layers/query_analysis.rs index 06794d9f69..70dc9c50b0 100644 --- a/apollo-router/src/services/layers/query_analysis.rs +++ b/apollo-router/src/services/layers/query_analysis.rs @@ -68,12 +68,7 @@ impl QueryAnalysisLayer { query: &str, operation_name: Option<&str>, ) -> Result { - Query::parse_document( - query, - operation_name, - self.schema.api_schema(), - &self.configuration, - ) + Query::parse_document(query, operation_name, &self.schema, &self.configuration) } pub(crate) async fn supergraph_request( diff --git a/apollo-router/src/services/subgraph.rs b/apollo-router/src/services/subgraph.rs index 661b2b0d86..59aafb8389 100644 --- a/apollo-router/src/services/subgraph.rs +++ b/apollo-router/src/services/subgraph.rs @@ -3,6 +3,7 @@ use std::pin::Pin; use std::sync::Arc; +use apollo_compiler::validation::Valid; use http::StatusCode; use http::Version; use multimap::MultiMap; @@ -58,6 +59,8 @@ pub struct Request { // authorization metadata for this request pub(crate) authorization: Arc, + + pub(crate) executable_document: Option>>, } #[buildstructor::buildstructor] @@ -85,6 +88,7 @@ impl Request { connection_closed_signal, query_hash: Default::default(), authorization: Default::default(), + executable_document: None, } } @@ -148,6 +152,7 @@ impl Clone for Request { .map(|s| s.resubscribe()), query_hash: self.query_hash.clone(), authorization: self.authorization.clone(), + executable_document: self.executable_document.clone(), } } } diff --git a/apollo-router/src/services/subgraph_service.rs b/apollo-router/src/services/subgraph_service.rs index e5666544f4..3e285ca664 100644 --- a/apollo-router/src/services/subgraph_service.rs +++ b/apollo-router/src/services/subgraph_service.rs @@ -59,6 +59,9 @@ use crate::plugins::subscription::SubscriptionConfig; use crate::plugins::subscription::SubscriptionMode; use crate::plugins::subscription::WebSocketConfiguration; use crate::plugins::subscription::SUBSCRIPTION_WS_CUSTOM_CONNECTION_PARAMS; +use crate::plugins::telemetry::config_new::events::log_event; +use crate::plugins::telemetry::config_new::events::SubgraphEventRequestLevel; +use crate::plugins::telemetry::config_new::events::SubgraphEventResponseLevel; use crate::plugins::telemetry::LOGGING_DISPLAY_BODY; use crate::plugins::telemetry::LOGGING_DISPLAY_HEADERS; use crate::protocols::websocket::convert_websocket_stream; @@ -537,6 +540,38 @@ async fn call_websocket( request }; + let subgraph_request_event = context + .extensions() + .lock() + .get::() + .cloned(); + if let Some(level) = subgraph_request_event { + let mut attrs = HashMap::with_capacity(5); + attrs.insert( + "http.request.headers".to_string(), + format!("{:?}", request.headers()), + ); + attrs.insert( + "http.request.method".to_string(), + format!("{}", request.method()), + ); + attrs.insert( + "http.request.version".to_string(), + format!("{:?}", request.version()), + ); + attrs.insert( + "http.request.body".to_string(), + serde_json::to_string(request.body()).unwrap_or_default(), + ); + attrs.insert("subgraph.name".to_string(), service_name.to_string()); + log_event( + level.0, + "subgraph.request", + attrs, + &format!("Websocket request body to subgraph {service_name:?}"), + ); + } + if display_headers { tracing::info!(http.request.headers = ?request.headers(), apollo.subgraph.name = %service_name, "Websocket request headers to subgraph {service_name:?}"); } @@ -795,6 +830,40 @@ pub(crate) async fn process_batch( .instrument(subgraph_req_span) .await?; + let subgraph_response_event = context + .extensions() + .lock() + .get::() + .cloned(); + if let Some(level) = subgraph_response_event { + let mut attrs = HashMap::with_capacity(5); + attrs.insert( + "http.response.headers".to_string(), + format!("{:?}", parts.headers), + ); + attrs.insert( + "http.response.status".to_string(), + format!("{}", parts.status), + ); + attrs.insert( + "http.response.version".to_string(), + format!("{:?}", parts.version), + ); + if let Some(Ok(b)) = &body { + attrs.insert( + "http.response.body".to_string(), + String::from_utf8_lossy(b).to_string(), + ); + } + attrs.insert("subgraph.name".to_string(), service.clone()); + log_event( + level.0, + "subgraph.response", + attrs, + &format!("Raw response from subgraph {service:?} received"), + ); + } + if display_body { if let Some(Ok(b)) = &body { tracing::info!( @@ -1106,12 +1175,79 @@ pub(crate) async fn call_single_http( // TODO: Temporary solution to plug FileUploads plugin until 'http_client' will be fixed https://github.com/apollographql/router/pull/4666 let request = file_uploads::http_request_wrapper(request).await; + let subgraph_request_event = context + .extensions() + .lock() + .get::() + .cloned(); + if let Some(level) = subgraph_request_event { + let mut attrs = HashMap::with_capacity(5); + attrs.insert( + "http.request.headers".to_string(), + format!("{:?}", request.headers()), + ); + attrs.insert( + "http.request.method".to_string(), + format!("{}", request.method()), + ); + attrs.insert( + "http.request.version".to_string(), + format!("{:?}", request.version()), + ); + attrs.insert( + "http.request.body".to_string(), + format!("{:?}", request.body()), + ); + attrs.insert("subgraph.name".to_string(), service_name.to_string()); + + log_event( + level.0, + "subgraph.request", + attrs, + &format!("Request to subgraph {service_name:?}"), + ); + } + // Perform the actual fetch. If this fails then we didn't manage to make the call at all, so we can't do anything with it. let (parts, content_type, body) = do_fetch(client, &context, service_name, request, display_body) .instrument(subgraph_req_span) .await?; + let subgraph_response_event = context + .extensions() + .lock() + .get::() + .cloned(); + if let Some(level) = subgraph_response_event { + let mut attrs = HashMap::with_capacity(5); + attrs.insert( + "http.response.headers".to_string(), + format!("{:?}", parts.headers), + ); + attrs.insert( + "http.response.status".to_string(), + format!("{}", parts.status), + ); + attrs.insert( + "http.response.version".to_string(), + format!("{:?}", parts.version), + ); + if let Some(Ok(b)) = &body { + attrs.insert( + "http.response.body".to_string(), + String::from_utf8_lossy(b).to_string(), + ); + } + attrs.insert("subgraph.name".to_string(), service_name.to_string()); + log_event( + level.0, + "subgraph.response", + attrs, + &format!("Raw response from subgraph {service_name:?} received"), + ); + } + if display_body { if let Some(Ok(b)) = &body { tracing::info!( diff --git a/apollo-router/src/services/supergraph/service.rs b/apollo-router/src/services/supergraph/service.rs index 426256536b..dc5807f272 100644 --- a/apollo-router/src/services/supergraph/service.rs +++ b/apollo-router/src/services/supergraph/service.rs @@ -1,5 +1,6 @@ //! Implements the router phase of the request lifecycle. +use std::collections::HashMap; use std::sync::atomic::Ordering; use std::sync::Arc; use std::task::Poll; @@ -33,6 +34,8 @@ use crate::graphql::IntoGraphQLErrors; use crate::graphql::Response; use crate::plugin::DynPlugin; use crate::plugins::subscription::SubscriptionConfig; +use crate::plugins::telemetry::config_new::events::log_event; +use crate::plugins::telemetry::config_new::events::SupergraphEventResponseLevel; use crate::plugins::telemetry::tracing::apollo_telemetry::APOLLO_PRIVATE_DURATION_NS; use crate::plugins::telemetry::Telemetry; use crate::plugins::telemetry::LOGGING_DISPLAY_BODY; @@ -251,9 +254,10 @@ async fn service_call( return Ok(response); } // Now perform query batch analysis - let batching = context.extensions().lock().get::().cloned(); - if let Some(batch_query) = batching { - let query_hashes = plan.query_hashes(operation_name.as_deref(), &variables)?; + let batch_query_opt = context.extensions().lock().get::().cloned(); + if let Some(batch_query) = batch_query_opt { + let query_hashes = + plan.query_hashes(batching, operation_name.as_deref(), &variables)?; batch_query .set_query_hashes(query_hashes) .await @@ -336,10 +340,44 @@ async fn service_call( let (parts, response_stream) = response.into_parts(); - Ok(SupergraphResponse { - context, - response: http::Response::from_parts(parts, response_stream.boxed()), - }) + let supergraph_response_event = context + .extensions() + .lock() + .get::() + .cloned(); + match supergraph_response_event { + Some(level) => { + let mut attrs = HashMap::with_capacity(4); + attrs.insert( + "http.response.headers".to_string(), + format!("{:?}", parts.headers), + ); + attrs.insert( + "http.response.status".to_string(), + format!("{}", parts.status), + ); + attrs.insert( + "http.response.version".to_string(), + format!("{:?}", parts.version), + ); + let response_stream = Box::pin(response_stream.inspect(move |resp| { + attrs.insert( + "http.response.body".to_string(), + serde_json::to_string(resp).unwrap_or_default(), + ); + log_event(level.0, "supergraph.response", attrs.clone(), ""); + })); + + Ok(SupergraphResponse { + context, + response: http::Response::from_parts(parts, response_stream.boxed()), + }) + } + None => Ok(SupergraphResponse { + context, + response: http::Response::from_parts(parts, response_stream.boxed()), + }), + } } } // This should never happen because if we have an empty query plan we should have error in errors vec diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__deferred_fragment_bounds_nullability-2.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__deferred_fragment_bounds_nullability-2.snap index 524ed427a0..dcb6bc3887 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__deferred_fragment_bounds_nullability-2.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__deferred_fragment_bounds_nullability-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: stream.next_response().await.unwrap() --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_from_primary_on_deferred_responses-2.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_from_primary_on_deferred_responses-2.snap index 54d405aa47..36f064b496 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_from_primary_on_deferred_responses-2.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_from_primary_on_deferred_responses-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: stream.next_response().await.unwrap() --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_deferred_responses-2.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_deferred_responses-2.snap index d8caf74cb3..d487599dc5 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_deferred_responses-2.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_deferred_responses-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: stream.next_response().await.unwrap() --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_incremental_responses-2.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_incremental_responses-2.snap index 40dd3d4613..c36f465d70 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_incremental_responses-2.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_incremental_responses-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: stream.next_response().await.unwrap() --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_nullified_paths.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_nullified_paths.snap index 6783b413d2..bf618438ad 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_nullified_paths.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_nullified_paths.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: stream.next_response().await.unwrap() --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__filter_nullified_deferred_responses-2.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__filter_nullified_deferred_responses-2.snap index f22604662c..9460daa1b0 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__filter_nullified_deferred_responses-2.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__filter_nullified_deferred_responses-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: deferred --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__nullability_bubbling.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__nullability_bubbling.snap index ae9c470126..348a89b2c4 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__nullability_bubbling.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__nullability_bubbling.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: response --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__reconstruct_deferred_query_under_interface-2.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__reconstruct_deferred_query_under_interface-2.snap index b40d41ef1a..103a37aa71 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__reconstruct_deferred_query_under_interface-2.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__reconstruct_deferred_query_under_interface-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: stream.next_response().await.unwrap() --- { diff --git a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_typename_with_defer-2.snap b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_typename_with_defer-2.snap index 5862863f46..b023c966b1 100644 --- a/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_typename_with_defer-2.snap +++ b/apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_typename_with_defer-2.snap @@ -1,5 +1,5 @@ --- -source: apollo-router/src/services/supergraph_service.rs +source: apollo-router/src/services/supergraph/tests.rs expression: stream.next_response().await.unwrap() --- { diff --git a/apollo-router/src/spec/field_type.rs b/apollo-router/src/spec/field_type.rs index 771a6bfd25..e14dc10b05 100644 --- a/apollo-router/src/spec/field_type.rs +++ b/apollo-router/src/spec/field_type.rs @@ -126,7 +126,7 @@ fn validate_input_value( _ => {} } let type_def = schema - .definitions + .supergraph_schema() .types .get(type_name) .ok_or(InvalidValue)?; diff --git a/apollo-router/src/spec/query.rs b/apollo-router/src/spec/query.rs index 9f0170284c..b8d158cce4 100644 --- a/apollo-router/src/spec/query.rs +++ b/apollo-router/src/spec/query.rs @@ -35,6 +35,7 @@ use crate::query_planner::fetch::OperationKind; use crate::query_planner::fetch::QueryHash; use crate::services::layers::query_analysis::ParsedDocument; use crate::services::layers::query_analysis::ParsedDocumentInner; +use crate::spec::schema::ApiSchema; use crate::spec::FieldType; use crate::spec::Fragments; use crate::spec::InvalidValue; @@ -123,7 +124,7 @@ impl Query { response: &mut Response, operation_name: Option<&str>, variables: Object, - schema: &Schema, + schema: &ApiSchema, defer_conditions: BooleanValues, ) -> Vec { let data = std::mem::take(&mut response.data); @@ -156,7 +157,7 @@ impl Query { .then(|| *op.kind()) }); if let Some(operation_kind) = operation_kind_if_root_typename { - output.insert(TYPENAME, operation_kind.as_str().into()); + output.insert(TYPENAME, operation_kind.default_type_name().into()); } response.data = Some( @@ -203,7 +204,10 @@ impl Query { .collect() }; - let operation_type_name = schema.root_operation_name(operation.kind); + let operation_type_name = schema + .root_operation(operation.kind.into()) + .map(|name| name.as_str()) + .unwrap_or(operation.kind.default_type_name()); let mut parameters = FormatParameters { variables: &all_variables, schema, @@ -247,7 +251,7 @@ impl Query { response.data = match operation_kind_if_root_typename { Some(operation_kind) => { let mut output = Object::default(); - output.insert(TYPENAME, operation_kind.as_str().into()); + output.insert(TYPENAME, operation_kind.default_type_name().into()); Some(output.into()) } None => Some(Value::default()), @@ -280,9 +284,9 @@ impl Query { return Err(SpecError::ParseError(errors.into())); } }; + let api_schema = schema.api_schema(); - let api_schema_definitions = &api_schema.definitions; - let executable_document = match ast.to_executable_validate(api_schema_definitions) { + let executable_document = match ast.to_executable_validate(api_schema) { Ok(doc) => doc, Err(errors) => { return Err(SpecError::ValidationError(errors.into())); @@ -294,8 +298,8 @@ impl Query { tracing::trace!(?recursion_limit, "recursion limit data"); let hash = QueryHashVisitor::hash_query( - api_schema_definitions, - &api_schema.raw_sdl, + schema.supergraph_schema(), + &schema.raw_sdl, &executable_document, operation_name, ) @@ -350,7 +354,8 @@ impl Query { .map(|operation| Operation::from_hir(operation, schema, &mut defer_stats, &fragments)) .collect::, SpecError>>()?; - let mut visitor = QueryHashVisitor::new(&schema.definitions, &schema.raw_sdl, document); + let mut visitor = + QueryHashVisitor::new(schema.supergraph_schema(), &schema.raw_sdl, document); traverse::document(&mut visitor, document, operation_name).map_err(|e| { SpecError::QueryHashing(format!("could not calculate the query hash: {e}")) })?; @@ -511,7 +516,7 @@ impl Query { executable::Type::Named(type_name) => { // we cannot know about the expected format of custom scalars // so we must pass them directly to the client - match parameters.schema.definitions.types.get(type_name) { + match parameters.schema.types.get(type_name) { Some(ExtendedType::Scalar(_)) => { *output = input.clone(); return Ok(()); @@ -546,7 +551,7 @@ impl Query { // some subgraph can have returned a __typename that is the name of an interface in the supergraph, and this is fine (that is, we should not // return such a __typename to the user, but as long as it's not returned, having it in the internal data is ok and sometimes expected). let Some(ExtendedType::Object(_) | ExtendedType::Interface(_)) = - parameters.schema.definitions.types.get(input_type) + parameters.schema.types.get(input_type) else { parameters.nullified.push(Path::from_response_slice(path)); *output = Value::Null; @@ -573,10 +578,12 @@ impl Query { let current_type = if parameters .schema - .is_interface(field_type.inner_named_type().as_str()) + .get_interface(field_type.inner_named_type()) + .is_some() || parameters .schema - .is_union(field_type.inner_named_type().as_str()) + .get_union(field_type.inner_named_type()) + .is_some() { typename.as_ref().unwrap_or(field_type) } else { @@ -648,12 +655,7 @@ impl Query { )) }); if let Some(input_str) = input_value.as_str() { - if parameters - .schema - .definitions - .get_object(input_str) - .is_some() - { + if parameters.schema.get_object(input_str).is_some() { output.insert((*field_name).clone(), input_value); } else { return Err(InvalidValue); @@ -1098,7 +1100,7 @@ struct FormatParameters<'a> { variables: &'a Object, errors: Vec, nullified: Vec, - schema: &'a Schema, + schema: &'a ApiSchema, } #[derive(Debug, Serialize, Deserialize)] diff --git a/apollo-router/src/spec/query/tests.rs b/apollo-router/src/spec/query/tests.rs index 4869910d46..a73bc025dd 100644 --- a/apollo-router/src/spec/query/tests.rs +++ b/apollo-router/src/spec/query/tests.rs @@ -3460,7 +3460,7 @@ fn it_parses_default_floats() { let schema = Schema::parse_test(&schema, &Default::default()).unwrap(); let value = schema - .definitions + .supergraph_schema() .get_input_object("WithAllKindsOfFloats") .unwrap() .fields["a_float_that_doesnt_fit_an_int"] @@ -5323,7 +5323,6 @@ fn parse_introspection_query() { let schema = with_supergraph_boilerplate(schema, "Query"); let schema = Schema::parse_test(&schema, &Default::default()).expect("could not parse schema"); - let api_schema = schema.api_schema(); let query = "{ __type(name: \"Bar\") { @@ -5336,7 +5335,7 @@ fn parse_introspection_query() { } } }"; - assert!(Query::parse(query, None, api_schema, &Default::default()) + assert!(Query::parse(query, None, &schema, &Default::default()) .unwrap() .operations .first() @@ -5351,7 +5350,7 @@ fn parse_introspection_query() { } }"; - assert!(Query::parse(query, None, api_schema, &Default::default()) + assert!(Query::parse(query, None, &schema, &Default::default()) .unwrap() .operations .first() @@ -5362,7 +5361,7 @@ fn parse_introspection_query() { __typename }"; - assert!(Query::parse(query, None, api_schema, &Default::default()) + assert!(Query::parse(query, None, &schema, &Default::default()) .unwrap() .operations .first() @@ -5836,7 +5835,7 @@ fn filtered_defer_fragment() { let ast = Parser::new() .parse_ast(filtered_query, "filtered_query.graphql") .unwrap(); - let doc = ast.to_executable(&schema.definitions).unwrap(); + let doc = ast.to_executable(schema.supergraph_schema()).unwrap(); let (fragments, operations, defer_stats, schema_aware_hash) = Query::extract_query_information(&schema, &doc, None).unwrap(); @@ -5862,7 +5861,7 @@ fn filtered_defer_fragment() { let ast = Parser::new() .parse_ast(filtered_query, "filtered_query.graphql") .unwrap(); - let doc = ast.to_executable(&schema.definitions).unwrap(); + let doc = ast.to_executable(schema.supergraph_schema()).unwrap(); let (fragments, operations, defer_stats, schema_aware_hash) = Query::extract_query_information(&schema, &doc, None).unwrap(); @@ -5900,7 +5899,7 @@ fn filtered_defer_fragment() { &mut response, None, Object::new(), - &schema, + schema.api_schema(), BooleanValues { bits: 0 }, ); @@ -5910,7 +5909,7 @@ fn filtered_defer_fragment() { &mut response, None, Object::new(), - &schema, + schema.api_schema(), BooleanValues { bits: 0 }, ); diff --git a/apollo-router/src/spec/schema.rs b/apollo-router/src/spec/schema.rs index 20df362070..3a8eb716fc 100644 --- a/apollo-router/src/spec/schema.rs +++ b/apollo-router/src/spec/schema.rs @@ -14,36 +14,38 @@ use semver::VersionReq; use sha2::Digest; use sha2::Sha256; +use crate::configuration::ApiSchemaMode; +use crate::configuration::QueryPlannerMode; use crate::error::ParseErrors; use crate::error::SchemaError; use crate::query_planner::OperationKind; use crate::Configuration; /// A GraphQL schema. -#[derive(Debug)] pub(crate) struct Schema { pub(crate) raw_sdl: Arc, - pub(crate) definitions: Valid, + supergraph: Supergraph, subgraphs: HashMap, pub(crate) implementers_map: HashMap, - api_schema: Option>, + api_schema: Option, +} + +/// TODO: remove and use apollo_federation::Supergraph unconditionally +/// when weโ€™re more confident in its constructor +enum Supergraph { + ApolloFederation(apollo_federation::Supergraph), + ApolloCompiler(Valid), } +/// Wrapper type to distinguish from `Schema::definitions` for the supergraph schema +#[derive(Debug)] +pub(crate) struct ApiSchema(pub(crate) Valid); + impl Schema { #[cfg(test)] pub(crate) fn parse_test(s: &str, configuration: &Configuration) -> Result { - let schema = Self::parse(s)?; - let api_schema = Self::parse( - &schema - .create_api_schema(configuration) - // Avoid adding an error branch that's only used in tests--stick the error - // string in an existing generic one - .map_err(|err| { - SchemaError::Api(format!( - "The supergraph schema failed to produce a valid API schema: {err}" - )) - })?, - )?; + let schema = Self::parse(s, configuration)?; + let api_schema = Self::parse_compiler_schema(&schema.create_api_schema(configuration)?)?; Ok(schema.with_api_schema(api_schema)) } @@ -62,15 +64,17 @@ impl Schema { }) } - pub(crate) fn parse(sdl: &str) -> Result { + pub(crate) fn parse_compiler_schema( + sdl: &str, + ) -> Result, SchemaError> { + Self::parse_ast(sdl)? + .to_schema_validate() + .map_err(|errors| SchemaError::Validate(errors.into())) + } + + pub(crate) fn parse(sdl: &str, config: &Configuration) -> Result { let start = Instant::now(); - let ast = Self::parse_ast(sdl)?; - let definitions = match ast.to_schema_validate() { - Ok(schema) => schema, - Err(errors) => { - return Err(SchemaError::Validate(errors.into())); - } - }; + let definitions = Self::parse_compiler_schema(sdl)?; let mut subgraphs = HashMap::new(); // TODO: error if not found? @@ -109,21 +113,46 @@ impl Schema { } } - tracing::info!( - histogram.apollo.router.schema.load.duration = start.elapsed().as_secs_f64() + f64_histogram!( + "apollo.router.schema.load.duration", + "Time spent loading the supergraph schema.", + start.elapsed().as_secs_f64() ); let implementers_map = definitions.implementers_map(); + let legacy_only = config.experimental_query_planner_mode == QueryPlannerMode::Legacy + && config.experimental_api_schema_generation_mode == ApiSchemaMode::Legacy; + let supergraph = if cfg!(test) || !legacy_only { + Supergraph::ApolloFederation(apollo_federation::Supergraph::from_schema(definitions)?) + } else { + Supergraph::ApolloCompiler(definitions) + }; Ok(Schema { raw_sdl: Arc::new(sdl.to_owned()), - definitions, + supergraph, subgraphs, implementers_map, api_schema: None, }) } + pub(crate) fn federation_supergraph(&self) -> &apollo_federation::Supergraph { + // This is only called in cases wher we create ApolloFederation above + #[allow(clippy::panic)] + match &self.supergraph { + Supergraph::ApolloFederation(s) => s, + Supergraph::ApolloCompiler(_) => panic!("expected an apollo-federation supergraph"), + } + } + + pub(crate) fn supergraph_schema(&self) -> &Valid { + match &self.supergraph { + Supergraph::ApolloFederation(s) => s.schema.schema(), + Supergraph::ApolloCompiler(s) => s, + } + } + pub(crate) fn schema_id(sdl: &str) -> String { let mut hasher = Sha256::new(); hasher.update(sdl.as_bytes()); @@ -133,36 +162,40 @@ impl Schema { pub(crate) fn create_api_schema( &self, configuration: &Configuration, - ) -> Result { + ) -> Result { use apollo_federation::ApiSchemaOptions; - use apollo_federation::Supergraph; - let schema = Supergraph::from_schema(self.definitions.clone())?; - let api_schema = schema.to_api_schema(ApiSchemaOptions { - include_defer: configuration.supergraph.defer_support, - ..Default::default() - })?; + let api_schema = self + .federation_supergraph() + .to_api_schema(ApiSchemaOptions { + include_defer: configuration.supergraph.defer_support, + ..Default::default() + }) + .map_err(|e| { + SchemaError::Api(format!( + "The supergraph schema failed to produce a valid API schema: {e}" + )) + })?; Ok(api_schema.schema().to_string()) } - pub(crate) fn with_api_schema(mut self, api_schema: Schema) -> Self { - self.api_schema = Some(Box::new(api_schema)); + pub(crate) fn with_api_schema(mut self, api_schema: Valid) -> Self { + self.api_schema = Some(ApiSchema(api_schema)); self } -} -impl Schema { /// Extracts a string containing the entire [`Schema`]. pub(crate) fn as_string(&self) -> &Arc { &self.raw_sdl } pub(crate) fn is_subtype(&self, abstract_type: &str, maybe_subtype: &str) -> bool { - self.definitions.is_subtype(abstract_type, maybe_subtype) + self.supergraph_schema() + .is_subtype(abstract_type, maybe_subtype) } pub(crate) fn is_implementation(&self, interface: &str, implementor: &str) -> bool { - self.definitions + self.supergraph_schema() .get_interface(interface) .map(|interface| { // FIXME: this looks backwards @@ -172,11 +205,9 @@ impl Schema { } pub(crate) fn is_interface(&self, abstract_type: &str) -> bool { - self.definitions.get_interface(abstract_type).is_some() - } - - pub(crate) fn is_union(&self, abstract_type: &str) -> bool { - self.definitions.get_union(abstract_type).is_some() + self.supergraph_schema() + .get_interface(abstract_type) + .is_some() } // given two field, returns the one that implements the other, if applicable @@ -209,25 +240,27 @@ impl Schema { self.subgraphs.get(service_name) } - pub(crate) fn api_schema(&self) -> &Schema { + // TODO: make `self.api_schema` non-optional after we move to Rust-only API schema generation + #[allow(clippy::panic)] + pub(crate) fn api_schema(&self) -> &ApiSchema { match &self.api_schema { Some(schema) => schema, - None => self, + None => panic!("missing API schema"), } } pub(crate) fn root_operation_name(&self, kind: OperationKind) -> &str { - if let Some(name) = self.definitions.root_operation(kind.into()) { + if let Some(name) = self.supergraph_schema().root_operation(kind.into()) { name.as_str() } else { - kind.as_str() + kind.default_type_name() } } /// Return the federation major version based on the @link or @core directives in the schema, /// or None if there are no federation directives. pub(crate) fn federation_version(&self) -> Option { - for directive in &self.definitions.schema_definition.directives { + for directive in &self.supergraph_schema().schema_definition.directives { let join_url = if directive.name == "core" { let Some(feature) = directive .argument_by_name("feature") @@ -260,7 +293,7 @@ impl Schema { } pub(crate) fn has_spec(&self, base_url: &str, expected_version_range: &str) -> bool { - self.definitions + self.supergraph_schema() .schema_definition .directives .iter() @@ -336,9 +369,34 @@ impl Schema { } } +impl std::fmt::Debug for Schema { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let Self { + raw_sdl, + supergraph: _, // skip + subgraphs, + implementers_map, + api_schema: _, // skip + } = self; + f.debug_struct("Schema") + .field("raw_sdl", raw_sdl) + .field("subgraphs", subgraphs) + .field("implementers_map", implementers_map) + .finish() + } +} + #[derive(Debug)] pub(crate) struct InvalidObject; +impl std::ops::Deref for ApiSchema { + type Target = Valid; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + #[cfg(test)] mod tests { use super::*; @@ -515,16 +573,15 @@ mod tests { fn api_schema() { let schema = include_str!("../testdata/contract_schema.graphql"); let schema = Schema::parse_test(schema, &Default::default()).unwrap(); - let has_in_stock_field = |schema: &Schema| { + let has_in_stock_field = |schema: &apollo_compiler::Schema| { schema - .definitions .get_object("Product") .unwrap() .fields .contains_key("inStock") }; - assert!(has_in_stock_field(&schema)); - assert!(!has_in_stock_field(schema.api_schema.as_ref().unwrap())); + assert!(has_in_stock_field(schema.supergraph_schema())); + assert!(!has_in_stock_field(schema.api_schema())); } #[test] @@ -557,11 +614,6 @@ mod tests { Schema::schema_id(&schema.raw_sdl), "8e2021d131b23684671c3b85f82dfca836908c6a541bbd5c3772c66e7f8429d8".to_string() ); - - assert_eq!( - Schema::schema_id(&schema.api_schema().raw_sdl), - "6af283f857f47055b0069547a8ee21c942c2c72ceebbcaabf78a42f0d1786318".to_string() - ); } } diff --git a/apollo-router/src/spec/selection.rs b/apollo-router/src/spec/selection.rs index b82447ea36..e06145e051 100644 --- a/apollo-router/src/spec/selection.rs +++ b/apollo-router/src/spec/selection.rs @@ -207,7 +207,7 @@ impl Selection { match (path.first(), self) { (None, _) => true, ( - Some(PathElement::Key(key)), + Some(PathElement::Key(key, _)), Selection::Field { name, alias, @@ -265,10 +265,10 @@ impl Selection { false } } - (Some(PathElement::Index(_)), _) | (Some(PathElement::Flatten), _) => { + (Some(PathElement::Index(_)), _) | (Some(PathElement::Flatten(_)), _) => { self.contains_error_path(&path[1..], fragments) } - (Some(PathElement::Key(_)), Selection::InlineFragment { selection_set, .. }) => { + (Some(PathElement::Key(_, _)), Selection::InlineFragment { selection_set, .. }) => { selection_set .iter() .any(|selection| selection.contains_error_path(path, fragments)) diff --git a/apollo-router/src/tracer.rs b/apollo-router/src/tracer.rs index a846b240ac..d90341c5ba 100644 --- a/apollo-router/src/tracer.rs +++ b/apollo-router/src/tracer.rs @@ -7,7 +7,8 @@ use opentelemetry::trace::TraceContextExt; use serde::Deserialize; use serde::Serialize; use tracing::Span; -use tracing_opentelemetry::OpenTelemetrySpanExt; + +use crate::plugins::telemetry::otel::OpenTelemetrySpanExt; /// Trace ID #[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] @@ -59,6 +60,7 @@ mod test { use tracing_subscriber::Registry; use super::TraceId; + use crate::plugins::telemetry::otel; // If we try to run more than one test concurrently which relies on the existence of a pipeline, // then the tests will fail due to manipulation of global state in the opentelemetry crates. @@ -101,7 +103,7 @@ mod test { .build(); let tracer = provider.versioned_tracer("noop", None::, None::, None); - let telemetry = tracing_opentelemetry::layer().with_tracer(tracer); + let telemetry = otel::layer().with_tracer(tracer); // Use the tracing subscriber `Registry`, or any other subscriber // that impls `LookupSpan` let subscriber = Registry::default().with(telemetry); @@ -125,7 +127,7 @@ mod test { .with_simple_exporter(opentelemetry_stdout::SpanExporter::default()) .build(); let tracer = provider.versioned_tracer("noop", None::, None::, None); - let telemetry = tracing_opentelemetry::layer().with_tracer(tracer); + let telemetry = otel::layer().with_tracer(tracer); // Use the tracing subscriber `Registry`, or any other subscriber // that impls `LookupSpan` let subscriber = Registry::default().with(telemetry); @@ -150,7 +152,7 @@ mod test { .with_simple_exporter(opentelemetry_stdout::SpanExporter::default()) .build(); let tracer = provider.versioned_tracer("noop", None::, None::, None); - let telemetry = tracing_opentelemetry::layer().with_tracer(tracer); + let telemetry = otel::layer().with_tracer(tracer); // Use the tracing subscriber `Registry`, or any other subscriber // that impls `LookupSpan` let subscriber = Registry::default().with(telemetry); diff --git a/apollo-router/src/uplink/testdata/restricted.router.yaml b/apollo-router/src/uplink/testdata/restricted.router.yaml index 4d893912fd..ab99114f4e 100644 --- a/apollo-router/src/uplink/testdata/restricted.router.yaml +++ b/apollo-router/src/uplink/testdata/restricted.router.yaml @@ -80,4 +80,8 @@ preview_file_uploads: experimental_demand_control: enabled: true - algorithm: basic \ No newline at end of file + mode: measure + strategy: + static_estimated: + list_size: 30 + max: 256 diff --git a/apollo-router/tests/common.rs b/apollo-router/tests/common.rs index 526b5f8cfd..84ec7a5434 100644 --- a/apollo-router/tests/common.rs +++ b/apollo-router/tests/common.rs @@ -4,6 +4,8 @@ use std::net::SocketAddr; use std::net::TcpListener; use std::path::PathBuf; use std::process::Stdio; +use std::sync::Arc; +use std::sync::Mutex; use std::time::Duration; use buildstructor::buildstructor; @@ -33,6 +35,7 @@ use opentelemetry_otlp::Protocol; use opentelemetry_otlp::SpanExporterBuilder; use opentelemetry_otlp::WithExportConfig; use opentelemetry_semantic_conventions::resource::SERVICE_NAME; +use regex::Regex; use reqwest::Request; use serde_json::json; use serde_json::Value; @@ -77,7 +80,16 @@ pub struct IntegrationTest { subscriber_client: Dispatch, _subgraph_overrides: HashMap, - pub bind_address: SocketAddr, + bind_address: Arc>>, +} + +impl IntegrationTest { + pub(crate) fn bind_address(&self) -> SocketAddr { + self.bind_address + .lock() + .expect("lock poisoned") + .expect("no bind address set, router must be started first.") + } } struct TracedResponder { @@ -272,18 +284,8 @@ impl IntegrationTest { // Add a default override for products, if not specified subgraph_overrides.entry("products".into()).or_insert(url); - // Bind to a random port - // Note: This might still fail if a different process binds to the port found here - // before the router is started. - // Note: We need the nested scope so that the listener gets dropped once its address - // is resolved. - let bind_address = { - let bound = TcpListener::bind(SocketAddr::from(([127, 0, 0, 1], 0))).unwrap(); - bound.local_addr().unwrap() - }; - // Insert the overrides into the config - let config_str = merge_overrides(&config, &subgraph_overrides, &bind_address); + let config_str = merge_overrides(&config, &subgraph_overrides, None); let supergraph = supergraph.unwrap_or(PathBuf::from_iter([ "..", @@ -327,7 +329,7 @@ impl IntegrationTest { supergraph, _subgraphs: subgraphs, _subgraph_overrides: subgraph_overrides, - bind_address, + bind_address: Default::default(), _tracer_provider_client: tracer_provider_client, subscriber_client, _tracer_provider_subgraph: tracer_provider_subgraph, @@ -381,12 +383,23 @@ impl IntegrationTest { let reader = BufReader::new(router.stdout.take().expect("out")); let stdio_tx = self.stdio_tx.clone(); let collect_stdio = self.collect_stdio.take(); + let bind_address = self.bind_address.clone(); + let bind_address_regex = + Regex::new(r".*GraphQL endpoint exposed at http://(?
[^/]+).*").unwrap(); // We need to read from stdout otherwise we will hang task::spawn(async move { let mut collected = Vec::new(); let mut lines = reader.lines(); while let Ok(Some(line)) = lines.next_line().await { println!("{line}"); + + // Extract the bind address from a log line that looks like this: GraphQL endpoint exposed at http://127.0.0.1:51087/ + if let Some(captures) = bind_address_regex.captures(&line) { + let address = captures.name("address").unwrap().as_str(); + let mut bind_address = bind_address.lock().unwrap(); + *bind_address = Some(address.parse().unwrap()); + } + if let Some((_sender, version_line_re)) = &collect_stdio { #[derive(serde::Deserialize)] struct Log { @@ -443,7 +456,7 @@ impl IntegrationTest { pub async fn update_config(&self, yaml: &str) { tokio::fs::write( &self.test_config_location, - &merge_overrides(yaml, &self._subgraph_overrides, &self.bind_address), + &merge_overrides(yaml, &self._subgraph_overrides, Some(self.bind_address())), ) .await .expect("must be able to write config"); @@ -500,7 +513,7 @@ impl IntegrationTest { let telemetry = self.telemetry.clone(); let query = query.clone(); - let url = format!("http://{}", self.bind_address); + let url = format!("http://{}", self.bind_address()); async move { let span = info_span!("client_request"); @@ -518,6 +531,7 @@ impl IntegrationTest { .header("apollographql-client-name", "custom_name") .header("apollographql-client-version", "1.0") .header("x-my-header", "test") + .header("head", "test") .json(&query) .build() .unwrap(); @@ -546,7 +560,7 @@ impl IntegrationTest { "router was not started, call `router.start().await; router.assert_started().await`" ); let query = query.clone(); - let url = format!("http://{}", self.bind_address); + let url = format!("http://{}", self.bind_address()); async move { let client = reqwest::Client::new(); @@ -593,7 +607,7 @@ impl IntegrationTest { "router was not started, call `router.start().await; router.assert_started().await`" ); - let url = format!("http://{}", self.bind_address); + let url = format!("http://{}", self.bind_address()); async move { let span = info_span!("client_raw_request"); let span_id = span.context().span().span_context().trace_id().to_string(); @@ -652,7 +666,7 @@ impl IntegrationTest { let _span_guard = span.enter(); let mut request = client - .post(format!("http://{}", self.bind_address)) + .post(format!("http://{}", self.bind_address())) .header(CONTENT_TYPE, APPLICATION_JSON.essence_str()) .header(ACCEPT, "multipart/mixed;subscriptionSpec=1.0") .header("apollographql-client-name", "custom_name") @@ -681,7 +695,7 @@ impl IntegrationTest { let client = reqwest::Client::new(); let request = client - .get(format!("http://{}/metrics", self.bind_address)) + .get(format!("http://{}/metrics", self.bind_address())) .header("apollographql-client-name", "custom_name") .header("apollographql-client-version", "1.0") .build() @@ -911,8 +925,11 @@ impl ValueExt for Value { fn merge_overrides( yaml: &str, subgraph_overrides: &HashMap, - bind_addr: &SocketAddr, + bind_addr: Option, ) -> String { + let bind_addr = bind_addr + .map(|a| a.to_string()) + .unwrap_or_else(|| "127.0.0.1:0".into()); // Parse the config as yaml let mut config: Value = serde_yaml::from_str(yaml).unwrap(); diff --git a/apollo-router/tests/fixtures/supergraph-auth.graphql b/apollo-router/tests/fixtures/supergraph-auth.graphql index 1f35ae39d4..37bf75a087 100644 --- a/apollo-router/tests/fixtures/supergraph-auth.graphql +++ b/apollo-router/tests/fixtures/supergraph-auth.graphql @@ -19,6 +19,10 @@ directive @join__graph(name: String!, url: String!) on ENUM_VALUE directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE +directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION + +directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE + directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION directive @inaccessible on OBJECT | FIELD_DEFINITION | INTERFACE | UNION diff --git a/apollo-router/tests/fixtures/type_conditions/artwork.json b/apollo-router/tests/fixtures/type_conditions/artwork.json new file mode 100644 index 0000000000..ad5451f398 --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/artwork.json @@ -0,0 +1,98 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName":"Search__artworkSubgraph__1", + "variables":{ + "movieResultParam":"movieResultEnabled", + "representations":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + }, + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + }, + "response": { + "data":{ + "_entities":[ + { + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork":"movieResultEnabled artwork" + }, + { + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork":"movieResultEnabled artwork" + }, + { + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork":"movieResultEnabled artwork" + }, + { + "artwork":"movieResultEnabled artwork" + } + ] + } + } + }, + { + "request": { + "query": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "variables":{ + "articleResultParam":"articleResultEnabled", + "representations":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + }, + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + } + }, + "response": { + "data":{ + "_entities":[ + { + "artwork":"articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork":"articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + }, + { + "artwork":"articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + {"artwork":"articleResultEnabled artwork"} + ] + } + } + } + ] +} diff --git a/apollo-router/tests/fixtures/type_conditions/artwork_disabled.json b/apollo-router/tests/fixtures/type_conditions/artwork_disabled.json new file mode 100644 index 0000000000..1552804424 --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/artwork_disabled.json @@ -0,0 +1,82 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName":"Search__artworkSubgraph__1", + "variables":{ + "representations":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + }, + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + }, + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + }, + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + }, + "response": { + "data":{ + "_entities": [ + { + "title":"d0182b8a-a671-4244-ba1c-905274b0d198 title", + "artwork":"Hello World" + }, + { + "title":"e6eec2fc-05ce-40a2-956b-f1335e615204 title", + "artwork":"Hello World" + }, + { + "title":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title", + "artwork":"Hello World" + }, + { + "artwork":"Hello World" + }, + { + "title":"d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork":"Hello World" + }, + { + "title":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork":"Hello World" + }, + { + "title":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork":"Hello World" + }, + { + "artwork":"Hello World" + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/fixtures/type_conditions/artwork_no_articles.json b/apollo-router/tests/fixtures/type_conditions/artwork_no_articles.json new file mode 100644 index 0000000000..2411a1c302 --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/artwork_no_articles.json @@ -0,0 +1,52 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName":"Search__artworkSubgraph__1", + "variables":{ + "movieResultParam":"movieResultEnabled", + "representations":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + }, + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + }, + "response": { + "data":{ + "_entities":[ + { + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork":"movieResultEnabled artwork" + }, + { + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork":"movieResultEnabled artwork" + }, + { + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork":"movieResultEnabled artwork" + }, + { + "artwork":"movieResultEnabled artwork" + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/fixtures/type_conditions/artwork_query_fragments_enabled.json b/apollo-router/tests/fixtures/type_conditions/artwork_query_fragments_enabled.json new file mode 100644 index 0000000000..e4c437c2cd --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/artwork_query_fragments_enabled.json @@ -0,0 +1,98 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){..._generated_onEntityCollectionSection2_0 ...on GallerySection{artwork(params:$movieResultParam)}}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{title artwork(params:$movieResultParam)}", + "operationName":"Search__artworkSubgraph__1", + "variables":{ + "movieResultParam":"movieResultEnabled", + "representations":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + }, + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + }, + "response": { + "data":{ + "_entities":[ + { + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork":"movieResultEnabled artwork" + }, + { + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork":"movieResultEnabled artwork" + }, + { + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork":"movieResultEnabled artwork" + }, + { + "artwork":"movieResultEnabled artwork" + } + ] + } + } + }, + { + "request": { + "query": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}..._generated_onEntityCollectionSection2_0}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{artwork(params:$articleResultParam)title}", + "operationName": "Search__artworkSubgraph__2", + "variables":{ + "articleResultParam":"articleResultEnabled", + "representations":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + }, + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + } + }, + "response": { + "data":{ + "_entities":[ + { + "artwork":"articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork":"articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + }, + { + "artwork":"articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + {"artwork":"articleResultEnabled artwork"} + ] + } + } + } + ] +} diff --git a/apollo-router/tests/fixtures/type_conditions/search.json b/apollo-router/tests/fixtures/type_conditions/search.json new file mode 100644 index 0000000000..1393fcfd02 --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/search.json @@ -0,0 +1,72 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName":"Search__searchSubgraph__0" + }, + "response": { + "data":{ + "search":[ + { + "__typename":"ArticleResult", + "id":"a7052397-b605-414a-aba4-408d51c8eef0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + } + ] + }, + { + "__typename":"ArticleResult", + "id":"3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + }, + { + "__typename":"MovieResult", + "id":"c5f4985f-8fb6-4414-a3f5-56f7f58dd043", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + } + ] + }, + { + "__typename":"MovieResult", + "id":"ff140d35-ce5d-48fe-bad7-1cfb2c3e310a", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/fixtures/type_conditions/search_list_of_list.json b/apollo-router/tests/fixtures/type_conditions/search_list_of_list.json new file mode 100644 index 0000000000..228e4ab0db --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/search_list_of_list.json @@ -0,0 +1,136 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__searchSubgraph__0{searchListOfList{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName":"Search__searchSubgraph__0" + }, + "response": { + "data":{ + "searchListOfList":[ + [ + { + "__typename":"ArticleResult", + "id":"a7052397-b605-414a-aba4-408d51c8eef0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + } + ] + }, + { + "__typename":"ArticleResult", + "id":"3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + }, + { + "__typename":"MovieResult", + "id":"c5f4985f-8fb6-4414-a3f5-56f7f58dd043", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + } + ] + }, + { + "__typename":"MovieResult", + "id":"ff140d35-ce5d-48fe-bad7-1cfb2c3e310a", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + ], + [ + { + "__typename":"ArticleResult", + "id":"a7052397-b605-414a-aba4-408d51c8eef0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + } + ] + }, + { + "__typename":"ArticleResult", + "id":"3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + } + ], + [ + { + "__typename":"MovieResult", + "id":"c5f4985f-8fb6-4414-a3f5-56f7f58dd043", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + } + ] + } + ], + [ + { + "__typename":"MovieResult", + "id":"ff140d35-ce5d-48fe-bad7-1cfb2c3e310a", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + ] + ] + } + } + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/fixtures/type_conditions/search_list_of_list_of_list.json b/apollo-router/tests/fixtures/type_conditions/search_list_of_list_of_list.json new file mode 100644 index 0000000000..1c2023c5ec --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/search_list_of_list_of_list.json @@ -0,0 +1,140 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__searchSubgraph__0{searchListOfListOfList{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName":"Search__searchSubgraph__0" + }, + "response": { + "data":{ + "searchListOfListOfList":[ + [ + [ + { + "__typename":"ArticleResult", + "id":"a7052397-b605-414a-aba4-408d51c8eef0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + } + ] + }, + { + "__typename":"ArticleResult", + "id":"3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + }, + { + "__typename":"MovieResult", + "id":"c5f4985f-8fb6-4414-a3f5-56f7f58dd043", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + } + ] + }, + { + "__typename":"MovieResult", + "id":"ff140d35-ce5d-48fe-bad7-1cfb2c3e310a", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + ], + [ + { + "__typename":"ArticleResult", + "id":"a7052397-b605-414a-aba4-408d51c8eef0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + } + ] + }, + { + "__typename":"ArticleResult", + "id":"3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + } + ] + ], + [ + [ + { + "__typename":"MovieResult", + "id":"c5f4985f-8fb6-4414-a3f5-56f7f58dd043", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + } + ] + } + ], + [ + { + "__typename":"MovieResult", + "id":"ff140d35-ce5d-48fe-bad7-1cfb2c3e310a", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + ] + ] + ] + } + } + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/fixtures/type_conditions/search_no_articles.json b/apollo-router/tests/fixtures/type_conditions/search_no_articles.json new file mode 100644 index 0000000000..a4d3197f4b --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/search_no_articles.json @@ -0,0 +1,44 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName":"Search__searchSubgraph__0" + }, + "response": { + "data":{ + "search":[ + { + "__typename":"MovieResult", + "id":"c5f4985f-8fb6-4414-a3f5-56f7f58dd043", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + } + ] + }, + { + "__typename":"MovieResult", + "id":"ff140d35-ce5d-48fe-bad7-1cfb2c3e310a", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/fixtures/type_conditions/search_query_fragments_enabled.json b/apollo-router/tests/fixtures/type_conditions/search_query_fragments_enabled.json new file mode 100644 index 0000000000..85bc7facaa --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/search_query_fragments_enabled.json @@ -0,0 +1,72 @@ +{ + "mocks": [ + { + "request": { + "query":"query Search__searchSubgraph__0{search{__typename ..._generated_onMovieResult2_0 ..._generated_onArticleResult2_0}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{__typename id}fragment _generated_onGallerySection2_0 on GallerySection{__typename id}fragment _generated_onMovieResult2_0 on MovieResult{sections{__typename ..._generated_onEntityCollectionSection2_0 ..._generated_onGallerySection2_0}id}fragment _generated_onArticleResult2_0 on ArticleResult{id sections{__typename ..._generated_onGallerySection2_0 ..._generated_onEntityCollectionSection2_0}}", + "operationName":"Search__searchSubgraph__0" + }, + "response": { + "data":{ + "search":[ + { + "__typename":"ArticleResult", + "id":"a7052397-b605-414a-aba4-408d51c8eef0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d0182b8a-a671-4244-ba1c-905274b0d198" + }, + { + "__typename":"EntityCollectionSection", + "id":"e6eec2fc-05ce-40a2-956b-f1335e615204" + } + ] + }, + { + "__typename":"ArticleResult", + "id":"3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"f44f584e-5d3d-4466-96f5-9afc3f5d5a54" + }, + { + "__typename":"GallerySection", + "id":"e065e2b1-8454-4db9-89c8-48e66ec838c4" + } + ] + }, + { + "__typename":"MovieResult", + "id":"c5f4985f-8fb6-4414-a3f5-56f7f58dd043", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"d9077ad2-d79a-45b5-b5ee-25ded226f03c" + }, + { + "__typename":"EntityCollectionSection", + "id":"9f1f1ebb-21d3-4afe-bb7d-6de706f78f02" + } + ] + }, + { + "__typename":"MovieResult", + "id":"ff140d35-ce5d-48fe-bad7-1cfb2c3e310a", + "sections":[ + { + "__typename":"EntityCollectionSection", + "id":"24cea0de-2ac8-4cbe-85b6-8b1b80647c12" + }, + { + "__typename":"GallerySection", + "id":"2f772201-42ca-4376-9871-2252cc052262" + } + ] + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/apollo-router/tests/fixtures/type_conditions/type_conditions.graphql b/apollo-router/tests/fixtures/type_conditions/type_conditions.graphql new file mode 100644 index 0000000000..90ba1c3e16 --- /dev/null +++ b/apollo-router/tests/fixtures/type_conditions/type_conditions.graphql @@ -0,0 +1,94 @@ +schema + @link(url: "https://specs.apollo.dev/link/v1.0") + @link(url: "https://specs.apollo.dev/join/v0.3", 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) 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 + +type ArticleResult + @join__type(graph: SEARCHSUBGRAPH, key: "id") +{ + id: ID! + sections: [Section] +} + +type EntityCollectionSection + @join__type(graph: ARTWORKSUBGRAPH, key: "id") + @join__type(graph: SEARCHSUBGRAPH, key: "id") +{ + id: ID! + title: String @join__field(graph: ARTWORKSUBGRAPH) + artwork(params: String): String @join__field(graph: ARTWORKSUBGRAPH) +} + +type GallerySection + @join__type(graph: ARTWORKSUBGRAPH, key: "id") + @join__type(graph: SEARCHSUBGRAPH, key: "id") +{ + id: ID! + artwork(params: String): String @join__field(graph: ARTWORKSUBGRAPH) +} + +scalar join__FieldSet + +enum join__Graph { + ARTWORKSUBGRAPH @join__graph(name: "artworkSubgraph", url: "http://localhost:4042") + SEARCHSUBGRAPH @join__graph(name: "searchSubgraph", url: "http://localhost:4041") +} + +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 MovieResult + @join__type(graph: SEARCHSUBGRAPH, key: "id") +{ + id: ID! + sections: [Section] +} + +type Query + @join__type(graph: ARTWORKSUBGRAPH) + @join__type(graph: SEARCHSUBGRAPH) +{ + me: String @join__field(graph: ARTWORKSUBGRAPH) + search: [SearchResult] @join__field(graph: SEARCHSUBGRAPH) + searchListOfList: [[SearchResult]] @join__field(graph: SEARCHSUBGRAPH) + searchListOfListOfList: [[[SearchResult]]] @join__field(graph: SEARCHSUBGRAPH) +} + +union SearchResult + @join__type(graph: SEARCHSUBGRAPH) + @join__unionMember(graph: SEARCHSUBGRAPH, member: "MovieResult") + @join__unionMember(graph: SEARCHSUBGRAPH, member: "ArticleResult") + = MovieResult | ArticleResult + +union Section + @join__type(graph: SEARCHSUBGRAPH) + @join__unionMember(graph: SEARCHSUBGRAPH, member: "EntityCollectionSection") + @join__unionMember(graph: SEARCHSUBGRAPH, member: "GallerySection") + = EntityCollectionSection | GallerySection diff --git a/apollo-router/tests/integration/lifecycle.rs b/apollo-router/tests/integration/lifecycle.rs index f2dc5689e2..04104cbba6 100644 --- a/apollo-router/tests/integration/lifecycle.rs +++ b/apollo-router/tests/integration/lifecycle.rs @@ -177,7 +177,7 @@ async fn test_shutdown_with_idle_connection() -> Result<(), BoxError> { .await; router.start().await; router.assert_started().await; - let _conn = std::net::TcpStream::connect(router.bind_address).unwrap(); + let _conn = std::net::TcpStream::connect(router.bind_address()).unwrap(); router.execute_default_query().await; tokio::time::timeout(Duration::from_secs(1), router.graceful_shutdown()) .await diff --git a/apollo-router/tests/integration/redis.rs b/apollo-router/tests/integration/redis.rs index 0eaf7ce948..afa898d30c 100644 --- a/apollo-router/tests/integration/redis.rs +++ b/apollo-router/tests/integration/redis.rs @@ -25,10 +25,10 @@ mod test { async fn query_planner() -> Result<(), BoxError> { // If this test fails and the cache key format changed you'll need to update the key here. // 1. Force this test to run locally by removing the cfg() line at the top of this file. - // 2. run `docker compose up -d` and connect to the redis container by running `docker exec -ti /bin/bash`. + // 2. run `docker compose up -d` and connect to the redis container by running `docker-compose exec redis /bin/bash`. // 3. Run the `redis-cli` command from the shell and start the redis `monitor` command. // 4. Run this test and yank the updated cache key from the redis logs. - let known_cache_key = "plan:v2.7.2:121b9859eba2d8fa6dde0a54b6e3781274cf69f7ffb0af912e92c01c6bfff6ca:3973e022e93220f9212c18d0d0c543ae7c309e46640da93a4a0314de999f5112:5c7a72fa35639949328548d77b56dba2e77d0dfa90c19b69978da119e996bb92"; + let known_cache_key = "plan:v2.7.5:16385ebef77959fcdc520ad507eb1f7f7df28f1d54a0569e3adabcb4cd00d7ce:3973e022e93220f9212c18d0d0c543ae7c309e46640da93a4a0314de999f5112:5c7a72fa35639949328548d77b56dba2e77d0dfa90c19b69978da119e996bb92"; let config = RedisConfig::from_url("redis://127.0.0.1:6379").unwrap(); let client = RedisClient::new(config, None, None, None); @@ -82,7 +82,7 @@ mod test { let key = key.as_ref().unwrap().results(); println!("\t{key:?}"); } - panic!("key {known_cache_key} not found: {e}"); + panic!("key {known_cache_key} not found: {e}\nIf you see this error, make sure the federation version you use matches the redis key."); } }; let exp: i64 = client diff --git a/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_disabled.snap b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_disabled.snap new file mode 100644 index 0000000000..9aec877584 --- /dev/null +++ b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_disabled.snap @@ -0,0 +1,152 @@ +--- +source: apollo-router/tests/integration/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "Hello World", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "Hello World", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "Hello World", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "Hello World" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "Hello World" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "Hello World" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "Hello World" + }, + { + "artwork": "Hello World", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "33216530c735d3601818de5f4f8bd7b474cd307887b074b3ec64c9d20ee9e55a", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Flatten", + "path": [ + "search", + "@", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "a83103bd9c249b3af3044e23ac10b15a3c891114c6c37f7b7edf4a45d8bc2e26", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Flatten(path: \"search.@.sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled.snap b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled.snap new file mode 100644 index 0000000000..bd7aa4a670 --- /dev/null +++ b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled.snap @@ -0,0 +1,217 @@ +--- +source: apollo-router/tests/integration/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "33216530c735d3601818de5f4f8bd7b474cd307887b074b3ec64c9d20ee9e55a", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "a83103bd9c249b3af3044e23ac10b15a3c891114c6c37f7b7edf4a45d8bc2e26", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "78b6282588e7eebce133e67c0bf3783d2042cfa7fff8f305dbcaf9d74f767a85", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".search.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".search.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_generate_query_fragments.snap b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_generate_query_fragments.snap new file mode 100644 index 0000000000..8280d5c862 --- /dev/null +++ b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_generate_query_fragments.snap @@ -0,0 +1,217 @@ +--- +source: apollo-router/tests/integration/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ..._generated_onMovieResult2_0 ..._generated_onArticleResult2_0}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{__typename id}fragment _generated_onGallerySection2_0 on GallerySection{__typename id}fragment _generated_onMovieResult2_0 on MovieResult{sections{__typename ..._generated_onEntityCollectionSection2_0 ..._generated_onGallerySection2_0}id}fragment _generated_onArticleResult2_0 on ArticleResult{id sections{__typename ..._generated_onGallerySection2_0 ..._generated_onEntityCollectionSection2_0}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "97c9d3a01ff67c046ee924c663576debcdc00fd0d1ddc5da6b603ecf2fc059f8", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){..._generated_onEntityCollectionSection2_0 ...on GallerySection{artwork(params:$movieResultParam)}}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{title artwork(params:$movieResultParam)}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "2cf7d828404290ffa480daa2716ca9de2fa17edd79bb2912ace2c66e2eb58a41", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}..._generated_onEntityCollectionSection2_0}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{artwork(params:$articleResultParam)title}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "750916cbea74de6ea860aff2da9bec3fc99478e80fb963a53bf10de8ae2ad079", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ..._generated_onMovieResult2_0\n ..._generated_onArticleResult2_0\n }\n }\n \n fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection {\n __typename\n id\n }\n \n fragment _generated_onGallerySection2_0 on GallerySection {\n __typename\n id\n }\n \n fragment _generated_onMovieResult2_0 on MovieResult {\n sections {\n __typename\n ..._generated_onEntityCollectionSection2_0\n ..._generated_onGallerySection2_0\n }\n id\n }\n \n fragment _generated_onArticleResult2_0 on ArticleResult {\n id\n sections {\n __typename\n ..._generated_onGallerySection2_0\n ..._generated_onEntityCollectionSection2_0\n }\n }\n },\n Parallel {\n Flatten(path: \".search.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ..._generated_onEntityCollectionSection2_0\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n \n fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n },\n },\n Flatten(path: \".search.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ..._generated_onEntityCollectionSection2_0\n }\n \n fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_list_of_list.snap b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_list_of_list.snap new file mode 100644 index 0000000000..8130a4cda6 --- /dev/null +++ b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_list_of_list.snap @@ -0,0 +1,281 @@ +--- +source: apollo-router/tests/integration/type_conditions.rs +expression: response +--- +{ + "data": { + "searchListOfList": [ + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ], + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + } + ], + [ + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + } + ], + [ + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{searchListOfList{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "641448281084f968385a71d65dc50c8d4342e5864206e54b5deb6adc251b0875", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "searchListOfList", + "@", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "a83103bd9c249b3af3044e23ac10b15a3c891114c6c37f7b7edf4a45d8bc2e26", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "searchListOfList", + "@", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "78b6282588e7eebce133e67c0bf3783d2042cfa7fff8f305dbcaf9d74f767a85", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n searchListOfList {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".searchListOfList.@.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".searchListOfList.@.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_list_of_list_of_list.snap b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_list_of_list_of_list.snap new file mode 100644 index 0000000000..817f641717 --- /dev/null +++ b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_list_of_list_of_list.snap @@ -0,0 +1,287 @@ +--- +source: apollo-router/tests/integration/type_conditions.rs +expression: response +--- +{ + "data": { + "searchListOfListOfList": [ + [ + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ], + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + } + ] + ], + [ + [ + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + } + ], + [ + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + ] + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{searchListOfListOfList{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "f557e1a9335686d087be588d739426e55009a012fbc7a293026bf04fb2f4ec3f", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "searchListOfListOfList", + "@", + "@", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "a83103bd9c249b3af3044e23ac10b15a3c891114c6c37f7b7edf4a45d8bc2e26", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "searchListOfListOfList", + "@", + "@", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "78b6282588e7eebce133e67c0bf3783d2042cfa7fff8f305dbcaf9d74f767a85", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n searchListOfListOfList {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".searchListOfListOfList.@.@.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".searchListOfListOfList.@.@.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_shouldnt_make_article_fetch.snap b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_shouldnt_make_article_fetch.snap new file mode 100644 index 0000000000..80bb90aa1a --- /dev/null +++ b/apollo-router/tests/integration/snapshots/integration_tests__integration__type_conditions__type_conditions_enabled_shouldnt_make_article_fetch.snap @@ -0,0 +1,192 @@ +--- +source: apollo-router/tests/integration/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "33216530c735d3601818de5f4f8bd7b474cd307887b074b3ec64c9d20ee9e55a", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "a83103bd9c249b3af3044e23ac10b15a3c891114c6c37f7b7edf4a45d8bc2e26", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "78b6282588e7eebce133e67c0bf3783d2042cfa7fff8f305dbcaf9d74f767a85", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".search.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".search.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/integration/telemetry/fixtures/jaeger-advanced.router.yaml b/apollo-router/tests/integration/telemetry/fixtures/jaeger-advanced.router.yaml index b39e9278c6..28cff61731 100644 --- a/apollo-router/tests/integration/telemetry/fixtures/jaeger-advanced.router.yaml +++ b/apollo-router/tests/integration/telemetry/fixtures/jaeger-advanced.router.yaml @@ -38,6 +38,12 @@ telemetry: "http.request.header.x-not-present": request_header: "x-not-present" default: nope + "http.request.header.x-my-header-condition": + request_header: "x-my-header" + condition: + eq: + - request_header: "head" + - "test" supergraph: attributes: graphql.operation.name: true @@ -47,8 +53,8 @@ telemetry: attributes: subgraph.graphql.operation.type: true subgraph.name: true - + override_subgraph_url: products: http://localhost:4005 include_subgraph_errors: - all: true + all: true \ No newline at end of file diff --git a/apollo-router/tests/integration/telemetry/jaeger.rs b/apollo-router/tests/integration/telemetry/jaeger.rs index 2a3e9a61e4..fe5c49f595 100644 --- a/apollo-router/tests/integration/telemetry/jaeger.rs +++ b/apollo-router/tests/integration/telemetry/jaeger.rs @@ -281,7 +281,7 @@ async fn test_span_customization() -> Result<(), BoxError> { router.assert_started().await; let query = json!({"query":"query ExampleQuery {topProducts{name}}","variables":{}}); - let (id, _) = router.execute_query(&query).await; + let (id, _res) = router.execute_query(&query).await; validate_trace( id, &query, @@ -345,7 +345,6 @@ async fn find_valid_trace( // * The correct spans // * All spans are parented // * Required attributes of 'router' span has been set - let trace: Value = reqwest::get(url) .await .map_err(|e| anyhow!("failed to contact jaeger; {}", e))? @@ -380,7 +379,6 @@ fn verify_router_span_fields( ) -> Result<(), BoxError> { let router_span = trace.select_path("$..spans[?(@.operationName == 'router')]")?[0]; // We can't actually assert the values on a span. Only that a field has been set. - assert_eq!( router_span .select_path("$.tags[?(@.key == 'client.name')].value")? @@ -406,6 +404,14 @@ fn verify_router_span_fields( .first(), Some(&&Value::String("nope".to_string())) ); + assert_eq!( + router_span + .select_path( + "$.tags[?(@.key == 'http.request.header.x-my-header-condition')].value" + )? + .first(), + Some(&&Value::String("test".to_string())) + ); } Ok(()) diff --git a/apollo-router/tests/integration/telemetry/logging.rs b/apollo-router/tests/integration/telemetry/logging.rs index e7c0b3180f..a3ac6d243e 100644 --- a/apollo-router/tests/integration/telemetry/logging.rs +++ b/apollo-router/tests/integration/telemetry/logging.rs @@ -21,6 +21,7 @@ async fn test_json() -> Result<(), BoxError> { router.execute_query(&query).await; router.assert_log_contains("span_id").await; router.graceful_shutdown().await; + Ok(()) } diff --git a/apollo-router/tests/integration/telemetry/metrics.rs b/apollo-router/tests/integration/telemetry/metrics.rs index 3ec0af1aa4..26423e5ec7 100644 --- a/apollo-router/tests/integration/telemetry/metrics.rs +++ b/apollo-router/tests/integration/telemetry/metrics.rs @@ -59,9 +59,9 @@ async fn test_metrics_reloading() { .assert_metrics_does_not_contain(r#"_total_total{"#) .await; - if std::env::var("APOLLO_KEY").is_ok() && std::env::var("APOLLO_GRAPH_REF").is_ok() { - router.assert_metrics_contains(r#"apollo_router_telemetry_studio_reports_total{type="metrics",otel_scope_name="apollo/router"} 2"#, Some(Duration::from_secs(10))).await; - router.assert_metrics_contains(r#"apollo_router_telemetry_studio_reports_total{type="traces",otel_scope_name="apollo/router"} 2"#, Some(Duration::from_secs(10))).await; + if std::env::var("TEST_APOLLO_KEY").is_ok() && std::env::var("TEST_APOLLO_GRAPH_REF").is_ok() { + router.assert_metrics_contains(r#"apollo_router_telemetry_studio_reports_total{report_type="metrics",otel_scope_name="apollo/router"} 2"#, Some(Duration::from_secs(10))).await; + router.assert_metrics_contains(r#"apollo_router_telemetry_studio_reports_total{report_type="traces",otel_scope_name="apollo/router"} 2"#, Some(Duration::from_secs(10))).await; router.assert_metrics_contains(r#"apollo_router_uplink_fetch_duration_seconds_count{kind="unchanged",query="License",url="https://uplink.api.apollographql.com/",otel_scope_name="apollo/router"}"#, Some(Duration::from_secs(120))).await; router.assert_metrics_contains(r#"apollo_router_uplink_fetch_count_total{query="License",status="success",otel_scope_name="apollo/router"}"#, Some(Duration::from_secs(1))).await; } diff --git a/apollo-router/tests/snapshots/type_conditions__type_conditions_disabled.snap b/apollo-router/tests/snapshots/type_conditions__type_conditions_disabled.snap new file mode 100644 index 0000000000..e1b3c3bba7 --- /dev/null +++ b/apollo-router/tests/snapshots/type_conditions__type_conditions_disabled.snap @@ -0,0 +1,152 @@ +--- +source: apollo-router/tests/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "Hello World", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "Hello World", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "Hello World", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "Hello World" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "Hello World" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "Hello World" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "Hello World" + }, + { + "artwork": "Hello World", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "0144f144d271437ed45f9d20706be86ffbf1e124d77c7add3db17d4a1498ce97", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Flatten", + "path": [ + "search", + "@", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "23759b36e5149924c757a8b9586adec2c0f6be04ecdf2c3c3ea277446daa690b", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Flatten(path: \"search.@.sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled.snap b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled.snap new file mode 100644 index 0000000000..49e1fef4bc --- /dev/null +++ b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled.snap @@ -0,0 +1,217 @@ +--- +source: apollo-router/tests/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "0144f144d271437ed45f9d20706be86ffbf1e124d77c7add3db17d4a1498ce97", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "23759b36e5149924c757a8b9586adec2c0f6be04ecdf2c3c3ea277446daa690b", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "8ee58ad8b4823bcbda9126d2565e1cb04bf91ff250b1098476a1d7614a870121", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".search.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".search.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_generate_query_fragments.snap b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_generate_query_fragments.snap new file mode 100644 index 0000000000..b04c2208ec --- /dev/null +++ b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_generate_query_fragments.snap @@ -0,0 +1,217 @@ +--- +source: apollo-router/tests/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ..._generated_onMovieResult2_0 ..._generated_onArticleResult2_0}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{__typename id}fragment _generated_onGallerySection2_0 on GallerySection{__typename id}fragment _generated_onMovieResult2_0 on MovieResult{sections{__typename ..._generated_onEntityCollectionSection2_0 ..._generated_onGallerySection2_0}id}fragment _generated_onArticleResult2_0 on ArticleResult{id sections{__typename ..._generated_onGallerySection2_0 ..._generated_onEntityCollectionSection2_0}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "844dc4e409cdca1334abe37c347bd4e330123078dd7e65bda8dbb57ea5bdf59c", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){..._generated_onEntityCollectionSection2_0 ...on GallerySection{artwork(params:$movieResultParam)}}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{title artwork(params:$movieResultParam)}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "ad82ce0af279c6a012d6b349ff823ba1467902223312aed1cdfc494ec3100b3e", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}..._generated_onEntityCollectionSection2_0}}fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection{artwork(params:$articleResultParam)title}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "7c267302cf4a44a4463820237830155ab50be32c8860371d8a5c8ca905476360", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ..._generated_onMovieResult2_0\n ..._generated_onArticleResult2_0\n }\n }\n \n fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection {\n __typename\n id\n }\n \n fragment _generated_onGallerySection2_0 on GallerySection {\n __typename\n id\n }\n \n fragment _generated_onMovieResult2_0 on MovieResult {\n sections {\n __typename\n ..._generated_onEntityCollectionSection2_0\n ..._generated_onGallerySection2_0\n }\n id\n }\n \n fragment _generated_onArticleResult2_0 on ArticleResult {\n id\n sections {\n __typename\n ..._generated_onGallerySection2_0\n ..._generated_onEntityCollectionSection2_0\n }\n }\n },\n Parallel {\n Flatten(path: \".search.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ..._generated_onEntityCollectionSection2_0\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n \n fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n },\n },\n Flatten(path: \".search.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ..._generated_onEntityCollectionSection2_0\n }\n \n fragment _generated_onEntityCollectionSection2_0 on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_list_of_list.snap b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_list_of_list.snap new file mode 100644 index 0000000000..45697537d8 --- /dev/null +++ b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_list_of_list.snap @@ -0,0 +1,281 @@ +--- +source: apollo-router/tests/type_conditions.rs +expression: response +--- +{ + "data": { + "searchListOfList": [ + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ], + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + } + ], + [ + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + } + ], + [ + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{searchListOfList{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "1343b4972ec8be54afe990c69711ce790992a814f9654e34e2ee2b25e4097e45", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "searchListOfList", + "@", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "23759b36e5149924c757a8b9586adec2c0f6be04ecdf2c3c3ea277446daa690b", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "searchListOfList", + "@", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "8ee58ad8b4823bcbda9126d2565e1cb04bf91ff250b1098476a1d7614a870121", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n searchListOfList {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".searchListOfList.@.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".searchListOfList.@.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_list_of_list_of_list.snap b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_list_of_list_of_list.snap new file mode 100644 index 0000000000..528a658fe6 --- /dev/null +++ b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_list_of_list_of_list.snap @@ -0,0 +1,287 @@ +--- +source: apollo-router/tests/type_conditions.rs +expression: response +--- +{ + "data": { + "searchListOfListOfList": [ + [ + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + }, + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ], + [ + { + "id": "a7052397-b605-414a-aba4-408d51c8eef0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "d0182b8a-a671-4244-ba1c-905274b0d198 title" + }, + { + "artwork": "articleResultEnabled artwork", + "title": "e6eec2fc-05ce-40a2-956b-f1335e615204 title" + } + ] + }, + { + "id": "3a7b08c9-d8c0-4c55-b55d-596a272392e0", + "sections": [ + { + "artwork": "articleResultEnabled artwork", + "title": "f44f584e-5d3d-4466-96f5-9afc3f5d5a54 title" + }, + { + "artwork": "articleResultEnabled artwork" + } + ] + } + ] + ], + [ + [ + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + } + ], + [ + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + ] + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{searchListOfListOfList{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "3698f4e74ead34f43a949e1e8459850337a1a07245f8ed627b9203904b4cfff4", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "searchListOfListOfList", + "@", + "@", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "23759b36e5149924c757a8b9586adec2c0f6be04ecdf2c3c3ea277446daa690b", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "searchListOfListOfList", + "@", + "@", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "8ee58ad8b4823bcbda9126d2565e1cb04bf91ff250b1098476a1d7614a870121", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n searchListOfListOfList {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".searchListOfListOfList.@.@.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".searchListOfListOfList.@.@.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_shouldnt_make_article_fetch.snap b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_shouldnt_make_article_fetch.snap new file mode 100644 index 0000000000..38ef6bc51a --- /dev/null +++ b/apollo-router/tests/snapshots/type_conditions__type_conditions_enabled_shouldnt_make_article_fetch.snap @@ -0,0 +1,192 @@ +--- +source: apollo-router/tests/type_conditions.rs +expression: response +--- +{ + "data": { + "search": [ + { + "sections": [ + { + "id": "d9077ad2-d79a-45b5-b5ee-25ded226f03c", + "title": "d9077ad2-d79a-45b5-b5ee-25ded226f03c title", + "artwork": "movieResultEnabled artwork" + }, + { + "id": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02", + "title": "9f1f1ebb-21d3-4afe-bb7d-6de706f78f02 title", + "artwork": "movieResultEnabled artwork" + } + ], + "id": "c5f4985f-8fb6-4414-a3f5-56f7f58dd043" + }, + { + "sections": [ + { + "id": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12", + "title": "24cea0de-2ac8-4cbe-85b6-8b1b80647c12 title", + "artwork": "movieResultEnabled artwork" + }, + { + "artwork": "movieResultEnabled artwork", + "id": "2f772201-42ca-4376-9871-2252cc052262" + } + ], + "id": "ff140d35-ce5d-48fe-bad7-1cfb2c3e310a" + } + ] + }, + "extensions": { + "apolloQueryPlan": { + "object": { + "kind": "QueryPlan", + "node": { + "kind": "Sequence", + "nodes": [ + { + "kind": "Fetch", + "serviceName": "searchSubgraph", + "variableUsages": [], + "operation": "query Search__searchSubgraph__0{search{__typename ...on MovieResult{sections{__typename ...on EntityCollectionSection{__typename id}...on GallerySection{__typename id}}id}...on ArticleResult{id sections{__typename ...on GallerySection{__typename id}...on EntityCollectionSection{__typename id}}}}}", + "operationName": "Search__searchSubgraph__0", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "0144f144d271437ed45f9d20706be86ffbf1e124d77c7add3db17d4a1498ce97", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + }, + { + "kind": "Parallel", + "nodes": [ + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[MovieResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "movieResultParam" + ], + "operation": "query Search__artworkSubgraph__1($representations:[_Any!]!$movieResultParam:String){_entities(representations:$representations){...on EntityCollectionSection{title artwork(params:$movieResultParam)}...on GallerySection{artwork(params:$movieResultParam)}}}", + "operationName": "Search__artworkSubgraph__1", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "23759b36e5149924c757a8b9586adec2c0f6be04ecdf2c3c3ea277446daa690b", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + }, + { + "kind": "Flatten", + "path": [ + "", + "search", + "@|[ArticleResult]", + "sections", + "@" + ], + "node": { + "kind": "Fetch", + "serviceName": "artworkSubgraph", + "requires": [ + { + "kind": "InlineFragment", + "typeCondition": "GallerySection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + }, + { + "kind": "InlineFragment", + "typeCondition": "EntityCollectionSection", + "selections": [ + { + "kind": "Field", + "name": "__typename" + }, + { + "kind": "Field", + "name": "id" + } + ] + } + ], + "variableUsages": [ + "articleResultParam" + ], + "operation": "query Search__artworkSubgraph__2($representations:[_Any!]!$articleResultParam:String){_entities(representations:$representations){...on GallerySection{artwork(params:$articleResultParam)}...on EntityCollectionSection{artwork(params:$articleResultParam)title}}}", + "operationName": "Search__artworkSubgraph__2", + "operationKind": "query", + "id": null, + "inputRewrites": null, + "outputRewrites": null, + "schemaAwareHash": "8ee58ad8b4823bcbda9126d2565e1cb04bf91ff250b1098476a1d7614a870121", + "authorization": { + "is_authenticated": false, + "scopes": [], + "policies": [] + } + } + } + ] + } + ] + } + }, + "text": "QueryPlan {\n Sequence {\n Fetch(service: \"searchSubgraph\") {\n {\n search {\n __typename\n ... on MovieResult {\n sections {\n __typename\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n }\n id\n }\n ... on ArticleResult {\n id\n sections {\n __typename\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n }\n }\n }\n }\n },\n Parallel {\n Flatten(path: \".search.@|[MovieResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on EntityCollectionSection {\n __typename\n id\n }\n ... on GallerySection {\n __typename\n id\n }\n } =>\n {\n ... on EntityCollectionSection {\n title\n artwork(params: $movieResultParam)\n }\n ... on GallerySection {\n artwork(params: $movieResultParam)\n }\n }\n },\n },\n Flatten(path: \".search.@|[ArticleResult].sections.@\") {\n Fetch(service: \"artworkSubgraph\") {\n {\n ... on GallerySection {\n __typename\n id\n }\n ... on EntityCollectionSection {\n __typename\n id\n }\n } =>\n {\n ... on GallerySection {\n artwork(params: $articleResultParam)\n }\n ... on EntityCollectionSection {\n artwork(params: $articleResultParam)\n title\n }\n }\n },\n },\n },\n },\n}" + } + } +} diff --git a/apollo-router/tests/type_conditions.rs b/apollo-router/tests/type_conditions.rs new file mode 100644 index 0000000000..8d3afbd206 --- /dev/null +++ b/apollo-router/tests/type_conditions.rs @@ -0,0 +1,430 @@ +//! +//! Please ensure that any tests added to this file use the tokio multi-threaded test executor. +//! + +use apollo_compiler::execution::JsonMap; +use apollo_router::graphql::Request; +use apollo_router::graphql::Response; +use apollo_router::plugin::test::MockSubgraph; +use apollo_router::services::supergraph; +use apollo_router::MockedSubgraphs; +use apollo_router::TestHarness; +use serde::Deserialize; +use serde_json::json; +use tower::ServiceExt; + +#[derive(Deserialize)] +struct SubgraphMock { + mocks: Vec, +} + +#[derive(Deserialize)] +struct RequestAndResponse { + request: Request, + response: Response, +} + +#[tokio::test(flavor = "multi_thread")] +async fn test_type_conditions_enabled() { + let harness = setup_from_mocks( + json! {{ + "experimental_type_conditioned_fetching": true, + // will make debugging easier + "plugins": { + "experimental.expose_query_plan": true + }, + "include_subgraph_errors": { + "all": true + } + }}, + &[ + ( + "searchSubgraph", + include_str!("fixtures/type_conditions/search.json"), + ), + ( + "artworkSubgraph", + include_str!("fixtures/type_conditions/artwork.json"), + ), + ], + ); + let supergraph_service = harness.build_supergraph().await.unwrap(); + let mut variables = JsonMap::new(); + variables.insert("movieResultParam", "movieResultEnabled".into()); + variables.insert("articleResultParam", "articleResultEnabled".into()); + let request = supergraph::Request::fake_builder() + .query(QUERY.to_string()) + .header("Apollo-Expose-Query-Plan", "true") + .variables(variables) + .build() + .expect("expecting valid request"); + + let response = supergraph_service + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); +} + +#[tokio::test(flavor = "multi_thread")] +async fn test_type_conditions_enabled_generate_query_fragments() { + let harness = setup_from_mocks( + json! {{ + "experimental_type_conditioned_fetching": true, + "supergraph": { + "generate_query_fragments": true + }, + // will make debugging easier + "plugins": { + "experimental.expose_query_plan": true + }, + "include_subgraph_errors": { + "all": true + } + }}, + &[ + ( + "searchSubgraph", + include_str!("fixtures/type_conditions/search_query_fragments_enabled.json"), + ), + ( + "artworkSubgraph", + include_str!("fixtures/type_conditions/artwork_query_fragments_enabled.json"), + ), + ], + ); + let supergraph_service = harness.build_supergraph().await.unwrap(); + let mut variables = JsonMap::new(); + variables.insert("movieResultParam", "movieResultEnabled".into()); + variables.insert("articleResultParam", "articleResultEnabled".into()); + let request = supergraph::Request::fake_builder() + .query(QUERY.to_string()) + .header("Apollo-Expose-Query-Plan", "true") + .variables(variables) + .build() + .expect("expecting valid request"); + + let response = supergraph_service + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); +} + +#[tokio::test(flavor = "multi_thread")] +async fn test_type_conditions_enabled_list_of_list() { + let harness = setup_from_mocks( + json! {{ + "experimental_type_conditioned_fetching": true, + // will make debugging easier + "plugins": { + "experimental.expose_query_plan": true + }, + "include_subgraph_errors": { + "all": true + } + }}, + &[ + ( + "searchSubgraph", + include_str!("fixtures/type_conditions/search_list_of_list.json"), + ), + ( + "artworkSubgraph", + include_str!("fixtures/type_conditions/artwork.json"), + ), + ], + ); + let supergraph_service = harness.build_supergraph().await.unwrap(); + let mut variables = JsonMap::new(); + variables.insert("movieResultParam", "movieResultEnabled".into()); + variables.insert("articleResultParam", "articleResultEnabled".into()); + let request = supergraph::Request::fake_builder() + .query(QUERY_LIST_OF_LIST.to_string()) + .header("Apollo-Expose-Query-Plan", "true") + .variables(variables) + .build() + .expect("expecting valid request"); + + let response = supergraph_service + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); +} + +// one last to make sure unnesting is correct +#[tokio::test(flavor = "multi_thread")] +async fn test_type_conditions_enabled_list_of_list_of_list() { + let harness = setup_from_mocks( + json! {{ + "experimental_type_conditioned_fetching": true, + // will make debugging easier + "plugins": { + "experimental.expose_query_plan": true + }, + "include_subgraph_errors": { + "all": true + } + }}, + &[ + ( + "searchSubgraph", + include_str!("fixtures/type_conditions/search_list_of_list_of_list.json"), + ), + ( + "artworkSubgraph", + include_str!("fixtures/type_conditions/artwork.json"), + ), + ], + ); + let supergraph_service = harness.build_supergraph().await.unwrap(); + let mut variables = JsonMap::new(); + variables.insert("movieResultParam", "movieResultEnabled".into()); + variables.insert("articleResultParam", "articleResultEnabled".into()); + let request = supergraph::Request::fake_builder() + .query(QUERY_LIST_OF_LIST_OF_LIST.to_string()) + .header("Apollo-Expose-Query-Plan", "true") + .variables(variables) + .build() + .expect("expecting valid request"); + + let response = supergraph_service + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); +} + +#[tokio::test(flavor = "multi_thread")] +async fn test_type_conditions_disabled() { + let harness = setup_from_mocks( + json! {{ + "experimental_type_conditioned_fetching": false, + // will make debugging easier + "plugins": { + "experimental.expose_query_plan": true + }, + "include_subgraph_errors": { + "all": true + } + }}, + &[ + ( + "searchSubgraph", + include_str!("fixtures/type_conditions/search.json"), + ), + ( + "artworkSubgraph", + include_str!("fixtures/type_conditions/artwork_disabled.json"), + ), + ], + ); + let supergraph_service = harness.build_supergraph().await.unwrap(); + let mut variables = JsonMap::new(); + variables.insert("movieResultParam", "movieResultDisabled".into()); + variables.insert("articleResultParam", "articleResultDisabled".into()); + let request = supergraph::Request::fake_builder() + .query(QUERY.to_string()) + .header("Apollo-Expose-Query-Plan", "true") + .build() + .expect("expecting valid request"); + + let response = supergraph_service + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); +} + +#[tokio::test(flavor = "multi_thread")] +async fn test_type_conditions_enabled_shouldnt_make_article_fetch() { + let harness = setup_from_mocks( + json! {{ + "experimental_type_conditioned_fetching": true, + // will make debugging easier + "plugins": { + "experimental.expose_query_plan": true + }, + "include_subgraph_errors": { + "all": true + } + }}, + &[ + ( + "searchSubgraph", + include_str!("fixtures/type_conditions/search_no_articles.json"), + ), + ( + "artworkSubgraph", + include_str!("fixtures/type_conditions/artwork_no_articles.json"), + ), + ], + ); + let supergraph_service = harness.build_supergraph().await.unwrap(); + let mut variables = JsonMap::new(); + variables.insert("movieResultParam", "movieResultEnabled".into()); + variables.insert("articleResultParam", "articleResultEnabled".into()); + let request = supergraph::Request::fake_builder() + .query(QUERY.to_string()) + .header("Apollo-Expose-Query-Plan", "true") + .variables(variables) + .build() + .expect("expecting valid request"); + + let response = supergraph_service + .oneshot(request) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + insta::assert_json_snapshot!(response); +} + +fn setup_from_mocks( + configuration: serde_json::Value, + mocks: &[(&'static str, &'static str)], +) -> TestHarness<'static> { + let mut mocked_subgraphs = MockedSubgraphs::default(); + + for (name, m) in mocks { + let subgraph_mock: SubgraphMock = serde_json::from_str(m).unwrap(); + + let mut builder = MockSubgraph::builder(); + + for mock in subgraph_mock.mocks { + builder = builder.with_json( + serde_json::to_value(mock.request).unwrap(), + serde_json::to_value(mock.response).unwrap(), + ); + } + + mocked_subgraphs.insert(name, builder.build()); + } + + let schema = include_str!("fixtures/type_conditions/type_conditions.graphql"); + TestHarness::builder() + .try_log_level("info") + .configuration_json(configuration) + .unwrap() + .schema(schema) + .extra_plugin(mocked_subgraphs) +} + +static QUERY: &str = r#" +query Search($movieResultParam: String, $articleResultParam: String) { + search { + ... on MovieResult { + sections { + ... on EntityCollectionSection { + id + title + artwork(params: $movieResultParam) + } + ... on GallerySection { + artwork(params: $movieResultParam) + id + } + } + id + } + ... on ArticleResult { + id + sections { + ... on GallerySection { + artwork(params: $articleResultParam) + } + ... on EntityCollectionSection { + artwork(params: $articleResultParam) + title + } + } + } + } +}"#; + +static QUERY_LIST_OF_LIST: &str = r#" +query Search($movieResultParam: String, $articleResultParam: String) { + searchListOfList { + ... on MovieResult { + sections { + ... on EntityCollectionSection { + id + title + artwork(params: $movieResultParam) + } + ... on GallerySection { + artwork(params: $movieResultParam) + id + } + } + id + } + ... on ArticleResult { + id + sections { + ... on GallerySection { + artwork(params: $articleResultParam) + } + ... on EntityCollectionSection { + artwork(params: $articleResultParam) + title + } + } + } + } +}"#; + +static QUERY_LIST_OF_LIST_OF_LIST: &str = r#" +query Search($movieResultParam: String, $articleResultParam: String) { + searchListOfListOfList { + ... on MovieResult { + sections { + ... on EntityCollectionSection { + id + title + artwork(params: $movieResultParam) + } + ... on GallerySection { + artwork(params: $movieResultParam) + id + } + } + id + } + ... on ArticleResult { + id + sections { + ... on GallerySection { + artwork(params: $articleResultParam) + } + ... on EntityCollectionSection { + artwork(params: $articleResultParam) + title + } + } + } + } +}"#; diff --git a/dockerfiles/tracing/docker-compose.datadog.yml b/dockerfiles/tracing/docker-compose.datadog.yml index df99953681..79a6692a8a 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.45.1 + image: ghcr.io/apollographql/router:v1.46.0 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 4d3f756a81..8d047807cf 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.45.1 + image: ghcr.io/apollographql/router:v1.46.0 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 f4887b62e6..0e98fb085e 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.45.1 + image: ghcr.io/apollographql/router:v1.46.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/zipkin.router.yaml:/etc/config/configuration.yaml diff --git a/docs/shared/telemetry-performance.mdx b/docs/shared/telemetry-performance.mdx new file mode 100644 index 0000000000..8086094e73 --- /dev/null +++ b/docs/shared/telemetry-performance.mdx @@ -0,0 +1,6 @@ +Keep in mind that the amount of telemetry you add can impact your router's performance. + +- Custom metrics, events, and attributes consume more processing resources than standard metrics. Adding too many (standard or custom) can slow your router down. +- Configurations such as `events.*.request|error|response` that produce output for all router lifecycle services should only be used for development or debugging, not for production. + +For properly logged telemetry, you should use a log verbosity of `info`. Set the values of `RUST_LOG` or `APOLLO_ROUTER_LOG` environment variables and the `--log` CLI option to `info`. Using less verbose logging, such as `error`, can cause some attributes to be dropped. \ No newline at end of file diff --git a/docs/source/_redirects b/docs/source/_redirects index 913aa1cff1..be1bb526d6 100644 --- a/docs/source/_redirects +++ b/docs/source/_redirects @@ -7,3 +7,4 @@ /configuration/spaceport* /docs/router/configuration/apollo-telemetry/ /managed-federation/client%20awareness/ /docs/router/managed-federation/client-awareness/ /configuration/logging /docs/router/configuration/telemetry/overview +/configuration/metrics /docs/router/configuration/telemetry/overview \ No newline at end of file diff --git a/docs/source/config.json b/docs/source/config.json index cc3cf10d02..468b9fe5e0 100644 --- a/docs/source/config.json +++ b/docs/source/config.json @@ -128,9 +128,10 @@ "Zipkin": "/configuration/telemetry/exporters/tracing/zipkin" }, "Instrumentation": { - "Instruments" : "/configuration/telemetry/instrumentation/instruments", - "Spans" : "/configuration/telemetry/instrumentation/spans", - "Selectors" : "/configuration/telemetry/instrumentation/selectors", + "Instruments": "/configuration/telemetry/instrumentation/instruments", + "Events": "/configuration/telemetry/instrumentation/events", + "Spans": "/configuration/telemetry/instrumentation/spans", + "Selectors": "/configuration/telemetry/instrumentation/selectors", "Standard attributes": "/configuration/telemetry/instrumentation/standard-attributes", "Standard instruments": "/configuration/telemetry/instrumentation/standard-instruments" } diff --git a/docs/source/configuration/authn-jwt.mdx b/docs/source/configuration/authn-jwt.mdx index a2d43144d2..f99c6e489b 100644 --- a/docs/source/configuration/authn-jwt.mdx +++ b/docs/source/configuration/authn-jwt.mdx @@ -171,6 +171,23 @@ This is an array of possible token sources, as it could be provided in different + + + +##### `ignore_other_prefixes` + + + + +Whether to ignore other prefixes in the `Authorization` header. If set to `false`, or unspecified, the router will only accept tokens with the prefix specified in `header_value_prefix`. If set to `true`, the router will ignore any requests that don't start with the prefix specified in `header_value_prefix`. + +If a header prefix is set to an empty string, this option is ignored. + +The default value is `false`. + + + + diff --git a/docs/source/configuration/authorization.mdx b/docs/source/configuration/authorization.mdx index 938fb306fa..e1e845ad14 100644 --- a/docs/source/configuration/authorization.mdx +++ b/docs/source/configuration/authorization.mdx @@ -61,6 +61,18 @@ Services may have their own access controls, but enforcing authorization _in the classDef padding padding-left:1em, padding-right:1em ``` + + +To learn more about why authorization is ideal at the router layer, watch Andrew Carlson's talk at Austin API Summit 2024: [Centralize Data Access Control with GraphQL](https://www.youtube.com/watch?v=ETyAPY4bsYY). + + + + + + + + + ## How access control works The Apollo Router provides access controls via **authorization directives** that define access to specific fields and types across your supergraph: diff --git a/docs/source/configuration/telemetry/instrumentation/conditions.mdx b/docs/source/configuration/telemetry/instrumentation/conditions.mdx index 60d3d1fa26..487b1aac0f 100644 --- a/docs/source/configuration/telemetry/instrumentation/conditions.mdx +++ b/docs/source/configuration/telemetry/instrumentation/conditions.mdx @@ -6,7 +6,7 @@ description: Set conditions for when events or instruments are triggered in the -You can set conditions for when an [instrument](./instruments) should be mutated should be triggered. +You can set conditions for when an [instrument](./instruments) should be mutated or an [event](./events) should be triggered. ## Condition configuration diff --git a/docs/source/configuration/telemetry/instrumentation/events.mdx b/docs/source/configuration/telemetry/instrumentation/events.mdx index 71380f816b..d2bd1844a2 100644 --- a/docs/source/configuration/telemetry/instrumentation/events.mdx +++ b/docs/source/configuration/telemetry/instrumentation/events.mdx @@ -5,8 +5,9 @@ description: Capture standard and custom events from the Apollo Router's request --- import RouterServices from '../../../../shared/router-lifecycle-services.mdx'; +import TelemetryPerformanceNote from '../../../../shared/telemetry-performance.mdx'; -An **event** is used to signal when something of note happens in the [Apollo Router's request lifecycle](../../../customizations/overview/#the-request-lifecycle). Events are output to both logs and traces. +An _event_ is used to signal when something of note happens in the [Apollo Router's request lifecycle](../../../customizations/overview/#the-request-lifecycle). Events are output to both logs and traces. You can configure events for each service in `router.yaml`. Events can be standard or custom, and they can be triggered by configurable conditions. @@ -75,6 +76,12 @@ telemetry: # Custom event configuration ``` + + + + + + ### `message` Each custom event must have a message. This is a fixed value, and custom attributes should be used to add additional information. @@ -185,9 +192,9 @@ telemetry: - request_header: "x-log-request" supergraph: - # ... + # Custom event configuration for supergraph service ... subgraph: - # ... + # Custom event configuration for subgraph service ... ``` ## Event configuration reference diff --git a/docs/source/configuration/telemetry/instrumentation/instruments.mdx b/docs/source/configuration/telemetry/instrumentation/instruments.mdx index 6d26b18b67..b8837a9c1b 100644 --- a/docs/source/configuration/telemetry/instrumentation/instruments.mdx +++ b/docs/source/configuration/telemetry/instrumentation/instruments.mdx @@ -5,6 +5,7 @@ description: Create and customize instruments to collect data and report measure --- import RouterServices from '../../../../shared/router-lifecycle-services.mdx'; +import TelemetryPerformanceNote from '../../../../shared/telemetry-performance.mdx'; @@ -100,6 +101,12 @@ telemetry: description: "my description" ``` + + + + + + #### Instrument naming conventions Make sure to follow naming conventions for instruments. For reference, the [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/general/metrics/) can help guide you to: @@ -338,8 +345,8 @@ telemetry: | `` | | | The name of the custom attribute. | | `` | | | The name of the custom instrument. | | `attributes` | [standard attributes](./standard-attributes) or [selectors](./selectors) | | The attributes of the custom instrument. | -| `condition` | [conditions](./conditions) | | The a condition for mutating the instrument. | -| `default_requirement_level` | `required`\|`recommended` | `required` | The default attribute requirement level. | +| `condition` | [conditions](./conditions) | | The condition for mutating the instrument. | +| `default_requirement_level` | `required`\|`recommended` | `required` | The default attribute requirement level. | | `type` | `counter`\|`histogram` | | The name of the custom instrument. | | `unit` | | | A unit name, for example `By` or `{request}`.| | `description` | | | The description of the custom instrument. | diff --git a/docs/source/configuration/telemetry/instrumentation/selectors.mdx b/docs/source/configuration/telemetry/instrumentation/selectors.mdx index 6e56b7e153..f4c0398a56 100644 --- a/docs/source/configuration/telemetry/instrumentation/selectors.mdx +++ b/docs/source/configuration/telemetry/instrumentation/selectors.mdx @@ -5,7 +5,7 @@ description: Extract and select data from the Apollo Router's pipeline services --- import RouterServices from '../../../../shared/router-lifecycle-services.mdx'; -A **selector** is used to extract data from the Apollo Router's request lifecycle (pipeline) services and attach them to telemetry, specifically [spans](./spans), [instruments](./instruments), [conditions](./conditions). +A _selector_ is used to extract data from the Apollo Router's request lifecycle (pipeline) services and attach them to telemetry, specifically [spans](./spans), [instruments](./instruments), [conditions](./conditions) and [events](./events). Each service of the router pipeline (`router`, `supergraph`, `subgraph`) has its own available selectors. @@ -39,6 +39,8 @@ The router service is the initial entrypoint for all requests. It is HTTP centri | `response_context` | Yes | | The name of a response context key | | `baggage` | Yes | | The name of a baggage item | | `env` | Yes | | The name of an environment variable | +| `on_graphql_error` | No | `true`|`false` | Boolean set to true if the response payload contains a graphql error | +| `static` | No | | A static string value | #### Supergraph @@ -46,9 +48,9 @@ The supergraph service is executed after query parsing but before query executio | Selector | Defaultable | Values | Description | |--------------------|-------------|-------------------------------------|--------------------------------------| -| `operation_name` | Yes | | The operation name from the query | +| `operation_name` | Yes | `string`|`hash` | The operation name from the query | | `operation_kind` | No | `string` | The operation kind from the query | -| `query` | Yes | `string` | The graphql query | +| `query` | Yes | `string` | The graphql query | | `query_variable` | Yes | | The name of a graphql query variable | | `request_header` | Yes | | The name of a request header | | `response_header` | Yes | | The name of a response header | @@ -56,6 +58,7 @@ The supergraph service is executed after query parsing but before query executio | `response_context` | Yes | | The name of a response context key | | `baggage` | Yes | | The name of a baggage item | | `env` | Yes | | The name of an environment variable | +| `static` | No | | A static string value | #### Subgraph @@ -64,20 +67,21 @@ The subgraph service executes multiple times during query execution, with each e | Selector | Defaultable | Values | Description | |-----------------------------|-------------|-------------------------------------|---------------------------------------------------------------------------------| -| `subgraph_operation_name` | Yes | | The operation name from the subgraph query | +| `subgraph_operation_name` | Yes | `string`|`hash` | The operation name from the subgraph query | | `subgraph_operation_kind` | No | `string` | The operation kind from the subgraph query | -| `subgraph_query` | Yes | | The graphql query to the subgraph | +| `subgraph_query` | Yes | `string` | The graphql query to the subgraph | | `subgraph_query_variable` | Yes | | The name of a subgraph query variable | | `subgraph_response_data` | Yes | | Json Path into the subgraph response body data (it might impact performances) | | `subgraph_response_errors` | Yes | | Json Path into the subgraph response body errors (it might impact performances) | | `subgraph_request_header` | Yes | | The name of a subgraph request header | | `subgraph_response_header` | Yes | | The name of a subgraph response header | -| `subgraph_response_status` | Yes | | The status of a subgraph response | -| `supergraph_operation_name` | Yes | | The operation name from the supergraph query | +| `subgraph_response_status` | Yes | `code`\|`reason` | The status of a subgraph response | +| `supergraph_operation_name` | Yes | `string`|`hash` | The operation name from the supergraph query | | `supergraph_operation_kind` | Yes | `string` | The operation kind from the supergraph query | -| `supergraph_query` | Yes | | The graphql query to the supergraph | +| `supergraph_query` | Yes | `string` | The graphql query to the supergraph | | `supergraph_query_variable` | Yes | | The name of a supergraph query variable | | `request_context` | Yes | | The name of a request context key | | `response_context` | Yes | | The name of a response context key | | `baggage` | Yes | | The name of a baggage item | | `env` | Yes | | The name of an environment variable | +| `static` | No | | A static string value | diff --git a/docs/source/configuration/telemetry/instrumentation/spans.mdx b/docs/source/configuration/telemetry/instrumentation/spans.mdx index 41fc4c399b..10776c8aba 100644 --- a/docs/source/configuration/telemetry/instrumentation/spans.mdx +++ b/docs/source/configuration/telemetry/instrumentation/spans.mdx @@ -58,6 +58,24 @@ telemetry: response_header: "x-my-header" ``` +You can also have [conditions](./conditions) on custom attributes using [selectors](./selectors). You can only have conditions on a selector at the same execution level. +Example you can't have a condition on `response_header` if you want to set an attribute from `request_header`. + +```yaml title="desc.router.yaml" +telemetry: + instrumentation: + spans: + router: + attributes: + on_error: + response_status: reason + condition: + not: + eq: + - response_status: code + - 200 +``` + ### `default_attribute_requirement_level` The `default_attribute_requirement_level` option sets the default attributes to attach to spans, as defined by [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/otel/common/attribute-requirement-level/). @@ -153,6 +171,18 @@ telemetry: http.request.method: false # ... + # Conditional custom attribute + otel.status_description: # You can conditionally put a status description attribute on your span if it respect the condition + static: "there was an error" + condition: # http response status code != 200 or it contains a graphql error in the payload + any: + - not: + eq: + - response_status: code + - 200 + - eq: + - on_graphql_error + - true # Custom attributes "acme.custom_1": trace_id: datadog @@ -178,7 +208,7 @@ telemetry: |---------------------------------------|---------------------------------------------------------------------------|--------------------------------|------------------------------------------| | `` | | | The name of the custom attribute. | | `attributes` | [standard attributes](./standard-attributes)\|[selectors](./selectors) | | The attributes of the span. | +| `condition` | [conditions](./conditions) | | The condition for adding a custom attribute. | | `default_attribute_requirement_level` | `required`\|`recommended` | `required` | The default attribute requirement level. | -| `legacy_request_span` | `true`\|`false` | | Include the `request` span in traces. | | `mode` | `spec_compliant` \| `deprecated` | `deprecated` | The attributes of the span. | diff --git a/docs/source/configuration/telemetry/instrumentation/standard-attributes.mdx b/docs/source/configuration/telemetry/instrumentation/standard-attributes.mdx index e3ed5c8fb7..b5ca205c2c 100644 --- a/docs/source/configuration/telemetry/instrumentation/standard-attributes.mdx +++ b/docs/source/configuration/telemetry/instrumentation/standard-attributes.mdx @@ -6,7 +6,7 @@ description: Attach OpenTelemetry standard attributes to Apollo Router telemetry import RouterServices from '../../../../shared/router-lifecycle-services.mdx'; -[OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/) define a set of **standard attributes** that can be attached to [spans](./spans). These attributes are used to filter and group data in your application performance monitor (APM). +[OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/) define a set of **standard attributes** that can be attached to [spans](./spans), [instruments](./instruments) and [events](./events). These attributes are used to filter and group data in your application performance monitor (APM). The attributes available depend on the service of the router pipeline. @@ -81,9 +81,9 @@ Standard attributes of the `supergraph` service: | Attribute | Values | Description | |-----------------------------|-------------------------------------|---------------------------------------------| -| `graphql.operation.name` | | The operation name from the graphql query | +| `graphql.operation.name` | | The operation name from the graphql query (need `spec_compliant` [mode](./spans/#mode) to disable it) | | `graphql.operation.type` | `query`\|`mutation`\|`subscription` | The operation kind from the subgraph query | -| `graphql.document` | | The GraphQL query to the subgraph | +| `graphql.document` | | The GraphQL query to the subgraph (need `spec_compliant` [mode](./spans/#mode) to disable it) | #### Subgraph @@ -92,7 +92,7 @@ Standard attributes of the `subgraph` service: | Attribute | Values | Description | |------------------------------------|-------------------------------------|------------------------------------------------| -| `subgraph.name` | | The name of the subgraph | -| `subgraph.graphql.operation.name` | | The operation name from the subgraph query | +| `subgraph.name` | | The name of the subgraph (need `spec_compliant` [mode](./spans/#mode) to disable it) | +| `subgraph.graphql.operation.name` | | The operation name from the subgraph query (need `spec_compliant` [mode](./spans/#mode) to disable it) | | `subgraph.graphql.operation.type` | `query`\|`mutation`\|`subscription` | The operation kind from the subgraph query | -| `subgraph.graphql.document` | | The GraphQL query to the subgraph | +| `subgraph.graphql.document` | | The GraphQL query to the subgraph (need `spec_compliant` [mode](./spans/#mode) to disable it) | diff --git a/docs/source/configuration/telemetry/overview.mdx b/docs/source/configuration/telemetry/overview.mdx index 374ab96970..86513584b7 100644 --- a/docs/source/configuration/telemetry/overview.mdx +++ b/docs/source/configuration/telemetry/overview.mdx @@ -4,6 +4,8 @@ subtitle: Collect observable data to monitor your router and supergraph description: Observe and monitor the health and performance of the Apollo Router and the supergraph by collecting and exporting telemetry logs, metrics, and traces --- +import TelemetryPerformanceNote from '../../../shared/telemetry-performance.mdx'; + In this overview, learn about: - How Apollo Router telemetry enables supergraph observability and debuggability - What data is captured in the router's logs, metrics, and traces @@ -148,3 +150,9 @@ You can use [standard attributes](./instrumentation/standard-attributes) or [sel [Custom attributes for spans](./instrumentation/spans/#attributes) require a GraphOS [Dedicated or Enterprise plan](https://www.apollographql.com/pricing#observability). + +## Best practices + +### Balancing telemetry and router performance + + diff --git a/docs/source/configuration/traffic-shaping.mdx b/docs/source/configuration/traffic-shaping.mdx index df53d9c34c..573dff2209 100644 --- a/docs/source/configuration/traffic-shaping.mdx +++ b/docs/source/configuration/traffic-shaping.mdx @@ -9,7 +9,7 @@ the traffic between the client and router and between the router and subgraphs. ## Configuration -To enable traffic shaping, add the `traffic_shaping` plugin to your [YAML config file](./overview/#yaml-config-file), like so: +By default, the `traffic_shaping` plugin is enabled with [preset values](#preset-values). To override presets, add `traffic_shaping` to your [YAML config file](./overview/#yaml-config-file) like so: ```yaml title="router.yaml" traffic_shaping: @@ -37,6 +37,13 @@ traffic_shaping: experimental_http2: enable # Configures HTTP/2 usage. Can be 'enable' (default), 'disable' or 'http2only' ``` +### Preset values + +The preset values of `traffic_shaping` that's enabled by default: + +- `timeout: 30s` for all timeouts +- `experimental_http2: enable` + ## Client side traffic shaping ### Rate limiting @@ -121,11 +128,17 @@ It currently supports these algorithms: `gzip`, `br`, and `deflate`. ```yaml title="router.yaml" traffic_shaping: all: - compression: br # Enable brotli compression for all subgraphs. + compression: gzip # Enable gzip compression for all subgraphs. ``` Subgraph response decompression is always supported for these algorithms: `gzip`, `br`, and `deflate`. + + +Brotli (`br`) compression is not supported by Apollo Server, due to its underlying Express.js not supporting it out of the box. Therefore, don't configure `br` compression for traffic shaping when using Apollo Server as a subgraph server with the router. + + + ### Rate limiting Subgraph request rate limiting uses the same configuration as client rate limiting, and is calculated per subgraph, not per backend host. diff --git a/docs/source/customizations/rhai.mdx b/docs/source/customizations/rhai.mdx index 05a9a978dd..a76729557c 100644 --- a/docs/source/customizations/rhai.mdx +++ b/docs/source/customizations/rhai.mdx @@ -187,6 +187,7 @@ Each Apollo Router service has a corresponding function that a Rhai script can d ##### `RouterService` +`router_service` @@ -194,6 +195,8 @@ Runs at the very beginning and very end of the HTTP request lifecycle. For example, [JWT authentication](../configuration/authn-jwt) is performed within the `RouterService`. +Define `router_service` if your customization needs to interact with HTTP `context` and `headers`. It doesn't support access to the `body` property (see [this GitHub issue](https://github.com/apollographql/router/issues/3642) for details). + diff --git a/docs/source/federation-version-support.mdx b/docs/source/federation-version-support.mdx index 7e44a9dee6..44a7c65a72 100644 --- a/docs/source/federation-version-support.mdx +++ b/docs/source/federation-version-support.mdx @@ -35,7 +35,15 @@ The table below shows which version of federation each router release is compile - v1.45.0 and later (see latest releases) + v1.46.0 and later (see latest releases) + + + 2.7.5 + + + + + v1.45.0 2.7.2 diff --git a/examples/supergraph-sdl/rust/Cargo.toml b/examples/supergraph-sdl/rust/Cargo.toml index 09cd627dad..9bf12b0972 100644 --- a/examples/supergraph-sdl/rust/Cargo.toml +++ b/examples/supergraph-sdl/rust/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] anyhow = "1" -apollo-compiler = "1.0.0-beta.16" +apollo-compiler = "=1.0.0-beta.16" apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" tower = { version = "0.4", features = ["full"] } diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 05278801ee..8151da867a 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -17,9 +17,10 @@ apollo-parser.workspace = true env_logger = "0.10.2" log = "0.4" reqwest = { workspace = true, features = ["json", "blocking"] } -router-bridge.workspace = true serde_json.workspace = true tokio.workspace = true +# note: this dependency should _always_ be pinned, prefix the version with an `=` +router-bridge = "=0.5.21+v2.7.5" [dev-dependencies] anyhow = "1" diff --git a/fuzz/fuzz_targets/federation.rs b/fuzz/fuzz_targets/federation.rs index 7cc951692a..bd0577048e 100644 --- a/fuzz/fuzz_targets/federation.rs +++ b/fuzz/fuzz_targets/federation.rs @@ -1,6 +1,4 @@ #![no_main] -mod invariant_router; - use std::fs::OpenOptions; use std::io::Write; diff --git a/helm/chart/router/Chart.yaml b/helm/chart/router/Chart.yaml index a2882ca4c3..756c9b6baf 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.45.1 +version: 1.46.0 # 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.45.1" +appVersion: "v1.46.0" diff --git a/helm/chart/router/README.md b/helm/chart/router/README.md index 287502706b..77956fb709 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.45.1](https://img.shields.io/badge/Version-1.45.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.45.1](https://img.shields.io/badge/AppVersion-v1.45.1-informational?style=flat-square) +![Version: 1.46.0](https://img.shields.io/badge/Version-1.46.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.46.0](https://img.shields.io/badge/AppVersion-v1.46.0-informational?style=flat-square) ## Prerequisites @@ -11,7 +11,7 @@ ## Get Repo Info ```console -helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.45.1 +helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.46.0 ``` ## Install Chart @@ -19,7 +19,7 @@ helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.45.1 **Important:** only helm3 is supported ```console -helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.45.1 --values my-values.yaml +helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.46.0 --values my-values.yaml ``` _See [configuration](#configuration) below._ @@ -95,4 +95,4 @@ helm show values oci://ghcr.io/apollographql/helm-charts/router | virtualservice.enabled | bool | `false` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/licenses.html b/licenses.html index 1e2c8a0a04..79f5e66beb 100644 --- a/licenses.html +++ b/licenses.html @@ -44,8 +44,8 @@

Third Party Licenses

Overview of licenses:

    -
  • Apache License 2.0 (481)
  • -
  • MIT License (154)
  • +
  • Apache License 2.0 (482)
  • +
  • MIT License (152)
  • BSD 3-Clause "New" or "Revised" License (12)
  • ISC License (11)
  • BSD 2-Clause "Simplified" License (3)
  • @@ -5282,6 +5282,7 @@

    Used by:

  • serde
  • serde_bytes
  • serde_derive
  • +
  • serde_derive_internals
  • serde_json
  • serde_path_to_error
  • serde_qs
  • @@ -8241,6 +8242,7 @@

    Used by:

  • either
  • envmnt
  • equivalent
  • +
  • errno
  • event-listener
  • fastrand
  • fastrand
  • @@ -8346,7 +8348,6 @@

    Used by:

  • security-framework-sys
  • semver
  • semver-parser
  • -
  • serde_derive_internals
  • serde_json_bytes
  • serde_yaml
  • shellexpand
  • @@ -11535,7 +11536,9 @@

    Used by:

    Apache License 2.0

    Used by:

    ../../LICENSE-APACHE
    @@ -12187,8 +12190,6 @@

    Used by:

    Apache License 2.0

    Used by:

      -
    • apollo-compiler
    • -
    • apollo-parser
    • curve25519-dalek-derive
    • deadpool-runtime
    • deno-proc-macro-rules
    • @@ -12684,7 +12685,7 @@

      Used by:

      BSD 3-Clause "New" or "Revised" License

      Used by:

      Copyright (c) 2016-2021 isis agora lovecruft. All rights reserved.
       Copyright (c) 2016-2021 Henry de Valence. All rights reserved.
      @@ -13266,13 +13267,9 @@ 

      Used by:

      -
      Copyright 2021 Apollo Graph, Inc.
      +                
      Elastic License 2.0
       
      -Source code in this repository is covered by (i) the Elastic License 2.0 or (ii) an MIT compatible license, in each case, as designated by a licensing file in a subdirectory or file header. The default throughout the repository is a license under the Elastic License 2.0, unless a file header or a licensing file in a subdirectory specifies another license.
      -
      ---------------------------------------------------------------------------------
      -
      -Elastic License 2.0
      +URL: https://www.elastic.co/licensing/elastic-license
       
       ## Acceptance
       
      @@ -13363,8 +13360,7 @@ 

      Used by:

      **use** means anything you do with the software requiring one of your licenses. **trademark** means trademarks, service marks, and similar rights. - ---------------------------------------------------------------------------------
      +
    • ISC License

      @@ -14457,8 +14453,6 @@

      Used by:

    • tracing-core
    • tracing-futures
    • tracing-log
    • -
    • tracing-log
    • -
    • tracing-opentelemetry
    • tracing-serde
    • tracing-subscriber
    diff --git a/scripts/install.sh b/scripts/install.sh index e938a1fc4e..dad2182d10 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.45.1" +PACKAGE_VERSION="v1.46.0" download_binary() { downloader --check diff --git a/xtask/src/commands/test.rs b/xtask/src/commands/test.rs index 13c9c4ba00..efb84af491 100644 --- a/xtask/src/commands/test.rs +++ b/xtask/src/commands/test.rs @@ -2,6 +2,7 @@ use anyhow::Result; use xtask::*; const TEST_DEFAULT_ARGS: &[&str] = &["test"]; +const NEXTEST_DEFAULT_ARGS: &[&str] = &["nextest", "run"]; #[derive(Debug, clap::Parser)] pub struct Test { @@ -26,30 +27,57 @@ impl Test { pub fn run(&self) -> Result<()> { eprintln!("Running tests"); - let mut args = TEST_DEFAULT_ARGS - .iter() - .map(|s| s.to_string()) - .collect::>(); - if let Some(jobs) = self.jobs { - args.push("--jobs".to_string()); - args.push(jobs.to_string()); - } + // Check if cargo-nextest is available. If it is, + // we'll use that instead of cargo test. We will pass + // --locked and --workspace to cargo-nextest if they are + // desired by the configuration, but not any other arguments. + // In the event that cargo-nextest is not available, we will + // fall back to cargo test and pass all the arguments. + if let Ok(_) = which::which("cargo-nextest") { + let mut args = NEXTEST_DEFAULT_ARGS + .iter() + .map(|s| s.to_string()) + .collect::>(); - if self.locked { - args.push("--locked".to_string()); - } + if self.locked { + args.push("--locked".to_string()); + } - if self.workspace { - args.push("--workspace".to_string()); - } + if self.workspace { + args.push("--workspace".to_string()); + } + + cargo!(args); + return Ok(()); + } else { + eprintln!("cargo-nextest not found, falling back to cargo test"); + + let mut args = TEST_DEFAULT_ARGS + .iter() + .map(|s| s.to_string()) + .collect::>(); + + if self.locked { + args.push("--locked".to_string()); + } + + if self.workspace { + args.push("--workspace".to_string()); + } + + if let Some(jobs) = self.jobs { + args.push("--jobs".to_string()); + args.push(jobs.to_string()); + } - args.push("--".to_string()); + args.push("--".to_string()); - if let Some(threads) = self.test_threads { - args.push("--test-threads".to_string()); - args.push(threads.to_string()); + if let Some(threads) = self.test_threads { + args.push("--test-threads".to_string()); + args.push(threads.to_string()); + } + cargo!(args); + Ok(()) } - cargo!(args); - Ok(()) } }