diff --git a/.github/workflows/benchmark_comment.yml b/.github/workflows/benchmark_comment.yml index e04229e8b0..8fc3d567d1 100644 --- a/.github/workflows/benchmark_comment.yml +++ b/.github/workflows/benchmark_comment.yml @@ -9,7 +9,7 @@ on: jobs: macro_benchmarks_comment: name: Benchmark comment on commit - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 if: > github.event.workflow_run.conclusion == 'success' steps: diff --git a/.github/workflows/benchmark_pr_track.yml b/.github/workflows/benchmark_pr_track.yml index 1f460a26ba..ff55501085 100644 --- a/.github/workflows/benchmark_pr_track.yml +++ b/.github/workflows/benchmark_pr_track.yml @@ -12,7 +12,7 @@ concurrency: jobs: micro_benchmarks_pr_track: if: github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 env: BENCHMARK_RESULTS: benchmark_results.txt PR_EVENT: event.json diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml index 72a1f36f03..7f2121a14b 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build-website.yml @@ -7,7 +7,7 @@ on: jobs: build_website: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - name: Build website env: diff --git a/.github/workflows/build_matrix.yml b/.github/workflows/build_matrix.yml index 3e09d85b9a..555bc8239e 100644 --- a/.github/workflows/build_matrix.yml +++ b/.github/workflows/build_matrix.yml @@ -10,7 +10,7 @@ jobs: # IMPORTANT: in case of changing the structure of this file make sure to test # the changes against `npm/gen-root.ts` file setup-matrix: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 outputs: matrix: ${{ steps.setup-matrix.outputs.matrix }} steps: @@ -33,34 +33,34 @@ jobs: ] include: - build: linux-x64-gnu - os: ubuntu-latest + os: blacksmith-4vcpu-ubuntu-2204 rust: stable target: x86_64-unknown-linux-gnu libc: glibc - build: linux-x64-musl - os: ubuntu-latest + os: blacksmith-4vcpu-ubuntu-2204 rust: stable target: x86_64-unknown-linux-musl libc: musl cross: true - build: linux-arm64-gnu - os: ubuntu-latest + os: blacksmith-4vcpu-ubuntu-2204 rust: stable target: aarch64-unknown-linux-gnu libc: glibc cross: true - build: linux-arm64-musl - os: ubuntu-latest + os: blacksmith-4vcpu-ubuntu-2204 rust: stable target: aarch64-unknown-linux-musl libc: musl cross: true - build: linux-ia32-gnu - os: ubuntu-latest + os: blacksmith-4vcpu-ubuntu-2204 rust: stable target: i686-unknown-linux-gnu libc: glibc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64f1eef074..9d0a9d7890 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: check_if_build: name: Check if Build - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: actions/checkout@v4 @@ -40,7 +40,7 @@ jobs: test_aws_build: name: Test AWS Lambda Build if: github.event_name == 'pull_request' - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 defaults: run: working-directory: ./tailcall-aws-lambda @@ -52,7 +52,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Install Python - uses: actions/setup-python@v5 + uses: useblacksmith/setup-python@v6 with: python-version: "3.12" @@ -64,7 +64,7 @@ jobs: test_wasm: name: Run Tests (WASM) - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 defaults: run: working-directory: ./tailcall-wasm @@ -76,7 +76,7 @@ jobs: target: wasm32-unknown-unknown - name: Install Node.js - uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 with: node-version: "20.11.0" @@ -90,7 +90,7 @@ jobs: test_cf: name: Run Tests (Cloudflare) - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 defaults: run: working-directory: ./tailcall-cloudflare @@ -104,7 +104,7 @@ jobs: target: wasm32-unknown-unknown - name: Install Node.js - uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 with: node-version: "20.11.0" @@ -116,17 +116,20 @@ jobs: test: name: Run Tests on ${{ matrix.build }} - runs-on: ${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'blacksmith-4vcpu-ubuntu-2204' }} needs: setup_build_matrix strategy: fail-fast: false matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }} + env: + WITH_COVERAGE: ${{ matrix.build == 'darwin-arm64' }} + steps: - uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 with: node-version: "20.11.0" - name: Install Prettier @@ -142,7 +145,7 @@ jobs: - name: Cache NASM if: runner.os == 'Windows' - uses: actions/cache@v4 + uses: useblacksmith/cache@v5 with: path: | nasm-2.16.02 @@ -164,15 +167,28 @@ jobs: } echo "$(Resolve-Path nasm-2.16.02)" >> $env:GITHUB_PATH - - uses: taiki-e/install-action@cargo-llvm-cov + - name: Install insta test runner + if: ${{ env.WITH_COVERAGE == 'false' && matrix.test != 'false' }} + uses: taiki-e/install-action@v2 + with: + tool: cargo-insta + + - name: Run cargo insta test + if: ${{ env.WITH_COVERAGE == 'false' && matrix.test != 'false' }} + run: cargo insta test --unreferenced reject --workspace --target ${{ matrix.target }} + + - name: Install llvm-cov test runner + if: ${{ env.WITH_COVERAGE == 'true' && matrix.test != 'false' }} + uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov - - name: Run Cargo Test - if: matrix.test != 'false' - # TODO: run llvm-cov only for single build since other builds are not sent to codecov anyway + - name: Run cargo llvm-cov test + if: ${{ env.WITH_COVERAGE == 'true' && matrix.test != 'false' }} run: cargo llvm-cov --workspace ${{ matrix.features }} --lcov --target ${{ matrix.target }} --output-path lcov.info - name: Upload Coverage to Codecov - if: matrix.build == 'darwin-arm64' + if: ${{ env.WITH_COVERAGE == 'true' && matrix.test != 'false' }} uses: Wandalen/wretry.action@v3 with: action: codecov/codecov-action@v4 @@ -185,7 +201,7 @@ jobs: check-examples: name: Check Examples - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: actions/checkout@v4 - name: Set up Rust @@ -207,7 +223,7 @@ jobs: draft_release: name: Draft Release if: github.event_name == 'push' && github.ref == 'refs/heads/main' - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 permissions: contents: write pull-requests: write @@ -237,7 +253,7 @@ jobs: needs: [setup_build_matrix, test, draft_release, check_if_build, test_cf, test_wasm] # TODO: put a condition to separate job that other will depend on to remove duplication? if: github.event_name == 'push' && github.ref == 'refs/heads/main' && (needs.check_if_build.outputs.check_if_build == 'true') - runs-on: ${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'blacksmith-4vcpu-ubuntu-2204' }} strategy: fail-fast: false matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }} @@ -272,7 +288,7 @@ jobs: - name: Install Node.js if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') - uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 with: node-version: 20.11.0 registry-url: https://registry.npmjs.org @@ -316,7 +332,7 @@ jobs: name: Release (AWS Lambda) needs: [test, draft_release, check_if_build, test_cf] if: github.event_name == 'push' && github.ref == 'refs/heads/main' && (needs.check_if_build.outputs.check_if_build == 'true') - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 permissions: contents: write pull-requests: write @@ -332,7 +348,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Install Python - uses: actions/setup-python@v5 + uses: useblacksmith/setup-python@v6 with: python-version: "3.12" @@ -360,7 +376,7 @@ jobs: name: Semantic Release if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') needs: [draft_release, release, release_lambda] - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 permissions: contents: write pull-requests: write @@ -380,12 +396,12 @@ jobs: name: Publish NPM main package needs: [draft_release, release] if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - name: Checkout Current Branch (Fast) uses: actions/checkout@v4 - name: Install Node - uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 with: node-version: 20.11.0 registry-url: https://registry.npmjs.org @@ -425,7 +441,7 @@ jobs: APP_VERSION: ${{ needs.draft_release.outputs.create_release_name }} # Ensure APP_VERSION is set correctly needs: [draft_release, release] if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. permissions: contents: read @@ -468,7 +484,7 @@ jobs: permissions: contents: write pull-requests: write - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 016cb790f8..fa3663656a 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -9,7 +9,7 @@ on: jobs: label-sync: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c386752723..46778afd5f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ concurrency: jobs: lint: name: Run Formatter and Lint Check - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 permissions: pull-requests: write contents: write @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v4 + uses: useblacksmith/setup-node@v5 with: node-version: "20.11.0" - name: Install Prettier diff --git a/.github/workflows/pr-convention.yml b/.github/workflows/pr-convention.yml index 7492cd48cc..d319a0e8ed 100644 --- a/.github/workflows/pr-convention.yml +++ b/.github/workflows/pr-convention.yml @@ -12,7 +12,7 @@ permissions: jobs: title-check: name: Check PR Title - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - name: All PRs uses: amannn/action-semantic-pull-request@v5 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 59a7cfa8c8..f48360b4c0 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -18,7 +18,7 @@ jobs: permissions: contents: write pull-requests: write - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: release-drafter/release-drafter@v6 env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd3654e7e5..62e967add7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: deploy: name: Deploy App - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 concurrency: group: deploy-job cancel-in-progress: true diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 7e5708b558..dc34929602 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -19,7 +19,7 @@ on: jobs: check_spelling: name: Check spelling - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 22ea7987b7..07545a170c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -14,7 +14,7 @@ env: jobs: stale: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: actions/stale@v9 with: diff --git a/.github/workflows/test-jit.yml b/.github/workflows/test-jit.yml deleted file mode 100644 index 0f6ff6807c..0000000000 --- a/.github/workflows/test-jit.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Test JIT - -on: - push: - branches: - - main - pull_request: - types: [opened, reopened, synchronize, labeled] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - setup_build_matrix: - name: Outputs matrix used for cross compilation - uses: ./.github/workflows/build_matrix.yml - - test: - name: Run JIT tests on ${{ matrix.build }} - runs-on: ${{ matrix.os || '-latest' }} - needs: setup_build_matrix - if: "${{ contains(github.event.pull_request.labels.*.name, 'ci: test-jit') || github.event_name == 'push' }}" - strategy: - fail-fast: false - matrix: - build: - - darwin-arm64 - include: - - build: darwin-arm64 - os: macos-latest - rust: stable - target: aarch64-apple-darwin - - steps: - - uses: actions/checkout@v4 - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: "20.11.0" - - name: Install Prettier - run: npm i -g prettier - - - name: Install Rust Toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Install Cross compilation toolchain - uses: taiki-e/setup-cross-toolchain-action@v1 - with: - target: ${{ matrix.target }} - - - name: Run Cargo Test - run: cargo test --test execution_spec --features force_jit -- --logfile execution_spec_output.txt - env: - RUST_BACKTRACE: 0 - - - name: Show Test Output - if: ${{ always() }} - run: cat execution_spec_output.txt - - - name: Create Commit Comment - if: ${{ failure() }} - uses: peter-evans/commit-comment@v3 - with: - body-path: execution_spec_output.txt diff --git a/.graphqlrc.yml b/.graphqlrc.yml index 1e8b8bf1c2..8e19f17adb 100644 --- a/.graphqlrc.yml +++ b/.graphqlrc.yml @@ -1,5 +1,3 @@ schema: - "./examples/jsonplaceholder.graphql" - "./generated/.tailcallrc.graphql" - # for tests inside the repo - - "./tests/graphql_spec.graphql" diff --git a/Cargo.lock b/Cargo.lock index 21d0ed4fab..5e0fd46574 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -56,9 +56,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "android-tzdata" @@ -83,9 +83,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -98,43 +98,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "anymap2" @@ -231,9 +231,9 @@ dependencies = [ [[package]] name = "async-graphql" -version = "7.0.11" +version = "7.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba6d24703c5adc5ba9116901b92ee4e4c0643c01a56c4fd303f3818638d7449" +checksum = "10db7e8b2042f8d7ebcfebc482622411c23f88f3e9cd7fac74465b78fdab65f0" dependencies = [ "async-graphql-derive", "async-graphql-parser", @@ -250,13 +250,12 @@ dependencies = [ "futures-util", "handlebars", "http 1.1.0", - "indexmap 2.6.0", + "indexmap 2.7.0", "lru", "mime", "multer", "num-traits", - "once_cell", - "opentelemetry 0.25.0", + "opentelemetry 0.27.1", "pin-project-lite", "regex", "serde", @@ -264,14 +263,14 @@ dependencies = [ "serde_urlencoded", "static_assertions_next", "tempfile", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "async-graphql-derive" -version = "7.0.11" +version = "7.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a94c2d176893486bd37cd1b6defadd999f7357bf5804e92f510c08bcf16c538f" +checksum = "ad560d871a344178c35568a15be1bbb40cbcaced57838bf2eb1f654802000df7" dependencies = [ "Inflector", "async-graphql-parser", @@ -280,8 +279,8 @@ dependencies = [ "proc-macro2", "quote", "strum", - "syn 2.0.86", - "thiserror", + "syn 2.0.90", + "thiserror 1.0.69", ] [[package]] @@ -301,7 +300,7 @@ dependencies = [ "futures-locks", "libflate", "prost-build", - "protobuf 3.5.1", + "protobuf 3.7.1", "protobuf-codegen", "protox 0.6.1", "reqwest 0.11.27", @@ -319,9 +318,9 @@ dependencies = [ [[package]] name = "async-graphql-parser" -version = "7.0.11" +version = "7.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79272bdbf26af97866e149f05b2b546edb5c00e51b5f916289931ed233e208ad" +checksum = "1df338e3e6469f86cce1e2b0226644e9fd82ec04790e199f8dd06416632d89ea" dependencies = [ "async-graphql-value", "pest", @@ -331,21 +330,21 @@ dependencies = [ [[package]] name = "async-graphql-value" -version = "7.0.11" +version = "7.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5ec94176a12a8cbe985cd73f2e54dc9c702c88c766bdef12f1f3a67cedbee1" +checksum = "d4cffd8bb84bc7895672c4e9b71d21e35526ffd645a29aedeed165a3f4a7ba9b" dependencies = [ "bytes", - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_json", ] [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock", "cfg-if", @@ -407,7 +406,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -458,9 +457,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -469,13 +468,13 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -492,7 +491,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -503,9 +502,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws_lambda_events" @@ -653,7 +652,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.86", + "syn 2.0.90", "which 4.4.2", ] @@ -663,7 +662,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", ] [[package]] @@ -672,6 +680,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -750,9 +764,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ "serde", ] @@ -779,15 +793,15 @@ dependencies = [ "sha2 0.10.8", "ssri", "tempfile", - "thiserror", + "thiserror 1.0.69", "walkdir", ] [[package]] name = "cacache" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a61ff12b19d89c752c213316b87fdb4a587f073d219b893cc56974b8c9f39bf7" +checksum = "5c5063741c7b2e260bbede781cf4679632dd90e2718e99f7715e46824b65670b" dependencies = [ "digest 0.10.7", "either", @@ -804,7 +818,7 @@ dependencies = [ "sha2 0.10.8", "ssri", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "walkdir", @@ -830,9 +844,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.21" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "shlex", ] @@ -932,9 +946,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -942,9 +956,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -961,20 +975,20 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -1053,9 +1067,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -1245,7 +1259,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -1267,14 +1281,14 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "dary_heap" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" +checksum = "04d2cd9c18b9f454ed67da600630b021a8a80bf33f8c95896ab33aaf1c26b728" [[package]] name = "dashmap" @@ -1292,9 +1306,9 @@ dependencies = [ [[package]] name = "datatest-stable" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a560b3fd20463b56397bd457aa71243ccfdcffe696050b66e3b1e0ec0457e7f1" +checksum = "833306ca7eec4d95844e65f0d7502db43888c5c1006c6c517e8cf51a27d15431" dependencies = [ "camino", "fancy-regex", @@ -1319,7 +1333,7 @@ checksum = "74ef43543e701c01ad77d3a5922755c6a1d71b22d942cb8042be4994b380caff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -1370,7 +1384,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", "unicode-xid", ] @@ -1383,7 +1397,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -1454,6 +1468,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -1489,9 +1514,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1525,12 +1550,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1595,12 +1620,12 @@ dependencies = [ [[package]] name = "fancy-regex" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ - "bit-set", - "regex-automata 0.4.8", + "bit-set 0.8.0", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -1615,9 +1640,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "fixedbitset" @@ -1658,9 +1683,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1689,9 +1714,9 @@ checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1706,9 +1731,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ "fastrand", "futures-core", @@ -1736,7 +1761,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -1806,7 +1831,7 @@ dependencies = [ "derive_more", "eventsource-stream", "futures", - "reqwest 0.12.7", + "reqwest 0.12.9", "reqwest-eventsource", "serde", "serde_json", @@ -1839,9 +1864,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -1924,7 +1949,7 @@ dependencies = [ "serde", "serde-wasm-bindgen 0.5.0", "serde_urlencoded", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "web-sys", ] @@ -1944,7 +1969,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1970,7 +1995,7 @@ dependencies = [ "js-sys", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "web-sys", ] @@ -2041,7 +2066,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -2069,7 +2094,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2090,9 +2115,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", @@ -2313,9 +2338,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2377,9 +2402,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", @@ -2433,14 +2458,14 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-util", - "rustls 0.23.18", + "rustls 0.23.19", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.6", + "webpki-roots 0.26.7", ] [[package]] @@ -2466,7 +2491,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.1", "pin-project-lite", "socket2", "tokio", @@ -2497,6 +2522,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2505,12 +2648,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -2531,12 +2685,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] @@ -2581,9 +2735,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" @@ -2629,27 +2783,19 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -2684,7 +2830,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", - "bit-set", + "bit-set 0.5.3", "ena", "itertools 0.11.0", "lalrpop-util", @@ -2705,7 +2851,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.8", + "regex-automata 0.4.9", ] [[package]] @@ -2723,7 +2869,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.1", "lambda_runtime", "mime", "percent-encoding", @@ -2749,7 +2895,7 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "http-serde 2.1.1", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-util", "lambda_runtime_api_client", "pin-project", @@ -2775,7 +2921,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-util", "tokio", "tower", @@ -2804,9 +2950,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" [[package]] name = "libflate" @@ -2874,14 +3020,14 @@ dependencies = [ [[package]] name = "libtest-mimic" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc0bda45ed5b3a2904262c1bb91e526127aa70e7ef3758aba2ef93cf896b9b58" +checksum = "5297962ef19edda4ce33aaa484386e0a5b3d7f2f4e037cbeee00503ef6b29d33" dependencies = [ + "anstream", + "anstyle", "clap", "escape8259", - "termcolor", - "threadpool", ] [[package]] @@ -2896,6 +3042,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -2936,7 +3088,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.8.5", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -2954,7 +3106,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.0", + "hashbrown 0.15.2", ] [[package]] @@ -3060,19 +3212,19 @@ checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ "miette-derive 5.10.0", "once_cell", - "thiserror", + "thiserror 1.0.69", "unicode-width", ] [[package]] name = "miette" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" dependencies = [ "cfg-if", - "miette-derive 7.2.0", - "thiserror", + "miette-derive 7.4.0", + "thiserror 1.0.69", "unicode-width", ] @@ -3084,18 +3236,18 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -3125,9 +3277,9 @@ dependencies = [ [[package]] name = "minicov" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" +checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" dependencies = [ "cc", "walkdir", @@ -3191,7 +3343,7 @@ dependencies = [ "rustc_version", "smallvec", "tagptr", - "thiserror", + "thiserror 1.0.69", "triomphe", "uuid", ] @@ -3374,7 +3526,7 @@ dependencies = [ "libloading 0.7.4", "nvml-wrapper-sys", "static_assertions", - "thiserror", + "thiserror 1.0.69", "wrapcenum-derive", ] @@ -3389,9 +3541,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -3437,21 +3589,20 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "opentelemetry" -version = "0.25.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "803801d3d3b71cd026851a53f974ea03df3d179cb758b260136a6c9e22e196af" +checksum = "ab70038c28ed37b97d8ed414b6429d343a8bbf44c9f79ec854f3a643029ba6d7" dependencies = [ "futures-core", "futures-sink", "js-sys", - "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3492,7 +3643,7 @@ dependencies = [ "opentelemetry-proto", "opentelemetry_sdk", "prost 0.12.6", - "thiserror", + "thiserror 1.0.69", "tokio", "tonic 0.11.0", ] @@ -3539,10 +3690,10 @@ dependencies = [ "futures-util", "opentelemetry 0.23.0", "opentelemetry_sdk", - "ordered-float 4.2.2", + "ordered-float 4.5.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3574,11 +3725,11 @@ dependencies = [ "lazy_static", "once_cell", "opentelemetry 0.23.0", - "ordered-float 4.2.2", + "ordered-float 4.5.0", "percent-encoding", "rand", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -3600,9 +3751,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.2.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" +checksum = "c65ee1f9701bf938026630b455d5315f490640234259037edb259798b3bcf85e" dependencies = [ "num-traits", ] @@ -3650,9 +3801,9 @@ checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" [[package]] name = "pathdiff" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pem" @@ -3672,20 +3823,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.69", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -3693,22 +3844,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "pest_meta" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -3722,7 +3873,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.6.0", + "indexmap 2.7.0", ] [[package]] @@ -3752,7 +3903,7 @@ dependencies = [ "serde", "serde_derive", "strum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3763,29 +3914,29 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -3844,9 +3995,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", @@ -3901,12 +4052,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -3925,14 +4076,14 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.21", + "toml_edit 0.22.22", ] [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -3949,7 +4100,7 @@ dependencies = [ "memchr", "parking_lot", "protobuf 2.28.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3964,12 +4115,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" dependencies = [ "bytes", - "prost-derive 0.13.3", + "prost-derive 0.13.4", ] [[package]] @@ -3989,7 +4140,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.86", + "syn 2.0.90", "tempfile", ] @@ -4003,20 +4154,20 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "prost-derive" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -4026,7 +4177,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f5eec97d5d34bdd17ad2db2219aabf46b054c6c41bd5529767c9ce55be5898f" dependencies = [ "logos", - "miette 7.2.0", + "miette 7.4.0", "once_cell", "prost 0.12.6", "prost-types 0.12.6", @@ -4034,15 +4185,15 @@ dependencies = [ [[package]] name = "prost-reflect" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7535b02f0e5efe3e1dbfcb428be152226ed0c66cad9541f2274c8ba8d4cd40" +checksum = "20ae544fca2892fd4b7e9ff26cba1090cedf1d4d95c2aded1af15d2f93f270b8" dependencies = [ "base64 0.22.1", "logos", - "miette 7.2.0", + "miette 7.4.0", "once_cell", - "prost 0.13.3", + "prost 0.13.4", "prost-types 0.13.3", "serde", "serde-value", @@ -4063,7 +4214,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" dependencies = [ - "prost 0.13.3", + "prost 0.13.4", ] [[package]] @@ -4074,53 +4225,53 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "protobuf" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bcc343da15609eaecd65f8aa76df8dc4209d325131d8219358c0aaaebab0bf6" +checksum = "a3a7c64d9bf75b1b8d981124c14c179074e8caa7dfe7b6a12e6222ddcd0c8f72" dependencies = [ "once_cell", "protobuf-support", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "protobuf-codegen" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d0cde5642ea4df842b13eb9f59ea6fafa26dcb43e3e1ee49120e9757556189" +checksum = "e26b833f144769a30e04b1db0146b2aaa53fd2fd83acf10a6b5f996606c18144" dependencies = [ "anyhow", "once_cell", - "protobuf 3.5.1", + "protobuf 3.7.1", "protobuf-parse", "regex", "tempfile", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "protobuf-parse" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0e9b447d099ae2c4993c0cbb03c7a9d6c937b17f2d56cfc0b1550e6fcfdb76" +checksum = "322330e133eab455718444b4e033ebfac7c6528972c784fcde28d2cc783c6257" dependencies = [ "anyhow", - "indexmap 2.6.0", + "indexmap 2.7.0", "log", - "protobuf 3.5.1", + "protobuf 3.7.1", "protobuf-support", "tempfile", - "thiserror", + "thiserror 1.0.69", "which 4.4.2", ] [[package]] name = "protobuf-support" -version = "3.5.1" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0766e3675a627c327e4b3964582594b0e8741305d628a98a5de75a1d15f99b9" +checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252" dependencies = [ - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4187,12 +4338,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac532509cee918d40f38c3e12f8ef9230f215f017d54de7dd975015538a42ce7" dependencies = [ "bytes", - "miette 7.2.0", + "miette 7.4.0", "prost 0.12.6", "prost-reflect 0.13.1", "prost-types 0.12.6", "protox-parse 0.6.1", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4202,12 +4353,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "873f359bdecdfe6e353752f97cb9ee69368df55b16363ed2216da85e03232a58" dependencies = [ "bytes", - "miette 7.2.0", - "prost 0.13.3", - "prost-reflect 0.14.2", + "miette 7.4.0", + "prost 0.13.4", + "prost-reflect 0.14.3", "prost-types 0.13.3", "protox-parse 0.7.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4217,9 +4368,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6c33f43516fe397e2f930779d720ca12cd057f7da4cd6326a0ef78d69dee96" dependencies = [ "logos", - "miette 7.2.0", + "miette 7.4.0", "prost-types 0.12.6", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4229,9 +4380,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3a462d115462c080ae000c29a47f0b3985737e5d3a995fcdbcaa5c782068dde" dependencies = [ "logos", - "miette 7.2.0", + "miette 7.4.0", "prost-types 0.13.3", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4286,45 +4437,49 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.18", + "rustls 0.23.19", "socket2", - "thiserror", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", "rustc-hash 2.0.0", - "rustls 0.23.18", + "rustls 0.23.19", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", @@ -4373,9 +4528,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.1.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ "bitflags 2.6.0", ] @@ -4402,9 +4557,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -4417,14 +4572,14 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "reflink-copy" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31414597d1cd7fdd2422798b7652a6329dda0fe0219e6335a13d5bcaa9aeb6" +checksum = "17400ed684c3a0615932f00c271ae3eea13e47056a1455821995122348ab6438" dependencies = [ "cfg-if", "rustix", @@ -4439,7 +4594,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -4454,9 +4609,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -4537,9 +4692,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", @@ -4548,7 +4703,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-rustls 0.27.3", "hyper-util", "ipnet", @@ -4559,13 +4714,13 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.18", - "rustls-pemfile 2.1.3", + "rustls 0.23.19", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "tokio", "tokio-rustls 0.26.0", "tokio-util", @@ -4575,7 +4730,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.6", + "webpki-roots 0.26.7", "windows-registry", ] @@ -4591,8 +4746,8 @@ dependencies = [ "mime", "nom", "pin-project-lite", - "reqwest 0.12.7", - "thiserror", + "reqwest 0.12.9", + "thiserror 1.0.69", ] [[package]] @@ -4607,7 +4762,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "task-local-extensions", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4666,12 +4821,12 @@ dependencies = [ "convert_case", "fnv", "ident_case", - "indexmap 2.6.0", + "indexmap 2.7.0", "proc-macro-crate 1.3.1", "proc-macro2", "quote", "rquickjs-core", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -4713,9 +4868,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -4752,9 +4907,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.18" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "once_cell", "ring", @@ -4771,7 +4926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -4788,11 +4943,10 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] @@ -4801,6 +4955,9 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -4825,9 +4982,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -4846,9 +5003,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -4874,7 +5031,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -4914,9 +5071,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -4936,9 +5093,9 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -4986,13 +5143,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -5003,16 +5160,16 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "memchr", "ryu", @@ -5021,8 +5178,9 @@ dependencies = [ [[package]] name = "serde_json_borrow" -version = "0.7.0" -source = "git+https://github.com/PSeitz/serde_json_borrow?rev=6ad7127e0fb9c31f6fd927e934a21112e9ac0fdb#6ad7127e0fb9c31f6fd927e934a21112e9ac0fdb" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "724685c39b301aa2cf7de617fed340d6529694a72fc0f5cc3b1846423e71c630" dependencies = [ "serde", "serde_json", @@ -5046,7 +5204,7 @@ checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" dependencies = [ "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -5072,12 +5230,12 @@ dependencies = [ ] [[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" +name = "serde_yaml_ng" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +checksum = "7b4db627b98b36d4203a7b458cf3573730f2bb591b28871d916dfa9efabfd41f" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "ryu", "serde", @@ -5202,7 +5360,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -5229,9 +5387,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -5256,10 +5414,16 @@ dependencies = [ "serde", "sha-1 0.10.1", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "xxhash-rust", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -5322,7 +5486,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -5344,9 +5508,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.86" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -5361,13 +5525,24 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "sysinfo" version = "0.29.11" @@ -5385,9 +5560,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ae3f4f7d64646c46c4cae4e3f01d1c5d255c7406fdd7c7f999a94e488791" +checksum = "4c33cd241af0f2e9e3b5c32163b873b29956890b5342e6745b917ce9d490f4af" dependencies = [ "core-foundation-sys", "libc", @@ -5437,7 +5612,7 @@ dependencies = [ "async-trait", "base64 0.22.1", "bincode", - "cacache 13.0.0", + "cacache 13.1.0", "cache_control", "chrono", "clap", @@ -5468,7 +5643,7 @@ dependencies = [ "hyper 0.14.31", "hyper-rustls 0.25.0", "indenter", - "indexmap 2.6.0", + "indexmap 2.7.0", "inquire", "insta", "jsonwebtoken", @@ -5498,8 +5673,8 @@ dependencies = [ "pluralizer", "pretty_assertions", "prometheus", - "prost 0.13.3", - "prost-reflect 0.14.2", + "prost 0.13.4", + "prost-reflect 0.14.3", "protox 0.7.1", "protox-parse 0.7.0", "rand", @@ -5508,7 +5683,7 @@ dependencies = [ "reqwest-middleware", "resource", "rquickjs", - "rustls 0.23.18", + "rustls 0.23.19", "rustls-pemfile 1.0.4", "rustls-pki-types", "schemars", @@ -5518,7 +5693,7 @@ dependencies = [ "serde_path_to_error", "serde_qs", "serde_urlencoded", - "serde_yaml", + "serde_yaml_ng", "stripmargin", "strum", "strum_macros", @@ -5534,7 +5709,7 @@ dependencies = [ "tailcall-version", "tempfile", "test-log", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-test", "tonic 0.11.0", @@ -5570,9 +5745,9 @@ dependencies = [ [[package]] name = "tailcall-chunk" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d244d8876e9677c9699d5254b72366c9249760d73a8b7295d1fb3eb6333f682" +checksum = "2ce6ff6d7f5d6382f5486437dc3ba1e8b0105d34b45666a396263763b7ffe8df" [[package]] name = "tailcall-cloudflare" @@ -5635,7 +5810,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -5644,7 +5819,7 @@ version = "0.1.0" dependencies = [ "lazy_static", "strum_macros", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -5665,7 +5840,7 @@ dependencies = [ "serde", "serde_json", "strum", - "sysinfo 0.32.0", + "sysinfo 0.32.1", "tailcall-version", "tokio", "tracing", @@ -5718,7 +5893,7 @@ dependencies = [ "prost-types 0.12.6", "protoc-bin-vendored", "tailcall-fixtures", - "thiserror", + "thiserror 1.0.69", "tokio", "tonic 0.11.0", "tonic-build 0.11.0", @@ -5742,7 +5917,7 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", ] @@ -5786,9 +5961,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -5808,15 +5983,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "test-log" version = "0.2.16" @@ -5836,46 +6002,57 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "thiserror" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", ] [[package]] name = "thiserror-impl" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] -name = "thread_local" -version = "1.1.8" +name = "thiserror-impl" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ - "cfg-if", - "once_cell", + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] -name = "threadpool" -version = "1.8.1" +name = "thread_local" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "num_cpus", + "cfg-if", + "once_cell", ] [[package]] @@ -5918,6 +6095,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -5945,9 +6132,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -5979,7 +6166,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -6009,7 +6196,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.18", + "rustls 0.23.19", "rustls-pki-types", "tokio", ] @@ -6063,20 +6250,20 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "toml_datetime", - "winnow 0.6.18", + "winnow 0.6.20", ] [[package]] @@ -6099,7 +6286,7 @@ dependencies = [ "pin-project", "prost 0.12.6", "rustls-native-certs", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -6112,9 +6299,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "base64 0.22.1", "bytes", @@ -6139,7 +6326,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -6152,7 +6339,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -6189,13 +6376,13 @@ dependencies = [ [[package]] name = "tonic-types" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d967793411bc1a5392accf4731114295f0fd122865d22cde46a8584b03402b2" +checksum = "0081d8ee0847d01271392a5aebe960a4600f5d4da6c67648a6382a0940f8b367" dependencies = [ - "prost 0.13.3", + "prost 0.13.4", "prost-types 0.13.3", - "tonic 0.12.2", + "tonic 0.12.3", ] [[package]] @@ -6232,9 +6419,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -6244,20 +6431,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -6294,9 +6481,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -6304,9 +6491,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -6363,9 +6550,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uname" @@ -6378,18 +6565,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-id" @@ -6399,18 +6577,9 @@ checksum = "10103c57044730945224467c09f71a4db0071c123a0648cc3e818913bde6b561" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" @@ -6457,9 +6626,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -6473,6 +6642,18 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -6481,9 +6662,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "wasm-bindgen", @@ -6497,9 +6678,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" [[package]] name = "version_check" @@ -6540,9 +6721,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", @@ -6551,36 +6732,37 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6588,32 +6770,32 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "wasm-bindgen-test" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d381749acb0943d357dcbd8f0b100640679883fcdeeef04def49daf8d33a5426" +checksum = "3d919bb60ebcecb9160afee6c71b43a58a4f0517a2de0054cd050d02cec08201" dependencies = [ - "console_error_panic_hook", "js-sys", "minicov", + "once_cell", "scoped-tls", "wasm-bindgen", "wasm-bindgen-futures", @@ -6622,20 +6804,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" +checksum = "222ebde6ea87fbfa6bdd2e9f1fd8a91d60aee5db68792632176c4e16a74fc7d8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -6646,9 +6828,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" dependencies = [ "js-sys", "wasm-bindgen", @@ -6672,9 +6854,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -6829,7 +7011,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -6840,7 +7022,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -6862,7 +7044,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -6873,7 +7055,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] [[package]] @@ -7074,9 +7256,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -7117,7 +7299,7 @@ dependencies = [ "futures", "log", "serde", - "thiserror", + "thiserror 1.0.69", "windows 0.48.0", ] @@ -7162,7 +7344,7 @@ dependencies = [ "serde", "serde-wasm-bindgen 0.5.0", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -7176,7 +7358,7 @@ dependencies = [ "async-trait", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", "wasm-bindgen", "wasm-bindgen-futures", "wasm-bindgen-macro-support", @@ -7204,9 +7386,21 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xxhash-rust" version = "0.8.12" @@ -7219,6 +7413,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -7237,7 +7455,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.90", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", ] [[package]] @@ -7245,3 +7484,25 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] diff --git a/Cargo.toml b/Cargo.toml index f03aef860f..68f25713f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ thiserror = { workspace = true } serde_json = { workspace = true } serde = { workspace = true } serde_qs = "0.13" -serde_yaml = "0.9.34" +serde_yaml_ng = "0.10.0" serde_urlencoded = "0.7.1" url = { workspace = true } indexmap = { workspace = true } @@ -163,8 +163,7 @@ tailcall-typedefs-common = { path = "./tailcall-typedefs-common" } tonic-types = "0.12.1" base64 = "0.22.1" tailcall-hasher = { path = "tailcall-hasher" } -# TODO: drop git ref when new version is released -serde_json_borrow = { version = "0.7.0", default-features = false, git = "https://github.com/PSeitz/serde_json_borrow", rev = "6ad7127e0fb9c31f6fd927e934a21112e9ac0fdb" } +serde_json_borrow = { version = "0.7.1", default-features = false } pluralizer = "0.4.0" path-clean = "=1.0.1" pathdiff = "0.2.1" @@ -248,7 +247,6 @@ default = ["cli", "js"] # Feature flag to force JIT engine inside integration tests force_jit = [] - [workspace] members = [ ".", diff --git a/examples/generate.yml b/examples/generate.yml index 13b1a909ea..ff353659e6 100644 --- a/examples/generate.yml +++ b/examples/generate.yml @@ -37,11 +37,9 @@ inputs: fieldName: postComments preset: mergeType: 1 - consolidateURL: 0.5 treeShake: true inferTypeNames: true output: - path: "./jsonplaceholder.graphql" - format: graphQL + path: "./jsonplaceholder-generated.graphql" schema: query: Query diff --git a/examples/jsonplaceholder-generated.graphql b/examples/jsonplaceholder-generated.graphql new file mode 100644 index 0000000000..9236d733c4 --- /dev/null +++ b/examples/jsonplaceholder-generated.graphql @@ -0,0 +1,78 @@ +schema @server @upstream(allowedHeaders: ["Accept", "Content-Type"]) { + query: Query +} + +type Address { + city: String + geo: Geo + street: String + suite: String + zipcode: String +} + +type Comment { + body: String + email: String + id: Int + name: String + postId: Int +} + +type Company { + bs: String + catchPhrase: String + name: String +} + +type Geo { + lat: String + lng: String +} + +type Photo { + albumId: Int + id: Int + thumbnailUrl: String + title: String + url: String +} + +type Post { + body: String + id: Int + title: String + userId: Int +} + +type Query { + comment(GEN__1: Int!): Comment @http(url: "https://jsonplaceholder.typicode.com/comments/{{.args.GEN__1}}") + comments: [Comment] @http(url: "https://jsonplaceholder.typicode.com/comments") + photo(GEN__1: Int!): Photo @http(url: "https://jsonplaceholder.typicode.com/photos/{{.args.GEN__1}}") + photos: [Photo] @http(url: "https://jsonplaceholder.typicode.com/photos") + post(GEN__1: Int!): Post @http(url: "https://jsonplaceholder.typicode.com/posts/{{.args.GEN__1}}") + postComments(postId: Int): [Comment] + @http(url: "https://jsonplaceholder.typicode.com/comments", query: [{key: "postId", value: "{{.args.postId}}"}]) + posts: [Post] @http(url: "https://jsonplaceholder.typicode.com/posts") + todo(GEN__1: Int!): Todo @http(url: "https://jsonplaceholder.typicode.com/todos/{{.args.GEN__1}}") + todos: [Todo] @http(url: "https://jsonplaceholder.typicode.com/todos") + user(GEN__1: Int!): User @http(url: "https://jsonplaceholder.typicode.com/users/{{.args.GEN__1}}") + users: [User] @http(url: "https://jsonplaceholder.typicode.com/users") +} + +type Todo { + completed: Boolean + id: Int + title: String + userId: Int +} + +type User { + address: Address + company: Company + email: String + id: Int + name: String + phone: String + username: String + website: String +} diff --git a/examples/jsonplaceholder.json b/examples/jsonplaceholder.json deleted file mode 100644 index 802964d591..0000000000 --- a/examples/jsonplaceholder.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "$schema": "../generated/.tailcallrc.schema.json", - "server": { - "hostname": "0.0.0.0", - "port": 8000 - }, - "upstream": { - "httpCache": 42 - }, - "schema": { - "query": "Query" - }, - "types": { - "Post": { - "fields": { - "body": { - "type": { - "name": "String", - "required": true - } - }, - "id": { - "type": { - "name": "Int", - "required": true - } - }, - "title": { - "type": { - "name": "String", - "required": true - } - }, - "user": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/{{value.userId}}" - } - }, - "userId": { - "type": { - "name": "Int", - "required": true - } - } - } - }, - "Query": { - "fields": { - "posts": { - "type": { - "list": { - "name": "Post" - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/posts" - } - }, - "user": { - "type": { - "name": "User" - }, - "args": { - "id": { - "type": { - "name": "Int", - "required": true - } - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/{{args.id}}" - } - } - } - }, - "User": { - "fields": { - "email": { - "type": { - "name": "String", - "required": true - } - }, - "id": { - "type": { - "name": "Int", - "required": true - } - }, - "name": { - "type": { - "name": "String", - "required": true - } - }, - "phone": { - "type": { - "name": "String" - } - }, - "username": { - "type": { - "name": "String", - "required": true - } - }, - "website": { - "type": { - "name": "String" - } - } - } - } - } -} diff --git a/examples/jsonplaceholder.yml b/examples/jsonplaceholder.yml deleted file mode 100644 index 79c94fb96a..0000000000 --- a/examples/jsonplaceholder.yml +++ /dev/null @@ -1,73 +0,0 @@ -server: - hostname: 0.0.0.0 - port: 8000 -upstream: - httpCache: 42 -schema: - query: Query -types: - Post: - fields: - body: - type: - name: String - required: true - id: - type: - name: Int - required: true - title: - type: - name: String - required: true - user: - type: - name: User - http: - url: http://jsonplaceholder.typicode.com/users/{{value.userId}} - userId: - type: - name: Int - required: true - Query: - fields: - posts: - type: - list: - name: Post - http: - url: http://jsonplaceholder.typicode.com/posts - user: - type: - name: User - args: - id: - type: - name: Int - required: true - http: - url: http://jsonplaceholder.typicode.com/users/{{args.id}} - User: - fields: - email: - type: - name: String - required: true - id: - type: - name: Int - required: true - name: - type: - name: String - required: true - phone: - type: - name: String - username: - type: - name: String - required: true - website: - type: - name: String diff --git a/examples/jsonplaceholder_batch.json b/examples/jsonplaceholder_batch.json deleted file mode 100644 index 72059725b7..0000000000 --- a/examples/jsonplaceholder_batch.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "server": { - "port": 8000 - }, - "upstream": { - "httpCache": 42, - "batch": { - "maxSize": 1000, - "delay": 1, - "headers": [] - } - }, - "schema": { - "query": "Query" - }, - "types": { - "Post": { - "fields": { - "body": { - "type": { - "name": "String", - "required": true - } - }, - "id": { - "type": { - "name": "Int", - "required": true - } - }, - "title": { - "type": { - "name": "String", - "required": true - } - }, - "user": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users", - "query": [ - { - "key": "id", - "value": "{{value.userId}}" - } - ], - "batchKey": ["id"] - } - }, - "userId": { - "type": { - "name": "Int", - "required": true - } - } - } - }, - "Query": { - "fields": { - "posts": { - "type": { - "list": { - "name": "Post" - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/posts" - } - } - } - }, - "User": { - "fields": { - "email": { - "type": { - "name": "String", - "required": true - } - }, - "id": { - "type": { - "name": "Int", - "required": true - } - }, - "name": { - "type": { - "name": "String", - "required": true - } - }, - "phone": { - "type": { - "name": "String" - } - }, - "username": { - "type": { - "name": "String", - "required": true - } - }, - "website": { - "type": { - "name": "String" - } - } - } - } - } -} diff --git a/examples/jsonplaceholder_batch.yml b/examples/jsonplaceholder_batch.yml deleted file mode 100644 index 78ac2980f9..0000000000 --- a/examples/jsonplaceholder_batch.yml +++ /dev/null @@ -1,71 +0,0 @@ -server: - port: 8000 -upstream: - httpCache: 42 - batch: - maxSize: 1000 - delay: 1 - headers: [] -schema: - query: Query -types: - Post: - fields: - body: - type: - name: String - required: true - id: - type: - name: Int - required: true - title: - type: - name: String - required: true - user: - type: - name: User - http: - url: http://jsonplaceholder.typicode.com/users - query: - - key: id - value: "{{value.userId}}" - batchKey: - - id - userId: - type: - name: Int - required: true - Query: - fields: - posts: - type: - list: - name: Post - http: - url: http://jsonplaceholder.typicode.com/posts - User: - fields: - email: - type: - name: String - required: true - id: - type: - name: Int - required: true - name: - type: - name: String - required: true - phone: - type: - name: String - username: - type: - name: String - required: true - website: - type: - name: String diff --git a/examples/jsonplaceholder_script.graphql b/examples/jsonplaceholder_script.graphql index a336671cae..1f9fa90553 100644 --- a/examples/jsonplaceholder_script.graphql +++ b/examples/jsonplaceholder_script.graphql @@ -6,8 +6,9 @@ schema } type Query { - posts: [Post] @http(url: "http://jsonplaceholder.typicode.com/posts") - user(id: Int!): User @http(url: "http://jsonplaceholder.typicode.com/users/{{.args.id}}") + posts: [Post] @http(url: "http://jsonplaceholder.typicode.com/posts", onResponseBody: "onResponse") + user(id: Int!): User + @http(url: "http://jsonplaceholder.typicode.com/users/{{.args.id}}", onResponseBody: "onResponse") } type User { diff --git a/examples/scripts/echo.js b/examples/scripts/echo.js index 77cdcfdb38..946350f4f9 100644 --- a/examples/scripts/echo.js +++ b/examples/scripts/echo.js @@ -6,3 +6,9 @@ function hello(val) { let json = JSON.parse(val) return JSON.stringify(json.id) } + +function onResponse(response) { + const parsedValue = JSON.parse(response) + parsedValue.name += " - modified by JS" + return JSON.stringify(parsedValue) +} diff --git a/generated/.tailcallrc.graphql b/generated/.tailcallrc.graphql index bc36d8b941..587bcd53c7 100644 --- a/generated/.tailcallrc.graphql +++ b/generated/.tailcallrc.graphql @@ -71,7 +71,7 @@ directive @graphQL( argument to batch several requests into a single batch request.Make sure you have also specified batch settings to the `@upstream` and to the `@graphQL` operator. """ - batch: Boolean! + batch: Boolean """ Enables deduplication of IO operations to enhance performance.This flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: @@ -136,6 +136,12 @@ directive @grpc( """ method: String! """ + Specifies a JavaScript function to be executed after receiving the response body. + This function can modify or transform the response body before it's sent back to + the client. + """ + onResponseBody: String + """ You can use `select` with mustache syntax to re-construct the directives response to the desired format. This is useful when data are deeply nested or want to keep specific fields only from the response.* EXAMPLE 1: if we have a call that returns @@ -167,10 +173,10 @@ directive @http( batchKey: [String!] """ The body of the API call. It's used for methods like POST or PUT that send data to - the server. You can pass it as a static object or use a Mustache template to substitute - variables from the GraphQL variables. + the server. You can pass it as a static object or use a Mustache template with object + to substitute variables from the GraphQL variables. """ - body: String + body: JSON """ Enables deduplication of IO operations to enhance performance.This flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: @@ -204,6 +210,12 @@ directive @http( """ onRequest: String """ + Specifies a JavaScript function to be executed after receiving the response body. + This function can modify or transform the response body before it's sent back to + the client. + """ + onResponseBody: String + """ Schema of the output of the API call. It is automatically inferred in most cases. """ output: Schema @@ -257,7 +269,7 @@ directive @link( The source of the link. It can be a URL or a path to a file. If a path is provided, it is relative to the file that imports the link. """ - src: String! + src: String """ The type of the link. It can be `Config`, or `Protobuf`. """ @@ -716,8 +728,8 @@ input Headers { } input Routes { - graphQL: String! - status: String! + graphQL: String + status: String } input ScriptOptions { @@ -760,7 +772,7 @@ Output the telemetry metrics data to prometheus server """ input PrometheusExporter { format: PrometheusFormat - path: String! + path: String } """ @@ -770,7 +782,7 @@ input StdoutExporter { """ Output to stdout in pretty human-readable format """ - pretty: Boolean! + pretty: Boolean } input TelemetryExporter { @@ -781,7 +793,7 @@ input TelemetryExporter { } input Batch { - delay: Int! + delay: Int headers: [String!] maxSize: Int } @@ -804,7 +816,7 @@ input GraphQL { argument to batch several requests into a single batch request.Make sure you have also specified batch settings to the `@upstream` and to the `@graphQL` operator. """ - batch: Boolean! + batch: Boolean """ Enables deduplication of IO operations to enhance performance.This flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: @@ -869,6 +881,12 @@ input Grpc { """ method: String! """ + Specifies a JavaScript function to be executed after receiving the response body. + This function can modify or transform the response body before it's sent back to + the client. + """ + onResponseBody: String + """ You can use `select` with mustache syntax to re-construct the directives response to the desired format. This is useful when data are deeply nested or want to keep specific fields only from the response.* EXAMPLE 1: if we have a call that returns @@ -900,10 +918,10 @@ input Http { batchKey: [String!] """ The body of the API call. It's used for methods like POST or PUT that send data to - the server. You can pass it as a static object or use a Mustache template to substitute - variables from the GraphQL variables. + the server. You can pass it as a static object or use a Mustache template with object + to substitute variables from the GraphQL variables. """ - body: String + body: JSON """ Enables deduplication of IO operations to enhance performance.This flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: @@ -937,6 +955,12 @@ input Http { """ onRequest: String """ + Specifies a JavaScript function to be executed after receiving the response body. + This function can modify or transform the response body before it's sent back to + the client. + """ + onResponseBody: String + """ Schema of the output of the API call. It is automatically inferred in most cases. """ output: Schema @@ -1027,57 +1051,39 @@ enum Method { enum LinkType { """ - Points to another Tailcall Configuration file. The imported - configuration will be merged into the importing configuration. + Points to another Tailcall Configuration file. The imported configuration will be merged into the importing configuration. """ Config - """ - Points to a Protobuf file. The imported Protobuf file will be used by - the `@grpc` directive. If your API exposes a reflection endpoint, you - should set the type to `Grpc` instead. + Points to a Protobuf file. The imported Protobuf file will be used by the `@grpc` directive. If your API exposes a reflection endpoint, you should set the type to `Grpc` instead. """ Protobuf - """ - Points to a JS file. The imported JS file will be used by the `@js` - directive. + Points to a JS file. The imported JS file will be used by the `@js` directive. """ Script - """ - Points to a Cert file. The imported Cert file will be used by the server - to serve over HTTPS. + Points to a Cert file. The imported Cert file will be used by the server to serve over HTTPS. """ Cert - """ - Points to a Key file. The imported Key file will be used by the server - to serve over HTTPS. + Points to a Key file. The imported Key file will be used by the server to serve over HTTPS. """ Key - """ - A trusted document that contains GraphQL operations (queries, mutations) - that can be exposed as a REST API using the `@rest` directive. + A trusted document that contains GraphQL operations (queries, mutations) that can be exposed a REST API using the `@rest` directive. """ Operation - """ - Points to a Htpasswd file. The imported Htpasswd file will be used by - the server to authenticate users. + Points to a Htpasswd file. The imported Htpasswd file will be used by the server to authenticate users. """ Htpasswd - """ - Points to a Jwks file. The imported Jwks file will be used by the server - to authenticate users. + Points to a Jwks file. The imported Jwks file will be used by the server to authenticate users. """ Jwks - """ - Points to a reflection endpoint. The imported reflection endpoint will - be used by the `@grpc` directive to resolve data from gRPC services. + Points to a reflection endpoint. The imported reflection endpoint will be used by the `@grpc` directive to resolve data from gRPC services. """ Grpc } diff --git a/generated/.tailcallrc.schema.json b/generated/.tailcallrc.schema.json index f02274dcb4..e76f874e55 100644 --- a/generated/.tailcallrc.schema.json +++ b/generated/.tailcallrc.schema.json @@ -2,32 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", "type": "object", - "required": [ - "schema" - ], "properties": { - "enums": { - "description": "A map of all the enum types in the schema", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Enum" - } - }, - "links": { - "description": "A list of all links in the schema.", - "type": "array", - "items": { - "$ref": "#/definitions/Link" - } - }, - "schema": { - "description": "Specifies the entry points for query and mutation in the generated GraphQL schema.", - "allOf": [ - { - "$ref": "#/definitions/RootSchema" - } - ] - }, "server": { "description": "Dictates how the server behaves and helps tune tailcall for all ingress requests. Features such as request batching, SSL, HTTP2 etc. can be configured here.", "default": {}, @@ -45,21 +20,6 @@ } ] }, - "types": { - "description": "A map of all the types in the schema.", - "default": {}, - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Type" - } - }, - "unions": { - "description": "A map of all the union types in the schema.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Union" - } - }, "upstream": { "description": "Dictates how tailcall should handle upstream requests/responses. Tuning upstream can improve performance and reliability for connections.", "default": {}, @@ -71,44 +31,6 @@ } }, "definitions": { - "AddField": { - "description": "The @addField operator simplifies data structures and queries by adding a field that inlines or flattens a nested field or node within your schema. more info [here](https://tailcall.run/docs/guides/operators/#addfield)", - "type": "object", - "required": [ - "name", - "path" - ], - "properties": { - "name": { - "description": "Name of the new field to be added", - "type": "string" - }, - "path": { - "description": "Path of the data where the field should point to", - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "Alias": { - "description": "The @alias directive indicates that aliases of one enum value.", - "type": "object", - "required": [ - "options" - ], - "properties": { - "options": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - } - }, "Apollo": { "type": "object", "required": [ @@ -147,34 +69,6 @@ } } }, - "Arg": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "default_value": true, - "doc": { - "type": [ - "string", - "null" - ] - }, - "modify": { - "anyOf": [ - { - "$ref": "#/definitions/Modify" - }, - { - "type": "null" - } - ] - }, - "type": { - "$ref": "#/definitions/Type2" - } - } - }, "Batch": { "type": "object", "properties": { @@ -206,45 +100,6 @@ "title": "Bytes", "description": "Field whose value is a sequence of bytes." }, - "Cache": { - "description": "The @cache operator enables caching for the query, field or type it is applied to.", - "type": "object", - "required": [ - "maxAge" - ], - "properties": { - "maxAge": { - "description": "Specifies the duration, in milliseconds, of how long the value has to be stored in the cache.", - "type": "integer", - "format": "uint64", - "minimum": 1.0 - } - }, - "additionalProperties": false - }, - "Call": { - "description": "Provides the ability to refer to multiple fields in the Query or Mutation root.", - "type": "object", - "required": [ - "steps" - ], - "properties": { - "dedupe": { - "description": "Enables deduplication of IO operations to enhance performance.\n\nThis flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: May lead to issues with APIs that expect unique results for identical inputs, such as nonce-based APIs.", - "type": [ - "boolean", - "null" - ] - }, - "steps": { - "description": "Steps are composed together to form a call. If you have multiple steps, the output of the previous step is passed as input to the next step.", - "type": "array", - "items": { - "$ref": "#/definitions/Step" - } - } - } - }, "Cors": { "description": "Type to configure Cross-Origin Resource Sharing (CORS) for a server.", "type": "object", @@ -322,34 +177,6 @@ "title": "DateTime", "description": "Field whose value conforms to the standard datetime format as specified in RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339\")." }, - "Directive": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "arguments": { - "type": "object", - "additionalProperties": true - }, - "name": { - "type": "string" - } - } - }, - "Discriminate": { - "description": "The `@discriminate` directive is used to drive Tailcall discriminator to use a field of an object to resolve the type. For example with the directive applied on a field `@discriminate(field: \"object_type\")` and the given value `{\"foo\": \"bar\", \"object_type\": \"Buzz\"}` the resolved type of the object will be `Buzz`. If `field` is not applied it defaults to \"type\". The `field` does not have to be part of the GraphQL Schema, but it is required to be part of the JSON response. In case this field is missing from the response an appropriate error message will be displayed.", - "type": "object", - "properties": { - "field": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - }, "Email": { "title": "Email", "description": "Field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address." @@ -358,239 +185,6 @@ "title": "Empty", "description": "Empty scalar type represents an empty value." }, - "Encoding": { - "type": "string", - "enum": [ - "ApplicationJson", - "ApplicationXWwwFormUrlencoded" - ] - }, - "Enum": { - "description": "Definition of GraphQL enum type", - "type": "object", - "required": [ - "variants" - ], - "properties": { - "doc": { - "type": [ - "string", - "null" - ] - }, - "variants": { - "type": "array", - "items": { - "$ref": "#/definitions/Variant" - }, - "uniqueItems": true - } - } - }, - "Expr": { - "description": "The `@expr` operators allows you to specify an expression that can evaluate to a value. The expression can be a static value or built form a Mustache template. schema.", - "type": "object", - "required": [ - "body" - ], - "properties": { - "body": true - }, - "additionalProperties": false - }, - "Field": { - "description": "A field definition containing all the metadata information about resolving a field.", - "type": [ - "object", - "array" - ], - "items": { - "$ref": "#/definitions/Resolver" - }, - "properties": { - "args": { - "description": "Map of argument name and its definition.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Arg" - } - }, - "cache": { - "description": "Sets the cache configuration for a field", - "anyOf": [ - { - "$ref": "#/definitions/Cache" - }, - { - "type": "null" - } - ] - }, - "default_value": { - "description": "Stores the default value for the field" - }, - "directives": { - "description": "Any additional directives", - "type": "array", - "items": { - "$ref": "#/definitions/Directive" - } - }, - "discriminate": { - "description": "Used to overwrite the default discrimination strategy", - "anyOf": [ - { - "$ref": "#/definitions/Discriminate" - }, - { - "type": "null" - } - ] - }, - "doc": { - "description": "Publicly visible documentation for the field.", - "type": [ - "string", - "null" - ] - }, - "modify": { - "description": "Allows modifying existing fields.", - "anyOf": [ - { - "$ref": "#/definitions/Modify" - }, - { - "type": "null" - } - ] - }, - "omit": { - "description": "Omits a field from public consumption.", - "anyOf": [ - { - "$ref": "#/definitions/Omit" - }, - { - "type": "null" - } - ] - }, - "protected": { - "description": "Marks field as protected by auth provider", - "default": null, - "anyOf": [ - { - "$ref": "#/definitions/Protected" - }, - { - "type": "null" - } - ] - }, - "type": { - "description": "Refers to the type of the value the field can be resolved to.", - "allOf": [ - { - "$ref": "#/definitions/Type2" - } - ] - } - } - }, - "GraphQL": { - "description": "The @graphQL operator allows to specify GraphQL API server request to fetch data from.", - "type": "object", - "required": [ - "name", - "url" - ], - "properties": { - "args": { - "description": "Named arguments for the requested field. More info [here](https://tailcall.run/docs/guides/operators/#args)", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/KeyValue" - } - }, - "batch": { - "description": "If the upstream GraphQL server supports request batching, you can specify the 'batch' argument to batch several requests into a single batch request.\n\nMake sure you have also specified batch settings to the `@upstream` and to the `@graphQL` operator.", - "type": "boolean" - }, - "dedupe": { - "description": "Enables deduplication of IO operations to enhance performance.\n\nThis flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: May lead to issues with APIs that expect unique results for identical inputs, such as nonce-based APIs.", - "type": [ - "boolean", - "null" - ] - }, - "headers": { - "description": "The headers parameter allows you to customize the headers of the GraphQL request made by the `@graphQL` operator. It is used by specifying a key-value map of header names and their values.", - "type": "array", - "items": { - "$ref": "#/definitions/KeyValue" - } - }, - "name": { - "description": "Specifies the root field on the upstream to request data from. This maps a field in your schema to a field in the upstream schema. When a query is received for this field, Tailcall requests data from the corresponding upstream field.", - "type": "string" - }, - "url": { - "description": "This refers URL of the API.", - "type": "string" - } - }, - "additionalProperties": false - }, - "Grpc": { - "description": "The @grpc operator indicates that a field or node is backed by a gRPC API.\n\nFor instance, if you add the @grpc operator to the `users` field of the Query type with a service argument of `NewsService` and method argument of `GetAllNews`, it signifies that the `users` field is backed by a gRPC API. The `service` argument specifies the name of the gRPC service. The `method` argument specifies the name of the gRPC method. In this scenario, the GraphQL server will make a gRPC request to the gRPC endpoint specified when the `users` field is queried.", - "type": "object", - "required": [ - "method", - "url" - ], - "properties": { - "batchKey": { - "description": "The `batchKey` dictates the path Tailcall will follow to group the returned items from the batch request. For more details please refer out [n + 1 guide](https://tailcall.run/docs/guides/n+1#solving-using-batching).", - "type": "array", - "items": { - "type": "string" - } - }, - "body": { - "description": "This refers to the arguments of your gRPC call. You can pass it as a static object or use Mustache template for dynamic parameters. These parameters will be added in the body in `protobuf` format." - }, - "dedupe": { - "description": "Enables deduplication of IO operations to enhance performance.\n\nThis flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: May lead to issues with APIs that expect unique results for identical inputs, such as nonce-based APIs.", - "type": [ - "boolean", - "null" - ] - }, - "headers": { - "description": "The `headers` parameter allows you to customize the headers of the HTTP request made by the `@grpc` operator. It is used by specifying a key-value map of header names and their values. Note: content-type is automatically set to application/grpc", - "type": "array", - "items": { - "$ref": "#/definitions/KeyValue" - } - }, - "method": { - "description": "This refers to the gRPC method you're going to call. For instance `GetAllNews`.", - "type": "string" - }, - "select": { - "description": "You can use `select` with mustache syntax to re-construct the directives response to the desired format. This is useful when data are deeply nested or want to keep specific fields only from the response.\n\n* EXAMPLE 1: if we have a call that returns `{ \"user\": { \"items\": [...], ... } ... }` we can use `\"{{.user.items}}\"`, to extract the `items`. * EXAMPLE 2: if we have a call that returns `{ \"foo\": \"bar\", \"fizz\": { \"buzz\": \"eggs\", ... }, ... }` we can use { foo: \"{{.foo}}\", buzz: \"{{.fizz.buzz}}\" }`" - }, - "url": { - "description": "This refers to URL of the API.", - "type": "string" - } - }, - "additionalProperties": false - }, "Headers": { "type": "object", "properties": { @@ -639,103 +233,6 @@ } } }, - "Http": { - "description": "The @http operator indicates that a field or node is backed by a REST API.\n\nFor instance, if you add the @http operator to the `users` field of the Query type with a path argument of `\"/users\"`, it signifies that the `users` field is backed by a REST API. The path argument specifies the path of the REST API. In this scenario, the GraphQL server will make a GET request to the API endpoint specified when the `users` field is queried.", - "type": "object", - "required": [ - "url" - ], - "properties": { - "batchKey": { - "description": "The `batchKey` dictates the path Tailcall will follow to group the returned items from the batch request. For more details please refer out [n + 1 guide](https://tailcall.run/docs/guides/n+1#solving-using-batching).", - "type": "array", - "items": { - "type": "string" - } - }, - "body": { - "description": "The body of the API call. It's used for methods like POST or PUT that send data to the server. You can pass it as a static object or use a Mustache template to substitute variables from the GraphQL variables.", - "type": [ - "string", - "null" - ] - }, - "dedupe": { - "description": "Enables deduplication of IO operations to enhance performance.\n\nThis flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: May lead to issues with APIs that expect unique results for identical inputs, such as nonce-based APIs.", - "type": [ - "boolean", - "null" - ] - }, - "encoding": { - "description": "The `encoding` parameter specifies the encoding of the request body. It can be `ApplicationJson` or `ApplicationXWwwFormUrlEncoded`. @default `ApplicationJson`.", - "allOf": [ - { - "$ref": "#/definitions/Encoding" - } - ] - }, - "headers": { - "description": "The `headers` parameter allows you to customize the headers of the HTTP request made by the `@http` operator. It is used by specifying a key-value map of header names and their values.", - "type": "array", - "items": { - "$ref": "#/definitions/KeyValue" - } - }, - "input": { - "description": "Schema of the input of the API call. It is automatically inferred in most cases.", - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "null" - } - ] - }, - "method": { - "description": "This refers to the HTTP method of the API call. Commonly used methods include `GET`, `POST`, `PUT`, `DELETE` etc. @default `GET`.", - "allOf": [ - { - "$ref": "#/definitions/Method" - } - ] - }, - "onRequest": { - "description": "onRequest field in @http directive gives the ability to specify the request interception handler.", - "type": [ - "string", - "null" - ] - }, - "output": { - "description": "Schema of the output of the API call. It is automatically inferred in most cases.", - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "null" - } - ] - }, - "query": { - "description": "This represents the query parameters of your API call. You can pass it as a static object or use Mustache template for dynamic parameters. These parameters will be added to the URL. NOTE: Query parameter order is critical for batching in Tailcall. The first parameter referencing a field in the current value using mustache syntax is automatically selected as the batching parameter.", - "type": "array", - "items": { - "$ref": "#/definitions/URLQuery" - } - }, - "select": { - "description": "You can use `select` with mustache syntax to re-construct the directives response to the desired format. This is useful when data are deeply nested or want to keep specific fields only from the response.\n\n* EXAMPLE 1: if we have a call that returns `{ \"user\": { \"items\": [...], ... } ... }` we can use `\"{{.user.items}}\"`, to extract the `items`. * EXAMPLE 2: if we have a call that returns `{ \"foo\": \"bar\", \"fizz\": { \"buzz\": \"eggs\", ... }, ... }` we can use { foo: \"{{.foo}}\", buzz: \"{{.fizz.buzz}}\" }`" - }, - "url": { - "description": "This refers to URL of the API.", - "type": "string" - } - }, - "additionalProperties": false - }, "HttpVersion": { "type": "string", "enum": [ @@ -763,17 +260,6 @@ "title": "Int8", "description": "Field whose value is an 8-bit signed integer." }, - "JS": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - }, "JSON": { "title": "JSON", "description": "Field whose value conforms to the standard JSON format as specified in RFC 8259 (https://datatracker.ietf.org/doc/html/rfc8259)." @@ -793,112 +279,6 @@ } } }, - "Link": { - "description": "The @link directive allows you to import external resources, such as configuration – which will be merged into the config importing it –, or a .proto file – which will be later used by `@grpc` directive –.", - "type": "object", - "properties": { - "headers": { - "description": "Custom headers for gRPC reflection server.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/KeyValue" - } - }, - "id": { - "description": "The id of the link. It is used to reference the link in the schema.", - "type": [ - "string", - "null" - ] - }, - "meta": { - "description": "Additional metadata pertaining to the linked resource." - }, - "src": { - "description": "The source of the link. It can be a URL or a path to a file. If a path is provided, it is relative to the file that imports the link.", - "type": "string" - }, - "type": { - "description": "The type of the link. It can be `Config`, or `Protobuf`.", - "allOf": [ - { - "$ref": "#/definitions/LinkType" - } - ] - } - }, - "additionalProperties": false - }, - "LinkType": { - "oneOf": [ - { - "description": "Points to another Tailcall Configuration file. The imported configuration will be merged into the importing configuration.", - "type": "string", - "enum": [ - "Config" - ] - }, - { - "description": "Points to a Protobuf file. The imported Protobuf file will be used by the `@grpc` directive. If your API exposes a reflection endpoint, you should set the type to `Grpc` instead.", - "type": "string", - "enum": [ - "Protobuf" - ] - }, - { - "description": "Points to a JS file. The imported JS file will be used by the `@js` directive.", - "type": "string", - "enum": [ - "Script" - ] - }, - { - "description": "Points to a Cert file. The imported Cert file will be used by the server to serve over HTTPS.", - "type": "string", - "enum": [ - "Cert" - ] - }, - { - "description": "Points to a Key file. The imported Key file will be used by the server to serve over HTTPS.", - "type": "string", - "enum": [ - "Key" - ] - }, - { - "description": "A trusted document that contains GraphQL operations (queries, mutations) that can be exposed a REST API using the `@rest` directive.", - "type": "string", - "enum": [ - "Operation" - ] - }, - { - "description": "Points to a Htpasswd file. The imported Htpasswd file will be used by the server to authenticate users.", - "type": "string", - "enum": [ - "Htpasswd" - ] - }, - { - "description": "Points to a Jwks file. The imported Jwks file will be used by the server to authenticate users.", - "type": "string", - "enum": [ - "Jwks" - ] - }, - { - "description": "Points to a reflection endpoint. The imported reflection endpoint will be used by the `@grpc` directive to resolve data from gRPC services.", - "type": "string", - "enum": [ - "Grpc" - ] - } - ] - }, "Method": { "type": "string", "enum": [ @@ -913,29 +293,6 @@ "TRACE" ] }, - "Modify": { - "type": "object", - "properties": { - "name": { - "type": [ - "string", - "null" - ] - }, - "omit": { - "type": [ - "boolean", - "null" - ] - } - }, - "additionalProperties": false - }, - "Omit": { - "description": "Used to omit a field from public consumption.", - "type": "object", - "additionalProperties": false - }, "OtlpExporter": { "description": "Output the opentelemetry data to otlp collector", "type": "object", @@ -973,27 +330,11 @@ }, "PrometheusFormat": { "description": "Output format for prometheus data", - "type": "string", - "enum": [ - "text", - "protobuf" - ] - }, - "Protected": { - "description": "Specifies the authentication requirements for accessing a field or type.\n\nThis allows you to control access by listing the IDs of authentication providers. - If `id` is not provided, all available providers must authorize the request. - If multiple provider IDs are listed, the request must be authorized by all of them.\n\nExample: If you want only specific providers to allow access, include their IDs in the list. Otherwise, leave it empty to require authorization from all available providers.", - "type": "object", - "properties": { - "id": { - "description": "List of authentication provider IDs that can access this field or type. - Leave empty to require authorization from all providers. - Include multiple IDs to require authorization from each one.", - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - } - } + "type": "string", + "enum": [ + "text", + "protobuf" + ] }, "Proxy": { "type": "object", @@ -1006,105 +347,6 @@ } } }, - "Resolver": { - "oneOf": [ - { - "type": "object", - "required": [ - "http" - ], - "properties": { - "http": { - "$ref": "#/definitions/Http" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "grpc" - ], - "properties": { - "grpc": { - "$ref": "#/definitions/Grpc" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "graphql" - ], - "properties": { - "graphql": { - "$ref": "#/definitions/GraphQL" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "call" - ], - "properties": { - "call": { - "$ref": "#/definitions/Call" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "js" - ], - "properties": { - "js": { - "$ref": "#/definitions/JS" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "expr" - ], - "properties": { - "expr": { - "$ref": "#/definitions/Expr" - } - }, - "additionalProperties": false - } - ] - }, - "RootSchema": { - "type": "object", - "properties": { - "mutation": { - "type": [ - "string", - "null" - ] - }, - "query": { - "type": [ - "string", - "null" - ] - }, - "subscription": { - "type": [ - "string", - "null" - ] - } - } - }, "Routes": { "type": "object", "properties": { @@ -1294,31 +536,6 @@ } } }, - "Step": { - "description": "Provides the ability to refer to a field defined in the root Query or Mutation.", - "type": "object", - "properties": { - "args": { - "description": "The arguments that will override the actual arguments of the field.", - "type": "object", - "additionalProperties": true - }, - "mutation": { - "description": "The name of the field on the `Mutation` type that you want to call.", - "type": [ - "string", - "null" - ] - }, - "query": { - "description": "The name of the field on the `Query` type that you want to call.", - "type": [ - "string", - "null" - ] - } - } - }, "Telemetry": { "description": "The @telemetry directive facilitates seamless integration with OpenTelemetry, enhancing the observability of your GraphQL services powered by Tailcall. By leveraging this directive, developers gain access to valuable insights into the performance and behavior of their applications.", "type": "object", @@ -1395,121 +612,6 @@ } ] }, - "Type": { - "description": "Represents a GraphQL type. A type can be an object, interface, enum or scalar.", - "type": [ - "object", - "array" - ], - "items": { - "$ref": "#/definitions/Resolver" - }, - "required": [ - "fields" - ], - "properties": { - "added_fields": { - "description": "Additional fields to be added to the type", - "type": "array", - "items": { - "$ref": "#/definitions/AddField" - } - }, - "cache": { - "description": "Setting to indicate if the type can be cached.", - "anyOf": [ - { - "$ref": "#/definitions/Cache" - }, - { - "type": "null" - } - ] - }, - "directives": { - "description": "Any additional directives", - "type": "array", - "items": { - "$ref": "#/definitions/Directive" - } - }, - "doc": { - "description": "Documentation for the type that is publicly visible.", - "type": [ - "string", - "null" - ] - }, - "fields": { - "description": "A map of field name and its definition.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Field" - } - }, - "implements": { - "description": "Interfaces that the type implements.", - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - }, - "protected": { - "description": "Marks field as protected by auth providers", - "default": null, - "anyOf": [ - { - "$ref": "#/definitions/Protected" - }, - { - "type": "null" - } - ] - } - } - }, - "Type2": { - "description": "Type to represent GraphQL type usage with modifiers [spec](https://spec.graphql.org/October2021/#sec-Wrapping-Types)", - "anyOf": [ - { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "Name of the type", - "type": "string" - }, - "required": { - "description": "Flag to indicate the type is required.", - "type": "boolean" - } - } - }, - { - "type": "object", - "required": [ - "list" - ], - "properties": { - "list": { - "description": "Type is a list", - "allOf": [ - { - "$ref": "#/definitions/Type2" - } - ] - }, - "required": { - "description": "Flag to indicate the type is required.", - "type": "boolean" - } - } - } - ] - }, "UInt128": { "title": "UInt128", "description": "Field whose value is a 128-bit unsigned integer." @@ -1530,52 +632,6 @@ "title": "UInt8", "description": "Field whose value is an 8-bit unsigned integer." }, - "URLQuery": { - "description": "The URLQuery input type represents a query parameter to be included in a URL.", - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "description": "The key or name of the query parameter.", - "type": "string" - }, - "skipEmpty": { - "description": "Determines whether to ignore query parameters with empty values.", - "type": [ - "boolean", - "null" - ] - }, - "value": { - "description": "The actual value or a mustache template to resolve the value dynamically for the query parameter.", - "type": "string" - } - } - }, - "Union": { - "type": "object", - "required": [ - "types" - ], - "properties": { - "doc": { - "type": [ - "string", - "null" - ] - }, - "types": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - } - }, "Upstream": { "description": "The `upstream` directive allows you to control various aspects of the upstream server connection. This includes settings like connection timeouts, keep-alive intervals, and more. If not specified, default values are used.", "type": "object", @@ -1726,97 +782,6 @@ "Url": { "title": "Url", "description": "Field whose value conforms to the standard URL format as specified in RFC 3986 (https://datatracker.ietf.org/doc/html/rfc3986)." - }, - "Variant": { - "description": "Definition of GraphQL value", - "type": "object", - "required": [ - "name" - ], - "properties": { - "alias": { - "anyOf": [ - { - "$ref": "#/definitions/Alias" - }, - { - "type": "null" - } - ] - }, - "name": { - "type": "string" - } - } - }, - "schema": { - "oneOf": [ - { - "type": "string", - "enum": [ - "Str", - "Num", - "Bool", - "Empty", - "Any" - ] - }, - { - "type": "object", - "required": [ - "Obj" - ], - "properties": { - "Obj": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schema" - } - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "Arr" - ], - "properties": { - "Arr": { - "$ref": "#/definitions/schema" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "Opt" - ], - "properties": { - "Opt": { - "$ref": "#/definitions/schema" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "Enum" - ], - "properties": { - "Enum": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - }, - "additionalProperties": false - } - ] } } } \ No newline at end of file diff --git a/npm/package-lock.json b/npm/package-lock.json index c65f69f0ce..f8ba2ce98b 100644 --- a/npm/package-lock.json +++ b/npm/package-lock.json @@ -863,9 +863,9 @@ } }, "node_modules/type-fest": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", - "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.30.0.tgz", + "integrity": "sha512-G6zXWS1dLj6eagy6sVhOMQiLtJdxQBHIA9Z6HFUNLOlr6MFOgzV8wvmidtPONfPtEUv0uZsy77XJNzTAfwPDaA==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" @@ -903,9 +903,9 @@ } }, "node_modules/yaml": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", - "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "license": "ISC", "bin": { "yaml": "bin.mjs" diff --git a/src/cli/command.rs b/src/cli/command.rs index cb62f4816e..0f1849a67e 100644 --- a/src/cli/command.rs +++ b/src/cli/command.rs @@ -2,8 +2,6 @@ use clap::{Parser, Subcommand}; use strum_macros::Display; use tailcall_version::VERSION; -use crate::core::config; - const ABOUT: &str = r" __ _ __ ____ / /_____ _(_) /________ _/ / / @@ -49,10 +47,6 @@ pub enum Command { #[arg(short, long)] schema: bool, - /// Prints the input config in the provided format - #[clap(short, long)] - format: Option, - /// Controls SSL/TLS certificate verification for remote config files /// Set to false to skip certificate verification (not recommended for /// production) diff --git a/src/cli/generator/config.rs b/src/cli/generator/config.rs index e2fba5aafd..b753ab9c46 100644 --- a/src/cli/generator/config.rs +++ b/src/cli/generator/config.rs @@ -11,7 +11,6 @@ use tailcall_valid::{Valid, ValidateFrom, Validator}; use url::Url; use crate::core::config::transformer::Preset; -use crate::core::config::{self}; use crate::core::http::Method; #[derive(Deserialize, Serialize, Debug, Default, Setters)] @@ -81,9 +80,15 @@ pub enum Source { is_mutation: Option, field_name: String, }, + #[serde(rename_all = "camelCase")] Proto { src: Location, url: String, + #[serde(skip_serializing_if = "Option::is_none")] + proto_paths: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "connectRPC")] + connect_rpc: Option, }, Config { src: Location, @@ -96,8 +101,6 @@ pub enum Source { pub struct Output { #[serde(skip_serializing_if = "Location::is_empty")] pub path: Location, - #[serde(skip_serializing_if = "Option::is_none")] - pub format: Option, } #[derive(Debug)] @@ -196,10 +199,7 @@ impl Headers { impl Output { pub fn resolve(self, parent_dir: Option<&Path>) -> anyhow::Result> { - Ok(Output { - format: self.format, - path: self.path.into_resolved(parent_dir), - }) + Ok(Output { path: self.path.into_resolved(parent_dir) }) } } @@ -217,9 +217,20 @@ impl Source { is_mutation, }) } - Source::Proto { src, url } => { + Source::Proto { src, url, proto_paths, connect_rpc } => { let resolved_path = src.into_resolved(parent_dir); - Ok(Source::Proto { src: resolved_path, url }) + let resolved_proto_paths = proto_paths.map(|paths| { + paths + .into_iter() + .map(|path| path.into_resolved(parent_dir)) + .collect() + }); + Ok(Source::Proto { + src: resolved_path, + url, + proto_paths: resolved_proto_paths, + connect_rpc, + }) } Source::Config { src } => { let resolved_path = src.into_resolved(parent_dir); @@ -434,10 +445,9 @@ mod tests { let json = r#" {"output": { "paths": "./output.graphql", - }} + }} "#; - let expected_error = - "unknown field `paths`, expected `path` or `format` at line 3 column 21"; + let expected_error = "unknown field `paths`, expected `path` at line 3 column 21"; assert_deserialization_error(json, expected_error); } @@ -446,7 +456,7 @@ mod tests { let json = r#" {"schema": { "querys": "Query", - }} + }} "#; let expected_error = "unknown field `querys`, expected `query` or `mutation` at line 3 column 22"; diff --git a/src/cli/generator/generator.rs b/src/cli/generator/generator.rs index 4cdbb1ea50..3fa3165396 100644 --- a/src/cli/generator/generator.rs +++ b/src/cli/generator/generator.rs @@ -1,6 +1,7 @@ use std::fs; use std::path::Path; +use anyhow::anyhow; use http::header::{HeaderMap, HeaderName, HeaderValue}; use inquire::Confirm; use pathdiff::diff_paths; @@ -34,9 +35,8 @@ impl Generator { async fn write(self, graphql_config: &ConfigModule, output_path: &str) -> anyhow::Result<()> { let output_source = config::Source::detect(output_path)?; let config = match output_source { - config::Source::Json => graphql_config.to_json(true)?, - config::Source::Yml => graphql_config.to_yaml()?, config::Source::GraphQL => graphql_config.to_sdl(), + _ => return Err(anyhow!("Only graphql output format is currently supported")), }; if self.should_overwrite(output_path)? { @@ -78,16 +78,12 @@ impl Generator { // While reading resolve the internal paths and mustache headers of generalized // config. - let reader_context = ConfigReaderContext { - runtime: &self.runtime, - vars: &Default::default(), - headers: Default::default(), - }; + let reader_context = ConfigReaderContext::new(&self.runtime); config_content = Mustache::parse(&config_content).render(&reader_context); let config: Config = match source { ConfigSource::Json => serde_json::from_str(&config_content)?, - ConfigSource::Yml => serde_yaml::from_str(&config_content)?, + ConfigSource::Yml => serde_yaml_ng::from_str(&config_content)?, }; config.into_resolved(config_path) @@ -139,13 +135,15 @@ impl Generator { headers: headers.into_btree_map(), }); } - Source::Proto { src, url } => { + Source::Proto { src, url, proto_paths, connect_rpc } => { let path = src.0; - let mut metadata = proto_reader.read(&path).await?; + let proto_paths = + proto_paths.map(|paths| paths.into_iter().map(|l| l.0).collect::>()); + let mut metadata = proto_reader.read(&path, proto_paths.as_deref()).await?; if let Some(relative_path_to_proto) = to_relative_path(output_dir, &path) { metadata.path = relative_path_to_proto; } - input_samples.push(Input::Proto { metadata, url }); + input_samples.push(Input::Proto { metadata, url, connect_rpc }); } Source::Config { src } => { let path = src.0; diff --git a/src/cli/generator/snapshots/tailcall__cli__generator__config__tests__config_codec.snap b/src/cli/generator/snapshots/tailcall__cli__generator__config__tests__config_codec.snap index 4655a9035b..6f2d414ada 100644 --- a/src/cli/generator/snapshots/tailcall__cli__generator__config__tests__config_codec.snap +++ b/src/cli/generator/snapshots/tailcall__cli__generator__config__tests__config_codec.snap @@ -1,6 +1,7 @@ --- source: src/cli/generator/config.rs expression: actual +snapshot_kind: text --- { "inputs": [ diff --git a/src/cli/javascript/runtime.rs b/src/cli/javascript/runtime.rs index a3c2fc6933..a2e7670e88 100644 --- a/src/cli/javascript/runtime.rs +++ b/src/cli/javascript/runtime.rs @@ -5,7 +5,7 @@ use std::thread; use async_graphql_value::ConstValue; use rquickjs::{Context, Ctx, FromJs, Function, IntoJs, Value}; -use crate::core::worker::{Command, Event, WorkerRequest}; +use crate::core::worker::{Command, Event}; use crate::core::{blueprint, worker, WorkerIO}; struct LocalRuntime(Context); @@ -141,34 +141,41 @@ fn init_rt(script: blueprint::Script) -> anyhow::Result<()> { }) } -fn prepare_args<'js>(ctx: &Ctx<'js>, req: WorkerRequest) -> rquickjs::Result<(Value<'js>,)> { +fn prepare_args<'js, T: IntoJs<'js>>( + ctx: &Ctx<'js>, + label: &str, + req: T, +) -> rquickjs::Result<(Value<'js>,)> { let object = rquickjs::Object::new(ctx.clone())?; - object.set("request", req.into_js(ctx)?)?; + object.set(label, req.into_js(ctx)?)?; Ok((object.into_value(),)) } fn call(name: String, event: Event) -> Result, worker::Error> { LOCAL_RUNTIME.with_borrow_mut(|cell| { let runtime = cell.get_mut().ok_or(worker::Error::RuntimeNotInitialized)?; - runtime.0.with(|ctx| match event { - Event::Request(req) => { - let fn_as_value = ctx - .globals() - .get::<&str, Function>(name.as_str()) - .map_err(|e| worker::Error::GlobalThisNotInitialised(e.to_string()))?; - - let function = fn_as_value - .as_function() - .ok_or(worker::Error::InvalidFunction(name))?; - - let args = - prepare_args(&ctx, req).map_err(|e| worker::Error::Rquickjs(e.to_string()))?; - let command: Option = function.call(args).ok(); - command - .map(|output| Command::from_js(&ctx, output)) - .transpose() - .map_err(|e| worker::Error::DeserializeFailed(e.to_string())) - } + runtime.0.with(|ctx| { + let fn_as_value = ctx + .globals() + .get::<&str, Function>(name.as_str()) + .map_err(|e| worker::Error::GlobalThisNotInitialised(e.to_string()))?; + + let function = fn_as_value + .as_function() + .ok_or(worker::Error::InvalidFunction(name))?; + + let args = match event { + Event::Request(req) => prepare_args(&ctx, "request", req) + .map_err(|e| worker::Error::Rquickjs(e.to_string()))?, + Event::Response(resp) => prepare_args(&ctx, "response", resp) + .map_err(|e| worker::Error::Rquickjs(e.to_string()))?, + }; + + let command: Option = function.call(args).ok(); + command + .map(|output| Command::from_js(&ctx, output)) + .transpose() + .map_err(|e| worker::Error::DeserializeFailed(e.to_string())) }) }) } diff --git a/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__chat_response_parse.snap b/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__chat_response_parse.snap index b8f2c25958..5b1922c9bb 100644 --- a/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__chat_response_parse.snap +++ b/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__chat_response_parse.snap @@ -1,6 +1,7 @@ --- source: src/cli/llm/infer_type_name.rs expression: answer +snapshot_kind: text --- Answer { suggestions: [ diff --git a/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__to_chat_request_conversion.snap b/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__to_chat_request_conversion.snap index d50032444d..545200c8ae 100644 --- a/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__to_chat_request_conversion.snap +++ b/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__to_chat_request_conversion.snap @@ -1,6 +1,7 @@ --- source: src/cli/llm/infer_type_name.rs expression: request +snapshot_kind: text --- ChatRequest { system: None, diff --git a/src/cli/tc/check.rs b/src/cli/tc/check.rs index 6816836092..9aca36c783 100644 --- a/src/cli/tc/check.rs +++ b/src/cli/tc/check.rs @@ -4,7 +4,6 @@ use super::helpers::{display_schema, log_endpoint_set}; use crate::cli::fmt::Fmt; use crate::core::blueprint::Blueprint; use crate::core::config::reader::ConfigReader; -use crate::core::config::Source; use crate::core::runtime::TargetRuntime; use crate::core::Errata; @@ -12,18 +11,14 @@ pub(super) struct CheckParams { pub(super) file_paths: Vec, pub(super) n_plus_one_queries: bool, pub(super) schema: bool, - pub(super) format: Option, pub(super) runtime: TargetRuntime, } pub(super) async fn check_command(params: CheckParams, config_reader: &ConfigReader) -> Result<()> { - let CheckParams { file_paths, n_plus_one_queries, schema, format, runtime } = params; + let CheckParams { file_paths, n_plus_one_queries, schema, runtime } = params; let config_module = (config_reader.read_all(&file_paths)).await?; log_endpoint_set(&config_module.extensions().endpoint_set); - if let Some(format) = format { - Fmt::display(format.encode(&config_module)?); - } let blueprint = Blueprint::try_from(&config_module).map_err(Errata::from); match blueprint { diff --git a/src/cli/tc/init.rs b/src/cli/tc/init.rs index 89f8885bd3..abbacf9e03 100644 --- a/src/cli/tc/init.rs +++ b/src/cli/tc/init.rs @@ -55,10 +55,10 @@ pub(super) async fn init_command(runtime: TargetRuntime, folder_path: &str) -> R Ok(()) } -fn default_graphqlrc() -> serde_yaml::Value { - serde_yaml::Value::Mapping(serde_yaml::mapping::Mapping::from_iter([( +fn default_graphqlrc() -> serde_yaml_ng::Value { + serde_yaml_ng::Value::Mapping(serde_yaml_ng::mapping::Mapping::from_iter([( "schema".into(), - serde_yaml::Value::Sequence(vec!["./.tailcallrc.graphql".into(), "./*.graphql".into()]), + serde_yaml_ng::Value::Sequence(vec!["./.tailcallrc.graphql".into(), "./*.graphql".into()]), )])) } @@ -72,13 +72,13 @@ async fn confirm_and_write_yml( match runtime.file.read(yml_file_path.as_ref()).await { Ok(yml_content) => { - let graphqlrc: serde_yaml::Value = serde_yaml::from_str(&yml_content)?; + let graphqlrc: serde_yaml_ng::Value = serde_yaml_ng::from_str(&yml_content)?; final_graphqlrc = graphqlrc.merge_right(final_graphqlrc); - let content = serde_yaml::to_string(&final_graphqlrc)?; + let content = serde_yaml_ng::to_string(&final_graphqlrc)?; confirm_and_write(runtime.clone(), &yml_file_path, content.as_bytes()).await } Err(_) => { - let content = serde_yaml::to_string(&final_graphqlrc)?; + let content = serde_yaml_ng::to_string(&final_graphqlrc)?; runtime.file.write(&yml_file_path, content.as_bytes()).await } } diff --git a/src/cli/tc/run.rs b/src/cli/tc/run.rs index 61f93f4394..ecb8d2a55f 100644 --- a/src/cli/tc/run.rs +++ b/src/cli/tc/run.rs @@ -46,11 +46,11 @@ async fn run_command(cli: Cli) -> Result<()> { validate_rc_config_files(runtime, &file_paths).await; start::start_command(file_paths, &config_reader).await?; } - Command::Check { file_paths, n_plus_one_queries, schema, format, verify_ssl } => { + Command::Check { file_paths, n_plus_one_queries, schema, verify_ssl } => { let (runtime, config_reader) = get_runtime_and_config_reader(verify_ssl); validate_rc_config_files(runtime.clone(), &file_paths).await; check::check_command( - check::CheckParams { file_paths, n_plus_one_queries, schema, format, runtime }, + check::CheckParams { file_paths, n_plus_one_queries, schema, runtime }, &config_reader, ) .await?; diff --git a/src/core/app_context.rs b/src/core/app_context.rs index 03036584c6..537fa7f785 100644 --- a/src/core/app_context.rs +++ b/src/core/app_context.rs @@ -50,12 +50,7 @@ impl AppContext { expr.modify(&mut |expr| match expr { IR::IO(io) => match io { IO::Http { - req_template, - group_by, - http_filter, - is_list, - dedupe, - .. + req_template, group_by, is_list, dedupe, hook, .. } => { let is_list = *is_list; let dedupe = *dedupe; @@ -70,7 +65,7 @@ impl AppContext { req_template: req_template.clone(), group_by: group_by.clone(), dl_id: Some(DataLoaderId::new(http_data_loaders.len())), - http_filter: http_filter.clone(), + hook: hook.clone(), is_list, dedupe, })); @@ -101,7 +96,7 @@ impl AppContext { result } - IO::Grpc { req_template, group_by, dedupe, .. } => { + IO::Grpc { req_template, group_by, dedupe, hook, .. } => { let dedupe = *dedupe; let data_loader = GrpcDataLoader { runtime: runtime.clone(), @@ -117,6 +112,7 @@ impl AppContext { group_by: group_by.clone(), dl_id: Some(DataLoaderId::new(grpc_data_loaders.len())), dedupe, + hook: hook.clone(), })); grpc_data_loaders.push(data_loader); diff --git a/src/core/blueprint/error.rs b/src/core/blueprint/error.rs index a8980ac8e7..4d4dd6337b 100644 --- a/src/core/blueprint/error.rs +++ b/src/core/blueprint/error.rs @@ -46,12 +46,18 @@ pub enum BlueprintError { #[error("Protobuf files were not specified in the config")] ProtobufFilesNotSpecifiedInConfig, - #[error("GroupBy is only supported for GET requests")] - GroupByOnlyForGet, + #[error("GroupBy is only supported for GET and POST requests")] + GroupByOnlyForGetAndPost, + + #[error("Request body batching requires exactly one dynamic value in the body.")] + BatchRequiresDynamicParameter, #[error("Batching capability was used without enabling it in upstream")] IncorrectBatchingUsage, + #[error("batchKey requires either body or query parameters")] + BatchKeyRequiresEitherBodyOrQuery, + #[error("script is required")] ScriptIsRequired, diff --git a/src/core/blueprint/fixture/all-constructs.graphql b/src/core/blueprint/fixture/all-constructs.graphql index 43098a8157..dd457f2acd 100644 --- a/src/core/blueprint/fixture/all-constructs.graphql +++ b/src/core/blueprint/fixture/all-constructs.graphql @@ -55,7 +55,7 @@ input PostInput { type Mutation { createUser(input: UserInput!): User! - @http(url: "http://jsonplaceholder.typicode.com/users", body: "{{.args.input}}", method: "POST") + @http(url: "http://jsonplaceholder.typicode.com/users", body: "{{.args.input}}", method: POST) createPost(input: PostInput): Post! - @http(url: "http://jsonplaceholder.typicode.com/posts", body: "{{.args.input}}", method: "POST") + @http(url: "http://jsonplaceholder.typicode.com/posts", body: "{{.args.input}}", method: POST) } diff --git a/src/core/blueprint/fixture/recursive-arg.graphql b/src/core/blueprint/fixture/recursive-arg.graphql new file mode 100644 index 0000000000..a124e657b5 --- /dev/null +++ b/src/core/blueprint/fixture/recursive-arg.graphql @@ -0,0 +1,10 @@ +schema @server(port: 8000) { + query: Query +} +type Query { + posts(id: PostData): Int @http(url: "upstream.com", query: [{key: "id", value: "{{.args.id.data}}"}]) +} +type PostData { + author: String + data: PostData +} diff --git a/src/core/blueprint/mod.rs b/src/core/blueprint/mod.rs index d4dfd05acb..91bdc0f773 100644 --- a/src/core/blueprint/mod.rs +++ b/src/core/blueprint/mod.rs @@ -17,6 +17,7 @@ mod operators; mod schema; mod server; pub mod telemetry; +mod template_validation; mod timeout; mod union_resolver; mod upstream; diff --git a/src/core/blueprint/operators/graphql.rs b/src/core/blueprint/operators/graphql.rs index 4fe3189f2b..fa678fb37b 100644 --- a/src/core/blueprint/operators/graphql.rs +++ b/src/core/blueprint/operators/graphql.rs @@ -84,7 +84,7 @@ pub fn compile_graphql( .map(|req_template| { let field_name = graphql.name.clone(); let batch = graphql.batch; - let dedupe = graphql.dedupe.unwrap_or_default(); + let dedupe = graphql.dedupe; IR::IO(IO::GraphQL { req_template, field_name, batch, dl_id: None, dedupe }) }) } diff --git a/src/core/blueprint/operators/grpc.rs b/src/core/blueprint/operators/grpc.rs index bcf7f979d6..cc4b85fb1a 100644 --- a/src/core/blueprint/operators/grpc.rs +++ b/src/core/blueprint/operators/grpc.rs @@ -14,6 +14,7 @@ use crate::core::helpers; use crate::core::ir::model::{IO, IR}; use crate::core::json::JsonSchema; use crate::core::mustache::Mustache; +use crate::core::worker_hooks::WorkerHooks; fn to_url(grpc: &Grpc, method: &GrpcMethod) -> Valid { Valid::succeed(grpc.url.as_str()).and_then(|base_url| { @@ -225,15 +226,19 @@ pub fn compile_grpc(inputs: CompileGrpc) -> Valid { body, operation_type: operation_type.clone(), }; + let on_response = grpc.on_response_body.clone(); + let hook = WorkerHooks::try_new(None, on_response).ok(); + let io = if !grpc.batch_key.is_empty() { IR::IO(IO::Grpc { req_template, group_by: Some(GroupBy::new(grpc.batch_key.clone(), None)), dl_id: None, dedupe, + hook, }) } else { - IR::IO(IO::Grpc { req_template, group_by: None, dl_id: None, dedupe }) + IR::IO(IO::Grpc { req_template, group_by: None, dl_id: None, dedupe, hook }) }; (io, &grpc.select) diff --git a/src/core/blueprint/operators/http.rs b/src/core/blueprint/operators/http.rs index 723ff21f2d..ab25a25ced 100644 --- a/src/core/blueprint/operators/http.rs +++ b/src/core/blueprint/operators/http.rs @@ -1,31 +1,44 @@ use tailcall_valid::{Valid, Validator}; +use template_validation::validate_argument; use crate::core::blueprint::*; use crate::core::config::group_by::GroupBy; +use crate::core::config::Field; use crate::core::endpoint::Endpoint; -use crate::core::http::{HttpFilter, Method, RequestTemplate}; +use crate::core::http::{Method, RequestTemplate}; use crate::core::ir::model::{IO, IR}; +use crate::core::worker_hooks::WorkerHooks; use crate::core::{config, helpers, Mustache}; pub fn compile_http( config_module: &config::ConfigModule, http: &config::Http, - is_list: bool, + field: &Field, ) -> Valid { + let is_list = field.type_of.is_list(); let dedupe = http.dedupe.unwrap_or_default(); let mustache_headers = match helpers::headers::to_mustache_headers(&http.headers).to_result() { Ok(mustache_headers) => Valid::succeed(mustache_headers), Err(e) => Valid::from_validation_err(BlueprintError::from_validation_string(e)), }; - Valid::<(), BlueprintError>::fail(BlueprintError::GroupByOnlyForGet) - .when(|| !http.batch_key.is_empty() && http.method != Method::GET) + Valid::<(), BlueprintError>::fail(BlueprintError::IncorrectBatchingUsage) + .when(|| { + (config_module.upstream.get_delay() < 1 || config_module.upstream.get_max_size() < 1) + && !http.batch_key.is_empty() + }) + .and( + Valid::from_iter(http.query.iter(), |query| { + validate_argument(config_module, Mustache::parse(query.value.as_str()), field) + }) + .unit() + .trace("query"), + ) .and( - Valid::<(), BlueprintError>::fail(BlueprintError::IncorrectBatchingUsage).when(|| { - (config_module.upstream.get_delay() < 1 - || config_module.upstream.get_max_size() < 1) - && !http.batch_key.is_empty() - }), + Valid::<(), BlueprintError>::fail(BlueprintError::BatchKeyRequiresEitherBodyOrQuery) + .when(|| { + !http.batch_key.is_empty() && (http.body.is_none() && http.query.is_empty()) + }), ) .and(Valid::succeed(http.url.as_str())) .zip(mustache_headers) @@ -56,40 +69,116 @@ pub fn compile_http( Err(e) => Valid::fail(BlueprintError::Error(e)), } }) + .and_then(|request_template| { + if !http.batch_key.is_empty() && (http.body.is_some() || http.method != Method::GET) { + if let Some(body) = http.body.as_ref() { + let dynamic_paths = count_dynamic_paths(body); + if dynamic_paths != 1 { + Valid::fail(BlueprintError::BatchRequiresDynamicParameter).trace("body") + } else { + Valid::succeed(request_template) + } + } else { + Valid::fail(BlueprintError::BatchRequiresDynamicParameter).trace("body") + } + } else { + Valid::succeed(request_template) + } + }) .map(|req_template| { // marge http and upstream on_request - let http_filter = http + let on_request = http .on_request .clone() - .or(config_module.upstream.on_request.clone()) - .map(|on_request| HttpFilter { on_request }); + .or(config_module.upstream.on_request.clone()); + let on_response_body = http.on_response_body.clone(); + let hook = WorkerHooks::try_new(on_request, on_response_body).ok(); - let io = if !http.batch_key.is_empty() && http.method == Method::GET { + let io = if !http.batch_key.is_empty() { // Find a query parameter that contains a reference to the {{.value}} key - let key = http.query.iter().find_map(|q| { - Mustache::parse(&q.value) - .expression_contains("value") - .then(|| q.key.clone()) - }); + let key = if http.method == Method::GET { + http.query.iter().find_map(|q| { + Mustache::parse(&q.value) + .expression_contains("value") + .then(|| q.key.clone()) + }) + } else { + None + }; + IR::IO(IO::Http { req_template, group_by: Some(GroupBy::new(http.batch_key.clone(), key)), dl_id: None, - http_filter, is_list, dedupe, + hook, }) } else { IR::IO(IO::Http { req_template, group_by: None, dl_id: None, - http_filter, is_list, dedupe, + hook, }) }; (io, &http.select) }) .and_then(apply_select) } + +/// Count the number of dynamic expressions in the JSON value. +fn count_dynamic_paths(json: &serde_json::Value) -> usize { + let mut count = 0; + match json { + serde_json::Value::Array(arr) => { + for v in arr { + count += count_dynamic_paths(v) + } + } + serde_json::Value::Object(obj) => { + for (_, v) in obj { + count += count_dynamic_paths(v) + } + } + serde_json::Value::String(s) => { + if !Mustache::parse(s).is_const() { + count += 1; + } + } + _ => {} + } + count +} + +#[cfg(test)] +mod test { + use serde_json::json; + + use super::*; + + #[test] + fn test_extract_expression_keys_from_nested_objects() { + let json = r#"{"body":"d","userId":"{{.value.uid}}","nested":{"other":"{{test}}"}}"#; + let json = serde_json::from_str(json).unwrap(); + let keys = count_dynamic_paths(&json); + assert_eq!(keys, 2); + } + + #[test] + fn test_extract_expression_keys_from_mixed_json() { + let json = r#"{"body":"d","userId":"{{.value.uid}}","nested":{"other":"{{test}}"},"meta":[{"key": "id", "value": "{{.value.userId}}"}]}"#; + let json = serde_json::from_str(json).unwrap(); + let keys = count_dynamic_paths(&json); + assert_eq!(keys, 3); + } + + #[test] + fn test_with_non_json_value() { + let json = json!(r#"{{.value}}"#); + let keys = count_dynamic_paths(&json); + assert_eq!(keys, 1); + } +} diff --git a/src/core/blueprint/operators/resolver.rs b/src/core/blueprint/operators/resolver.rs index 8361bded62..62095b2fc7 100644 --- a/src/core/blueprint/operators/resolver.rs +++ b/src/core/blueprint/operators/resolver.rs @@ -21,13 +21,9 @@ pub fn compile_resolver( let CompileResolver { config_module, field, operation_type, object_name } = inputs; match resolver { - Resolver::Http(http) => compile_http( - config_module, - http, - // inner resolver should resolve only single instance of type, not a list - field.type_of.is_list(), - ) - .trace(config::Http::trace_name().as_str()), + Resolver::Http(http) => { + compile_http(config_module, http, field).trace(config::Http::trace_name().as_str()) + } Resolver::Grpc(grpc) => compile_grpc(super::CompileGrpc { config_module, operation_type, diff --git a/src/core/blueprint/snapshots/tailcall__core__blueprint__index__test__from_blueprint.snap b/src/core/blueprint/snapshots/tailcall__core__blueprint__index__test__from_blueprint.snap index 25e63738ee..4736a29c54 100644 --- a/src/core/blueprint/snapshots/tailcall__core__blueprint__index__test__from_blueprint.snap +++ b/src/core/blueprint/snapshots/tailcall__core__blueprint__index__test__from_blueprint.snap @@ -1,6 +1,7 @@ --- source: src/core/blueprint/index.rs expression: index +snapshot_kind: text --- Index { map: { @@ -58,7 +59,7 @@ Index { ), headers: {}, body: Some( - "{{.args.input}}", + String("{{.args.input}}"), ), description: None, encoding: ApplicationJson, @@ -68,9 +69,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: false, dedupe: false, + hook: None, }, ), ), @@ -127,7 +128,7 @@ Index { ), headers: {}, body: Some( - "{{.args.input}}", + String("{{.args.input}}"), ), description: None, encoding: ApplicationJson, @@ -137,9 +138,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: false, dedupe: false, + hook: None, }, ), ), @@ -205,7 +206,7 @@ Index { ), headers: {}, body: Some( - "{{.args.input}}", + String("{{.args.input}}"), ), description: None, encoding: ApplicationJson, @@ -215,9 +216,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: false, dedupe: false, + hook: None, }, ), ), @@ -286,7 +287,7 @@ Index { ), headers: {}, body: Some( - "{{.args.input}}", + String("{{.args.input}}"), ), description: None, encoding: ApplicationJson, @@ -296,9 +297,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: false, dedupe: false, + hook: None, }, ), ), @@ -692,9 +693,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: true, dedupe: false, + hook: None, }, ), ), @@ -755,9 +756,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: false, dedupe: false, + hook: None, }, ), ), @@ -851,9 +852,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: true, dedupe: false, + hook: None, }, ), ), @@ -926,9 +927,9 @@ Index { }, group_by: None, dl_id: None, - http_filter: None, is_list: false, dedupe: false, + hook: None, }, ), ), diff --git a/src/core/blueprint/template_validation/mod.rs b/src/core/blueprint/template_validation/mod.rs new file mode 100644 index 0000000000..621ba90185 --- /dev/null +++ b/src/core/blueprint/template_validation/mod.rs @@ -0,0 +1,90 @@ +use tailcall_valid::{Valid, Validator}; + +use super::BlueprintError; +use crate::core::config::{Config, Field}; +use crate::core::mustache::Segment; +use crate::core::scalar::Scalar; +use crate::core::Mustache; + +// given a path, it follows path till leaf node and provides callback at leaf +// node. +fn path_validator<'a>( + config: &Config, + mut path_iter: impl Iterator, + type_of: &str, + leaf_validator: impl Fn(&str) -> bool, +) -> Valid<(), BlueprintError> { + match config.find_type(type_of) { + Some(type_def) => match path_iter.next() { + Some(field) => match type_def.fields.get(field) { + Some(field_type) => { + path_validator(config, path_iter, field_type.type_of.name(), leaf_validator) + } + None => Valid::fail(BlueprintError::FieldNotFound(field.to_string())), + }, + None => Valid::fail(BlueprintError::ValueIsNotOfScalarType(type_of.to_string())), + }, + None if leaf_validator(type_of) => Valid::succeed(()), + None => Valid::fail(BlueprintError::TypeNotFoundInConfig(type_of.to_string())), + } +} + +/// Function to validate the arguments in the HTTP resolver. +pub fn validate_argument( + config: &Config, + template: Mustache, + field: &Field, +) -> Valid<(), BlueprintError> { + let scalar_validator = + |type_: &str| Scalar::is_predefined(type_) || config.find_enum(type_).is_some(); + + Valid::from_iter(template.segments(), |segment| match segment { + Segment::Expression(expr) if expr.first().map_or(false, |v| v.contains("args")) => { + match expr.get(1) { + Some(arg_name) if field.args.get(arg_name).is_some() => { + let arg_type_of = field.args.get(arg_name).as_ref().unwrap().type_of.name(); + path_validator(config, expr.iter().skip(2), arg_type_of, scalar_validator) + .trace(arg_name) + } + Some(arg_name) => { + Valid::fail(BlueprintError::ArgumentNotFound(arg_name.to_string())) + .trace(arg_name) + } + None => Valid::fail(BlueprintError::TooFewPartsInTemplate), + } + } + _ => Valid::succeed(()), + }) + .unit() +} + +#[cfg(test)] +mod test { + use tailcall_valid::{Valid, Validator}; + + use super::validate_argument; + use crate::core::blueprint::BlueprintError; + use crate::core::Mustache; + use crate::include_config; + + #[test] + fn test_recursive_case() { + let config = include_config!("../fixture/recursive-arg.graphql"); + let config = config.unwrap(); + let template = Mustache::parse("{{.args.id.data}}"); + let field = config + .find_type("Query") + .and_then(|ty| ty.fields.get("posts")) + .unwrap(); + let validation_result = validate_argument(&config, template, field); + + assert!(validation_result.is_fail()); + assert_eq!( + validation_result, + Valid::fail(BlueprintError::ValueIsNotOfScalarType( + "PostData".to_string() + )) + .trace("id") + ); + } +} diff --git a/src/core/config/config.rs b/src/core/config/config.rs index 95f11893f7..a58715bec1 100644 --- a/src/core/config/config.rs +++ b/src/core/config/config.rs @@ -1,7 +1,7 @@ -use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; +use std::collections::{BTreeMap, BTreeSet, HashSet}; use std::fmt::{self, Display}; -use anyhow::Result; +use anyhow::{anyhow, Result}; use async_graphql::parser::types::ServiceDocument; use derive_setters::Setters; use indexmap::IndexMap; @@ -56,27 +56,28 @@ pub struct Config { /// /// Specifies the entry points for query and mutation in the generated /// GraphQL schema. + #[serde(skip)] pub schema: RootSchema, /// /// A map of all the types in the schema. - #[serde(default)] + #[serde(skip)] #[setters(skip)] pub types: BTreeMap, /// /// A map of all the union types in the schema. - #[serde(default, skip_serializing_if = "is_default")] + #[serde(skip)] pub unions: BTreeMap, /// /// A map of all the enum types in the schema - #[serde(default, skip_serializing_if = "is_default")] + #[serde(skip)] pub enums: BTreeMap, /// /// A list of all links in the schema. - #[serde(default, skip_serializing_if = "is_default")] + #[serde(skip)] pub links: Vec, /// Enable [opentelemetry](https://opentelemetry.io) support @@ -87,40 +88,31 @@ pub struct Config { /// /// Represents a GraphQL type. /// A type can be an object, interface, enum or scalar. -#[derive( - Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq, schemars::JsonSchema, MergeRight, -)] +#[derive(Clone, Debug, Default, PartialEq, Eq, MergeRight)] pub struct Type { /// /// A map of field name and its definition. pub fields: BTreeMap, - #[serde(default, skip_serializing_if = "is_default")] /// /// Additional fields to be added to the type pub added_fields: Vec, - #[serde(default, skip_serializing_if = "is_default")] /// /// Documentation for the type that is publicly visible. pub doc: Option, - #[serde(default, skip_serializing_if = "is_default")] /// /// Interfaces that the type implements. pub implements: BTreeSet, - #[serde(default, skip_serializing_if = "is_default")] /// /// Setting to indicate if the type can be cached. pub cache: Option, /// /// Marks field as protected by auth providers - #[serde(default)] pub protected: Option, /// /// Apollo federation entity resolver. - #[serde(flatten, default, skip_serializing_if = "is_default")] pub resolvers: ResolverSet, /// /// Any additional directives - #[serde(default, skip_serializing_if = "is_default")] pub directives: Vec, } @@ -158,59 +150,38 @@ impl Type { } } -#[derive( - Serialize, - Deserialize, - Clone, - Debug, - Default, - Setters, - PartialEq, - Eq, - schemars::JsonSchema, - MergeRight, -)] +#[derive(Clone, Debug, Default, Setters, PartialEq, Eq, MergeRight)] #[setters(strip_option)] pub struct RootSchema { pub query: Option, - #[serde(default, skip_serializing_if = "is_default")] pub mutation: Option, - #[serde(default, skip_serializing_if = "is_default")] pub subscription: Option, } /// /// A field definition containing all the metadata information about resolving a /// field. -#[derive( - Serialize, Deserialize, Clone, Debug, Default, Setters, PartialEq, Eq, schemars::JsonSchema, -)] +#[derive(Clone, Debug, Default, Setters, PartialEq, Eq)] #[setters(strip_option)] pub struct Field { /// /// Refers to the type of the value the field can be resolved to. - #[serde(rename = "type", default, skip_serializing_if = "is_default")] pub type_of: crate::core::Type, /// /// Map of argument name and its definition. - #[serde(default, skip_serializing_if = "is_default")] - #[schemars(with = "HashMap::")] pub args: IndexMap, /// /// Publicly visible documentation for the field. - #[serde(default, skip_serializing_if = "is_default")] pub doc: Option, /// /// Allows modifying existing fields. - #[serde(default, skip_serializing_if = "is_default")] pub modify: Option, /// /// Omits a field from public consumption. - #[serde(default, skip_serializing_if = "is_default")] pub omit: Option, /// @@ -219,12 +190,10 @@ pub struct Field { /// /// Stores the default value for the field - #[serde(default, skip_serializing_if = "is_default")] pub default_value: Option, /// /// Marks field as protected by auth provider - #[serde(default)] pub protected: Option, /// @@ -233,12 +202,10 @@ pub struct Field { /// /// Resolver for the field - #[serde(flatten, default, skip_serializing_if = "is_default")] pub resolvers: ResolverSet, /// /// Any additional directives - #[serde(default, skip_serializing_if = "is_default")] pub directives: Vec, } @@ -288,32 +255,26 @@ impl Field { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Inline { pub path: Vec, } -#[derive(Default, Serialize, Deserialize, Clone, Debug, PartialEq, Eq, schemars::JsonSchema)] +#[derive(Default, Clone, Debug, PartialEq, Eq)] pub struct Arg { - #[serde(rename = "type")] pub type_of: crate::core::Type, - #[serde(default, skip_serializing_if = "is_default")] pub doc: Option, - #[serde(default, skip_serializing_if = "is_default")] pub modify: Option, - #[serde(default, skip_serializing_if = "is_default")] pub default_value: Option, } -#[derive( - Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq, schemars::JsonSchema, MergeRight, -)] +#[derive(Clone, Debug, Default, PartialEq, Eq, MergeRight)] pub struct Union { pub types: BTreeSet, pub doc: Option, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, schemars::JsonSchema, MergeRight)] +#[derive(Clone, Debug, PartialEq, Eq, MergeRight)] /// Definition of GraphQL enum type pub struct Enum { pub variants: BTreeSet, @@ -321,26 +282,14 @@ pub struct Enum { } /// Definition of GraphQL value -#[derive( - Serialize, - Deserialize, - Clone, - Debug, - PartialEq, - Eq, - PartialOrd, - Ord, - schemars::JsonSchema, - MergeRight, -)] +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, MergeRight)] pub struct Variant { pub name: String, // directive: alias pub alias: Option, } -#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] -#[serde(rename_all = "lowercase")] +#[derive(Default, Debug, Clone, PartialEq, Eq)] pub enum GraphQLOperationType { #[default] Query, @@ -387,7 +336,7 @@ impl Config { } pub fn to_yaml(&self) -> Result { - Ok(serde_yaml::to_string(self)?) + Ok(serde_yaml_ng::to_string(self)?) } pub fn to_json(&self, pretty: bool) -> Result { @@ -428,7 +377,7 @@ impl Config { } pub fn from_yaml(yaml: &str) -> Result { - Ok(serde_yaml::from_str(yaml)?) + Ok(serde_yaml_ng::from_str(yaml)?) } pub fn from_sdl(sdl: &str) -> Valid { @@ -442,8 +391,7 @@ impl Config { pub fn from_source(source: Source, schema: &str) -> Result { match source { Source::GraphQL => Ok(Config::from_sdl(schema).to_result()?), - Source::Json => Ok(Config::from_json(schema)?), - Source::Yml => Ok(Config::from_yaml(schema)?), + _ => Err(anyhow!("Only the graphql config is currently supported")), } } diff --git a/src/core/config/config_module/fixtures/router.graphql b/src/core/config/config_module/fixtures/router.graphql index 5288226c3d..39ac02e37a 100644 --- a/src/core/config/config_module/fixtures/router.graphql +++ b/src/core/config/config_module/fixtures/router.graphql @@ -1,4 +1,4 @@ -schema { +schema @server(port: 8000) @upstream(httpCache: 42, batch: {delay: 100}) { # @link(src: "http://localhost:4000", type: SubGraph, meta: {name: "Users"}) # @link(src: "http://localhost:5000", type: SubGraph, meta: {name: "Posts"}) query: Query diff --git a/src/core/config/config_module/fixtures/subgraph-posts.graphql b/src/core/config/config_module/fixtures/subgraph-posts.graphql index ab6ff45aaf..615da04552 100644 --- a/src/core/config/config_module/fixtures/subgraph-posts.graphql +++ b/src/core/config/config_module/fixtures/subgraph-posts.graphql @@ -1,4 +1,4 @@ -schema @server(port: 8000) @upstream(httpCache: 42, batch: {delay: 100}) { +schema { query: Query } diff --git a/src/core/config/config_module/fixtures/subgraph-users.graphql b/src/core/config/config_module/fixtures/subgraph-users.graphql index 22f0e6b63a..a1ff68280a 100644 --- a/src/core/config/config_module/fixtures/subgraph-users.graphql +++ b/src/core/config/config_module/fixtures/subgraph-users.graphql @@ -1,4 +1,4 @@ -schema @server(port: 8000) @upstream(httpCache: 42, batch: {delay: 100}) { +schema { query: Query } diff --git a/src/core/config/config_module/merge.rs b/src/core/config/config_module/merge.rs index 5fc7fff0d7..6d0e3e1a12 100644 --- a/src/core/config/config_module/merge.rs +++ b/src/core/config/config_module/merge.rs @@ -4,10 +4,10 @@ use indexmap::IndexMap; use tailcall_valid::{Valid, Validator}; use super::{Cache, ConfigModule}; -use crate::core; -use crate::core::config::{Arg, Config, Enum, Field, Type}; +use crate::core::config::{Arg, Config, Enum, Field, RootSchema, Type}; use crate::core::merge_right::MergeRight; use crate::core::variance::{Contravariant, Covariant, Invariant}; +use crate::core::{self}; impl core::Type { fn merge(self, other: Self, non_null_merge: fn(bool, bool) -> bool) -> Valid { @@ -183,6 +183,24 @@ impl Covariant for Enum { } } +impl Invariant for RootSchema { + fn unify(self, other: Self) -> Valid { + fn unify_option(left: Option, right: Option) -> Option { + match (left, right) { + (None, None) => None, + (None, Some(that)) => Some(that), + (Some(this), _) => Some(this), + } + } + + Valid::succeed(Self { + query: unify_option(self.query, other.query), + mutation: unify_option(self.mutation, other.mutation), + subscription: unify_option(self.subscription, other.subscription), + }) + } +} + impl Invariant for Cache { fn unify(self, other: Self) -> Valid { let mut types = self.config.types; @@ -270,12 +288,18 @@ impl Invariant for Cache { .map(|en| (name, en)) .trace(&trace_name) })) - .map( |(merged_types, merged_enums)| { + .fuse(self.config.schema.unify(other.config.schema)) + .map( |(merged_types, merged_enums, schema)| { types.extend(merged_types); enums.extend(merged_enums); let config = Config { - types, enums, unions: self.config.unions.merge_right(other.config.unions), server: self.config.server.merge_right(other.config.server), upstream: self.config.upstream.merge_right(other.config.upstream), schema: self.config.schema.merge_right(other.config.schema), links: self.config.links.merge_right(other.config.links), telemetry: self.config.telemetry.merge_right(other.config.telemetry) }; + types, + enums, + unions: self.config.unions.merge_right(other.config.unions), + schema, + ..self.config + }; Cache { config, diff --git a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_invalid.snap b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_invalid.snap index 8ecb8fa6c5..9a5d313ab4 100644 --- a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_invalid.snap +++ b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_invalid.snap @@ -1,6 +1,7 @@ --- source: src/core/config/config_module/merge.rs expression: merged.unwrap_err() +snapshot_kind: text --- Validation Error • Enum is used as input type in one subgraph and output type in another [enumOutput] diff --git a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_valid.snap b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_valid.snap index 956dea8fed..2af8874363 100644 --- a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_valid.snap +++ b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_valid.snap @@ -1,6 +1,7 @@ --- source: src/core/config/config_module/merge.rs expression: merged.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_invalid.snap b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_invalid.snap index 565380877c..bd68f45bd6 100644 --- a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_invalid.snap +++ b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_invalid.snap @@ -1,6 +1,7 @@ --- source: src/core/config/config_module/merge.rs expression: merged.unwrap_err() +snapshot_kind: text --- Validation Error • Type mismatch: expected `String`, got `Int` [A, a] diff --git a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_valid.snap b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_valid.snap index 68cc9dfe6f..407c2c5a87 100644 --- a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_valid.snap +++ b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_valid.snap @@ -1,6 +1,7 @@ --- source: src/core/config/config_module/merge.rs expression: merged.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__unions_valid.snap b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__unions_valid.snap index 78906a4f64..d23cb5cf39 100644 --- a/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__unions_valid.snap +++ b/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__unions_valid.snap @@ -1,6 +1,7 @@ --- source: src/core/config/config_module/merge.rs expression: merged.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/directives/graphql.rs b/src/core/config/directives/graphql.rs index 509c2a0646..f9b74bc07e 100644 --- a/src/core/config/directives/graphql.rs +++ b/src/core/config/directives/graphql.rs @@ -55,5 +55,5 @@ pub struct GraphQL { /// concurrently, reducing resource load. Caution: May lead to issues /// with APIs that expect unique results for identical inputs, such as /// nonce-based APIs. - pub dedupe: Option, + pub dedupe: bool, } diff --git a/src/core/config/directives/grpc.rs b/src/core/config/directives/grpc.rs index 919ae53027..5a5b1b5e4d 100644 --- a/src/core/config/directives/grpc.rs +++ b/src/core/config/directives/grpc.rs @@ -68,4 +68,10 @@ pub struct Grpc { /// "buzz": "eggs", ... }, ... }` we can use { foo: "{{.foo}}", buzz: /// "{{.fizz.buzz}}" }` pub select: Option, + + /// Specifies a JavaScript function to be executed after receiving the + /// response body. This function can modify or transform the response + /// body before it's sent back to the client. + #[serde(rename = "onResponseBody", default, skip_serializing_if = "is_default")] + pub on_response_body: Option, } diff --git a/src/core/config/directives/http.rs b/src/core/config/directives/http.rs index 91e0ecc985..150f871d8d 100644 --- a/src/core/config/directives/http.rs +++ b/src/core/config/directives/http.rs @@ -40,8 +40,9 @@ pub struct Http { #[serde(default, skip_serializing_if = "is_default")] /// The body of the API call. It's used for methods like POST or PUT that /// send data to the server. You can pass it as a static object or use a - /// Mustache template to substitute variables from the GraphQL variables. - pub body: Option, + /// Mustache template with object to substitute variables from the GraphQL + /// variables. + pub body: Option, #[serde(default, skip_serializing_if = "is_default")] /// The `encoding` parameter specifies the encoding of the request body. It @@ -101,4 +102,10 @@ pub struct Http { /// "buzz": "eggs", ... }, ... }` we can use { foo: "{{.foo}}", buzz: /// "{{.fizz.buzz}}" }` pub select: Option, + + /// Specifies a JavaScript function to be executed after receiving the + /// response body. This function can modify or transform the response + /// body before it's sent back to the client. + #[serde(rename = "onResponseBody", default, skip_serializing_if = "is_default")] + pub on_response_body: Option, } diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__batched_resolvers.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__batched_resolvers.snap index c096c4fb6c..2ad91b5fa9 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__batched_resolvers.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__batched_resolvers.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles.snap index c096c4fb6c..2ad91b5fa9 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolver.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolver.snap index 48be08ce76..b5c166ace6 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolver.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolver.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- query { f1 { f1 { f2 } } } diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolvers.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolvers.snap index 9829be427a..5bb9b02825 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolvers.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolvers.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- query { f1 { f2 } } diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_type_usage.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_type_usage.snap index 8cbff01fc8..018abba7ae 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_type_usage.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_type_usage.snap @@ -1,6 +1,7 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- query { t2 { t2 { n } } } query { t2_ls { t2 } } diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_config.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_config.snap index 0722c0f3ee..6c607171f5 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_config.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_config.snap @@ -1,6 +1,7 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- query { bar { spam } } query { buzz { spam } } diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_non_list.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_non_list.snap index c096c4fb6c..2ad91b5fa9 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_non_list.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_non_list.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers.snap index 86da63d7f4..14183ebe86 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- query { f1 { f2 { f3 { f4 } } } } diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_non_list_resolvers.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_non_list_resolvers.snap index 86da63d7f4..14183ebe86 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_non_list_resolvers.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_non_list_resolvers.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- query { f1 { f2 { f3 { f4 } } } } diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_without_resolvers.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_without_resolvers.snap index c096c4fb6c..2ad91b5fa9 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_without_resolvers.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_without_resolvers.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- diff --git a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__resolvers.snap b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__resolvers.snap index 9829be427a..5bb9b02825 100644 --- a/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__resolvers.snap +++ b/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__resolvers.snap @@ -1,5 +1,6 @@ --- source: src/core/config/npo/tracker.rs expression: actual +snapshot_kind: text --- query { f1 { f2 } } diff --git a/src/core/config/reader.rs b/src/core/config/reader.rs index ec24107aba..675c6a9d42 100644 --- a/src/core/config/reader.rs +++ b/src/core/config/reader.rs @@ -1,10 +1,11 @@ use std::path::Path; +use futures_util::future::join_all; use rustls_pemfile; use rustls_pki_types::{ CertificateDer, PrivateKeyDer, PrivatePkcs1KeyDer, PrivatePkcs8KeyDer, PrivateSec1KeyDer, }; -use tailcall_valid::{Valid, Validator}; +use tailcall_valid::{Valid, ValidationError, Validator}; use url::Url; use super::{ConfigModule, Content, Link, LinkType, PrivateKey}; @@ -34,12 +35,13 @@ impl ConfigReader { } /// Reads the links in a Config and fill the content - #[async_recursion::async_recursion] async fn ext_links( &self, config_module: ConfigModule, - parent_dir: Option<&'async_recursion Path>, + parent_dir: Option<&Path>, ) -> anyhow::Result { + let reader_ctx = ConfigReaderContext::new(&self.runtime); + let links: Vec = config_module .config() .links @@ -65,23 +67,19 @@ impl ConfigReader { match link.type_of { LinkType::Config => { - let source = self.resource_reader.read_file(path).await?; + let source = self + .resource_reader + .read_file(path) + .await? + .render(&reader_ctx); let content = source.content; let config = Config::from_source(Source::detect(&source.path)?, &content)?; config_module = config_module.and_then(|config_module| { config_module.unify(ConfigModule::from(config.clone())) }); - - if !config.links.is_empty() { - let cfg_module = self - .ext_links(ConfigModule::from(config), Path::new(&link.src).parent()) - .await?; - config_module = - config_module.and_then(|config_module| config_module.unify(cfg_module)); - } } LinkType::Protobuf => { - let meta = self.proto_reader.read(path).await?; + let meta = self.proto_reader.read(path, None).await?; extensions.add_proto(meta); } LinkType::Script => { @@ -184,25 +182,42 @@ impl ConfigReader { &self, files: &[T], ) -> anyhow::Result { - let files = self.resource_reader.read_files(files).await?; - let mut config_module = Valid::succeed(ConfigModule::default()); + let reader_ctx = ConfigReaderContext::new(&self.runtime); - for file in files.iter() { + let files = self + .resource_reader + .read_files(files) + .await? + .into_iter() + .map(|file| file.render(&reader_ctx)) + .collect::>(); + + let mut config_modules = join_all(files.iter().map(|file| async { let source = Source::detect(&file.path)?; let schema = &file.content; // Create initial config module - let new_config_module = self - .resolve( - Config::from_source(source, schema)?, - Path::new(&file.path).parent(), - ) - .await?; - - // Merge it with the original config set - config_module = - config_module.and_then(|config_module| config_module.unify(new_config_module)); - } + self.resolve( + Config::from_source(source, schema)?, + Path::new(&file.path).parent(), + ) + .await + })) + .await + .into_iter(); + + let config_module = Valid::from( + config_modules + .next() + .ok_or(anyhow::anyhow!("At least one config should be defined"))? + .map_err(to_validation_error), + ); + + let config_module = config_modules.fold(config_module, |acc, other| { + acc.and_then(|cfg| { + Valid::from(other.map_err(to_validation_error)).and_then(|other| cfg.unify(other)) + }) + }); Ok(config_module.to_result()?) } @@ -214,16 +229,13 @@ impl ConfigReader { parent_dir: Option<&Path>, ) -> anyhow::Result { // Setup telemetry in Config - let reader_ctx = ConfigReaderContext { - runtime: &self.runtime, - vars: &config - .server - .vars - .iter() - .map(|vars| (vars.key.clone(), vars.value.clone())) - .collect(), - headers: Default::default(), - }; + let vars = &config + .server + .vars + .iter() + .map(|vars| (vars.key.clone(), vars.value.clone())) + .collect(); + let reader_ctx = ConfigReaderContext::new(&self.runtime).vars(vars); config.telemetry.render_mustache(&reader_ctx)?; // Create initial config set & extend it with the links @@ -244,6 +256,13 @@ impl ConfigReader { } } +fn to_validation_error(error: anyhow::Error) -> ValidationError { + match error.downcast::>() { + Ok(err) => err, + Err(err) => ValidationError::new(err.to_string()), + } +} + #[cfg(test)] mod reader_tests { use std::path::{Path, PathBuf}; @@ -261,40 +280,33 @@ mod reader_tests { async fn test_all() { let runtime = crate::core::runtime::test::init(None); + let server = start_mock_server(); let mut cfg = Config::default(); - cfg.schema.query = Some("Test".to_string()); - cfg = cfg.types([("Test", Type::default())].to_vec()); + cfg = cfg.types([("User", Type::default())].to_vec()); - let server = start_mock_server(); - let header_server = server.mock(|when, then| { - when.method(httpmock::Method::GET).path("/bar.graphql"); + let foo_mock = server.mock(|when, then| { + when.method(httpmock::Method::GET).path("/foo.graphql"); then.status(200).body(cfg.to_sdl()); }); - let json = runtime - .file - .read("examples/jsonplaceholder.json") - .await - .unwrap(); + let mut cfg = Config::default(); + cfg.schema.query = Some("Test".to_string()); + cfg = cfg.types([("Test", Type::default())].to_vec()); - let foo_json_server = server.mock(|when, then| { - when.method(httpmock::Method::GET).path("/foo.json"); - then.status(200).body(json); + let bar_mock = server.mock(|when, then| { + when.method(httpmock::Method::GET).path("/bar.graphql"); + then.status(200).body(cfg.to_sdl()); }); let port = server.port(); - let files: Vec = [ - "examples/jsonplaceholder.yml", // config from local file - format!("http://localhost:{port}/bar.graphql").as_str(), // with content-type header - format!("http://localhost:{port}/foo.json").as_str(), // with url extension - ] - .iter() - .map(|x| x.to_string()) - .collect(); + let files = vec![ + format!("http://localhost:{port}/foo.graphql"), + format!("http://localhost:{port}/bar.graphql"), + ]; let cr = ConfigReader::init(runtime); let c = cr.read_all(&files).await.unwrap(); assert_eq!( - ["Post", "Query", "Test", "User"] + ["Test", "User"] .iter() .map(|i| i.to_string()) .collect::>(), @@ -303,22 +315,18 @@ mod reader_tests { .map(|i| i.to_string()) .collect::>() ); - foo_json_server.assert(); // checks if the request was actually made - header_server.assert(); + foo_mock.assert(); + bar_mock.assert(); } #[tokio::test] async fn test_local_files() { let runtime = crate::core::runtime::test::init(None); - let files: Vec = [ - "examples/jsonplaceholder.yml", - "examples/jsonplaceholder.graphql", - "examples/jsonplaceholder.json", - ] - .iter() - .map(|x| x.to_string()) - .collect(); + let files: Vec = ["examples/jsonplaceholder.graphql"] + .iter() + .map(|x| x.to_string()) + .collect(); let cr = ConfigReader::init(runtime); let c = cr.read_all(&files).await.unwrap(); assert_eq!( diff --git a/src/core/config/reader_context.rs b/src/core/config/reader_context.rs index ef228e3535..696156b365 100644 --- a/src/core/config/reader_context.rs +++ b/src/core/config/reader_context.rs @@ -1,18 +1,27 @@ use std::borrow::Cow; use std::collections::BTreeMap; +use derive_setters::Setters; use http::header::HeaderMap; use crate::core::has_headers::HasHeaders; use crate::core::path::PathString; use crate::core::runtime::TargetRuntime; +#[derive(Setters)] pub struct ConfigReaderContext<'a> { pub runtime: &'a TargetRuntime, - pub vars: &'a BTreeMap, + #[setters(strip_option)] + pub vars: Option<&'a BTreeMap>, pub headers: HeaderMap, } +impl<'a> ConfigReaderContext<'a> { + pub fn new(runtime: &'a TargetRuntime) -> Self { + Self { runtime, vars: None, headers: Default::default() } + } +} + impl PathString for ConfigReaderContext<'_> { fn path_string>(&self, path: &[T]) -> Option> { if path.is_empty() { @@ -21,7 +30,7 @@ impl PathString for ConfigReaderContext<'_> { path.split_first() .and_then(|(head, tail)| match head.as_ref() { - "vars" => self.vars.get(tail[0].as_ref()).map(|v| v.into()), + "vars" => self.vars?.get(tail[0].as_ref()).map(|v| v.into()), "env" => self.runtime.env.get(tail[0].as_ref()), _ => None, }) @@ -49,11 +58,12 @@ mod tests { "ENV_VAL".to_owned(), )])); - let reader_context = ConfigReaderContext { - runtime: &runtime, - vars: &BTreeMap::from_iter([("VAR_1".to_owned(), "VAR_VAL".to_owned())]), - headers: Default::default(), - }; + let vars = &[("VAR_1".to_owned(), "VAR_VAL".to_owned())] + .iter() + .cloned() + .collect(); + + let reader_context = ConfigReaderContext::new(&runtime).vars(vars); assert_eq!( reader_context.path_string(&["env", "ENV_1"]), diff --git a/src/core/config/transformer/ambiguous_type.rs b/src/core/config/transformer/ambiguous_type.rs index 994de6557b..3a3a9dc646 100644 --- a/src/core/config/transformer/ambiguous_type.rs +++ b/src/core/config/transformer/ambiguous_type.rs @@ -252,6 +252,7 @@ mod tests { .inputs(vec![Input::Proto { metadata: ProtoMetadata { descriptor_set: set, path: news_proto.to_string() }, url, + connect_rpc: None, }]) .generate(false)?; diff --git a/src/core/config/transformer/fixtures/nested-unions-recursive.graphql b/src/core/config/transformer/fixtures/nested-unions-recursive.graphql new file mode 100644 index 0000000000..2fb810f272 --- /dev/null +++ b/src/core/config/transformer/fixtures/nested-unions-recursive.graphql @@ -0,0 +1,32 @@ +schema { + query: Query +} + +type T1 { + t1: String +} + +type T2 { + t2: Int +} + +type T3 { + t3: Boolean + t33: Float! +} + +type T4 { + t4: String +} + +type T5 { + t5: Boolean +} + +union U1 = T1 | T2 | T3 | U2 +union U2 = T3 | T4 | U1 +union U = U1 | U2 | T5 + +type Query { + test(u: U!): U @http(url: "http://localhost/users/{{args.u}}") +} diff --git a/src/core/config/transformer/fixtures/nested-unions.graphql b/src/core/config/transformer/fixtures/nested-unions.graphql new file mode 100644 index 0000000000..dfb418246c --- /dev/null +++ b/src/core/config/transformer/fixtures/nested-unions.graphql @@ -0,0 +1,32 @@ +schema { + query: Query +} + +type T1 { + t1: String +} + +type T2 { + t2: Int +} + +type T3 { + t3: Boolean + t33: Float! +} + +type T4 { + t4: String +} + +type T5 { + t5: Boolean +} + +union U1 = T1 | T2 | T3 +union U2 = T3 | T4 +union U = U1 | U2 | T5 + +type Query { + test(u: U!): U @http(url: "http://localhost/users/{{args.u}}") +} diff --git a/src/core/config/transformer/fixtures/recursive-input.graphql b/src/core/config/transformer/fixtures/recursive-input.graphql new file mode 100644 index 0000000000..23899c7844 --- /dev/null +++ b/src/core/config/transformer/fixtures/recursive-input.graphql @@ -0,0 +1,17 @@ +schema @server(port: 8000) { + query: Query +} + +type Bar { + name: Foo + rec: Bar +} + +type Foo { + name: String +} + +type Query { + bars(filter: Bar): String + @graphQL(url: "http://localhost", args: [{key: "baz", value: "{{.args.baz}}"}], name: "bars") +} diff --git a/src/core/config/transformer/fixtures/union-in-type.graphql b/src/core/config/transformer/fixtures/union-in-type.graphql new file mode 100644 index 0000000000..8c58a1b0e1 --- /dev/null +++ b/src/core/config/transformer/fixtures/union-in-type.graphql @@ -0,0 +1,33 @@ +schema { + query: Query +} + +type T1 { + t1: String +} + +type T2 { + t2: Int +} + +type T3 { + t3: Boolean + t33: Float! +} + +type NU { + test: String + u: U +} + +type NNU { + other: Int + new: Boolean + nu: NU +} + +union U = T1 | T2 | T3 + +type Query { + test(nu: NU!, nnu: NNU): U @http(url: "http://localhost/users/{{args.nu.u}}") +} diff --git a/src/core/config/transformer/fixtures/union.graphql b/src/core/config/transformer/fixtures/union.graphql new file mode 100644 index 0000000000..71ab1f38cb --- /dev/null +++ b/src/core/config/transformer/fixtures/union.graphql @@ -0,0 +1,22 @@ +schema { + query: Query +} + +type T1 { + t1: String +} + +type T2 { + t2: Int +} + +type T3 { + t3: Boolean + t33: Float! +} + +union U = T1 | T2 | T3 + +type Query { + test(u: U!): U @http(url: "http://localhost/users/{{args.u}}") +} diff --git a/src/core/config/transformer/flatten_single_field.rs b/src/core/config/transformer/flatten_single_field.rs index b153ce87f9..1f8f53fdd6 100644 --- a/src/core/config/transformer/flatten_single_field.rs +++ b/src/core/config/transformer/flatten_single_field.rs @@ -58,7 +58,12 @@ impl Transform for FlattenSingleField { fn transform(&self, mut config: Self::Value) -> Valid { let origin_config = config.clone(); - for ty in config.types.values_mut() { + let input_types = config.input_types(); + + for (ty_name, ty) in config.types.iter_mut() { + if input_types.contains(ty_name) { + continue; + } for (field_name, field) in ty.fields.iter_mut() { let mut visited_types = HashSet::::new(); if let Some(path) = get_single_field_path( diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__cyclic_merge_case.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__cyclic_merge_case.snap index 1d258d9b10..1f3bdb3e93 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__cyclic_merge_case.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__cyclic_merge_case.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__fail_when_scalar_field_not_match.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__fail_when_scalar_field_not_match.snap index 44381963fe..0b27bb35d1 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__fail_when_scalar_field_not_match.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__fail_when_scalar_field_not_match.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- type T1 { a: Int diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__input_types.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__input_types.snap index 725071fd48..e0b8edb843 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__input_types.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__input_types.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__interface_types.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__interface_types.snap index ffdd47a32d..b08852eded 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__interface_types.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__interface_types.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- interface GEN__M1 { a: Int diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__list_field_types.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__list_field_types.snap index 618f632dc9..3219cd4757 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__list_field_types.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__list_field_types.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream(httpCache: 42) { query: Query diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__merge_to_supertype.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__merge_to_supertype.snap index 06ffb453c8..df0fc23d8e 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__merge_to_supertype.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__merge_to_supertype.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__type_merger.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__type_merger.snap index e6c6bdddce..16095876bf 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__type_merger.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__type_merger.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__union_types.snap b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__union_types.snap index c463a6d54d..ae98e9bedd 100644 --- a/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__union_types.snap +++ b/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__union_types.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/merge_types/type_merger.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/nested_unions.rs b/src/core/config/transformer/nested_unions.rs index faab9d98ed..f7dea98cd1 100644 --- a/src/core/config/transformer/nested_unions.rs +++ b/src/core/config/transformer/nested_unions.rs @@ -75,14 +75,12 @@ mod tests { use tailcall_valid::Validator; use super::NestedUnions; - use crate::core::config::Config; use crate::core::transform::Transform; + use crate::include_config; #[test] fn test_nested_unions() { - let config = - std::fs::read_to_string(tailcall_fixtures::configs::YAML_NESTED_UNIONS).unwrap(); - let config = Config::from_yaml(&config).unwrap(); + let config = include_config!("./fixtures/nested-unions.graphql").unwrap(); let config = NestedUnions.transform(config).to_result().unwrap(); assert_snapshot!(config.to_sdl()); @@ -90,10 +88,7 @@ mod tests { #[test] fn test_nested_unions_recursive() { - let config = - std::fs::read_to_string(tailcall_fixtures::configs::YAML_NESTED_UNIONS_RECURSIVE) - .unwrap(); - let config = Config::from_yaml(&config).unwrap(); + let config = include_config!("./fixtures/nested-unions-recursive.graphql").unwrap(); let error = NestedUnions.transform(config).to_result().unwrap_err(); assert_snapshot!(error); diff --git a/src/core/config/transformer/preset.rs b/src/core/config/transformer/preset.rs index be70315674..e7c41e3a13 100644 --- a/src/core/config/transformer/preset.rs +++ b/src/core/config/transformer/preset.rs @@ -18,7 +18,7 @@ impl Preset { Self { merge_type: 0.0, tree_shake: false, - infer_type_names: false, + infer_type_names: true, unwrap_single_field_types: true, } } diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_news_types.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_news_types.snap index 438ff66017..00caa7facf 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_news_types.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_news_types.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/ambiguous_type.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_types.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_types.snap index 7e9c3e302f..c9c8e1eb9a 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_types.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__ambiguous_type__tests__resolve_ambiguous_types.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/ambiguous_type.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__flatten_single_field__test__type_name_generator_transform.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__flatten_single_field__test__type_name_generator_transform.snap index 90e0cd69e0..a456b4d8ed 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__flatten_single_field__test__type_name_generator_transform.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__flatten_single_field__test__type_name_generator_transform.snap @@ -1,15 +1,20 @@ --- source: src/core/config/transformer/flatten_single_field.rs expression: transformed_config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query } -type Bar { +input Bar { a: Int } +input Input { + a: Bar +} + type Connection { user: User } @@ -28,6 +33,7 @@ type NotSingleMiddle { } type Query @addField(name: "foo", path: ["foo", "bar", "a"]) { + a(input: Input!): Empty foo: Foo @omit not_single: NotSingle not_single_middle: NotSingleMiddle diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator.snap index 09d179abcb..a783067965 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/improve_type_names.rs expression: transformed_config.to_sdl() +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream(httpCache: 42) { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_transform.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_transform.snap index 529931e56e..04daa95563 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_transform.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_transform.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/improve_type_names.rs expression: transformed_config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_with_cyclic_types.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_with_cyclic_types.snap index 8dfc11f868..94bb987f5f 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_with_cyclic_types.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__improve_type_names__test__type_name_generator_with_cyclic_types.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/improve_type_names.rs expression: transformed_config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions.snap index 61d3ccbecf..ee0c26fbc5 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/nested_unions.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions_recursive.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions_recursive.snap index d5e7acd9e4..46c76c969a 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions_recursive.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions_recursive.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/nested_unions.rs expression: error +snapshot_kind: text --- Validation Error • Recursive type U1 [U] diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__inferface_rename.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__inferface_rename.snap index 00d4511bf6..8fafd26450 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__inferface_rename.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__inferface_rename.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/rename_types.rs expression: result.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__rename_type.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__rename_type.snap index 853b670043..07630ffd61 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__rename_type.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__rename_types__test__rename_type.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/rename_types.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: PostQuery diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_call.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_call.snap index 056418f3e3..8416e28582 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_call.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_call.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys +snapshot_kind: text --- Valid( Ok( diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_expr.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_expr.snap index 29c06be101..c84b688a06 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_expr.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_expr.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys +snapshot_kind: text --- Valid( Ok( diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_graphql.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_graphql.snap index ae0c75e46a..2e5c80cccf 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_graphql.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_graphql.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys +snapshot_kind: text --- Valid( Ok( diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_grpc.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_grpc.snap index a58bbbb93b..7396014f92 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_grpc.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_grpc.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys +snapshot_kind: text --- Valid( Ok( diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_http.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_http.snap index bd776f6c9d..f3d7e62a18 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_http.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_http.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys +snapshot_kind: text --- Valid( Ok( diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__non_value_template.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__non_value_template.snap index e01033b5f2..ac9c2be85a 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__non_value_template.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__non_value_template.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys +snapshot_kind: text --- Valid( Err( diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_merge.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_merge.snap index a1a1125ffd..b6d3d6b1e4 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_merge.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_merge.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys_a.merge_right(keys_b) +snapshot_kind: text --- Keys( { diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_set.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_set.snap index 0ca1900d8e..0ed08e9c59 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_set.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__keys__keys_set.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/subgraph.rs expression: keys +snapshot_kind: text --- Keys( { diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__nested_unions.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__nested_unions.snap index 86249a9b06..18998212fd 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__nested_unions.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__nested_unions.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/union_input_type.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__recursive_input.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__recursive_input.snap index 24fe5b9359..7f3f5cf94b 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__recursive_input.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__recursive_input.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/union_input_type.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server(port: 8000) @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union.snap index a50dc27104..7442ac7fcd 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/union_input_type.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union_in_type.snap b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union_in_type.snap index b27bbc7d60..bd9cf3d888 100644 --- a/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union_in_type.snap +++ b/src/core/config/transformer/snapshots/tailcall__core__config__transformer__union_input_type__tests__union_in_type.snap @@ -1,6 +1,7 @@ --- source: src/core/config/transformer/union_input_type.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/config/transformer/subgraph.rs b/src/core/config/transformer/subgraph.rs index 24eed1f86c..0d336d544f 100644 --- a/src/core/config/transformer/subgraph.rs +++ b/src/core/config/transformer/subgraph.rs @@ -275,7 +275,7 @@ impl KeysExtractor { Valid::from_iter( [ Self::parse_str(http.url.as_str()).trace("url"), - Self::parse_str_option(http.body.as_deref()).trace("body"), + Self::parse_json_option(http.body.as_ref()).trace("body"), Self::parse_key_value_iter(http.headers.iter()).trace("headers"), Self::parse_key_value_iter(http.query.iter().map(|q| KeyValue { key: q.key.to_string(), @@ -355,9 +355,9 @@ impl KeysExtractor { .map_to(keys) } - fn parse_str_option(s: Option<&str>) -> Valid { + fn parse_json_option(s: Option<&serde_json::Value>) -> Valid { if let Some(s) = s { - Self::parse_str(s) + Self::parse_str(&s.to_string()) } else { Valid::succeed(Keys::new()) } @@ -483,7 +483,9 @@ mod tests { fn test_extract_http() { let http = Http { url: "http://tailcall.run/users/{{.value.id}}".to_string(), - body: Some(r#"{ "obj": "{{.value.obj}}"} "#.to_string()), + body: Some(serde_json::Value::String( + r#"{ "obj": "{{.value.obj}}"} "#.to_string(), + )), headers: vec![KeyValue { key: "{{.value.header.key}}".to_string(), value: "{{.value.header.value}}".to_string(), diff --git a/src/core/config/transformer/union_input_type.rs b/src/core/config/transformer/union_input_type.rs index 906650dd6d..ca44f83141 100644 --- a/src/core/config/transformer/union_input_type.rs +++ b/src/core/config/transformer/union_input_type.rs @@ -285,13 +285,12 @@ mod tests { use tailcall_valid::Validator; use super::UnionInputType; - use crate::core::config::Config; use crate::core::transform::Transform; + use crate::include_config; #[test] fn test_union() { - let config = std::fs::read_to_string(tailcall_fixtures::configs::YAML_UNION).unwrap(); - let config = Config::from_yaml(&config).unwrap(); + let config = include_config!("./fixtures/union.graphql").unwrap(); let config = UnionInputType.transform(config).to_result().unwrap(); assert_snapshot!(config.to_sdl()); @@ -299,9 +298,7 @@ mod tests { #[test] fn test_union_in_type() { - let config = - std::fs::read_to_string(tailcall_fixtures::configs::YAML_UNION_IN_TYPE).unwrap(); - let config = Config::from_yaml(&config).unwrap(); + let config = include_config!("./fixtures/union-in-type.graphql").unwrap(); let config = UnionInputType.transform(config).to_result().unwrap(); assert_snapshot!(config.to_sdl()); @@ -309,18 +306,14 @@ mod tests { #[test] fn test_nested_unions() { - let config = - std::fs::read_to_string(tailcall_fixtures::configs::YAML_NESTED_UNIONS).unwrap(); - let config = Config::from_yaml(&config).unwrap(); + let config = include_config!("./fixtures/nested-unions.graphql").unwrap(); let config = UnionInputType.transform(config).to_result().unwrap(); assert_snapshot!(config.to_sdl()); } #[test] fn test_recursive_input() { - let config = - std::fs::read_to_string(tailcall_fixtures::configs::YAML_RECURSIVE_INPUT).unwrap(); - let config = Config::from_yaml(&config).unwrap(); + let config = include_config!("./fixtures/recursive-input.graphql").unwrap(); let config = UnionInputType.transform(config).to_result().unwrap(); assert_snapshot!(config.to_sdl()); diff --git a/src/core/document.rs b/src/core/document.rs index df70160b38..a65b307f7c 100644 --- a/src/core/document.rs +++ b/src/core/document.rs @@ -226,10 +226,20 @@ fn print_type_def(type_def: &TypeDefinition) -> String { fn print_enum_value(value: &async_graphql::parser::types::EnumValueDefinition) -> String { let directives_str = print_pos_directives(&value.directives); - if directives_str.is_empty() { + let variant_def = if directives_str.is_empty() { format!(" {}", value.value) } else { format!(" {} {}", value.value, directives_str) + }; + + if let Some(desc) = &value.description { + format!( + " \"\"\"\n {}\n \"\"\"\n{}", + desc.node.as_str(), + variant_def + ) + } else { + variant_def } } diff --git a/src/core/endpoint.rs b/src/core/endpoint.rs index d809096779..6099acec54 100644 --- a/src/core/endpoint.rs +++ b/src/core/endpoint.rs @@ -13,7 +13,7 @@ pub struct Endpoint { pub input: JsonSchema, pub output: JsonSchema, pub headers: HeaderMap, - pub body: Option, + pub body: Option, pub description: Option, pub encoding: Encoding, } diff --git a/src/core/generator/from_proto.rs b/src/core/generator/from_proto.rs index 93bc676a82..0a8b6f5c99 100644 --- a/src/core/generator/from_proto.rs +++ b/src/core/generator/from_proto.rs @@ -375,6 +375,7 @@ impl Context { method: field_name.id(), dedupe: None, select: None, + on_response_body: None, }) .into(); diff --git a/src/core/generator/generator.rs b/src/core/generator/generator.rs index 4a06071bbb..98cb81515e 100644 --- a/src/core/generator/generator.rs +++ b/src/core/generator/generator.rs @@ -8,6 +8,7 @@ use tailcall_valid::Validator; use url::Url; use super::from_proto::from_proto; +use super::proto::connect_rpc::ConnectRPC; use super::{FromJsonGenerator, NameGenerator, RequestSample, PREFIX}; use crate::core::config::{self, Config, ConfigModule, Link, LinkType}; use crate::core::http::Method; @@ -42,6 +43,7 @@ pub enum Input { Proto { url: String, metadata: ProtoMetadata, + connect_rpc: Option, }, Config { schema: String, @@ -133,9 +135,14 @@ impl Generator { config = config .merge_right(self.generate_from_json(&type_name_generator, &[req_sample])?); } - Input::Proto { metadata, url } => { - config = - config.merge_right(self.generate_from_proto(metadata, &self.query, url)?); + Input::Proto { metadata, url, connect_rpc } => { + let proto_config = self.generate_from_proto(metadata, &self.query, url)?; + let proto_config = if connect_rpc == &Some(true) { + ConnectRPC.transform(proto_config).to_result()? + } else { + proto_config + }; + config = config.merge_right(proto_config); } } } @@ -264,6 +271,7 @@ pub mod test { path: "../../../tailcall-fixtures/fixtures/protobuf/news.proto".to_string(), }, url: "http://localhost:50051".to_string(), + connect_rpc: None, }]) .generate(false)?; @@ -317,6 +325,7 @@ pub mod test { path: "../../../tailcall-fixtures/fixtures/protobuf/news.proto".to_string(), }, url: "http://localhost:50051".to_string(), + connect_rpc: None, }; // Config input diff --git a/src/core/generator/json/operation_generator.rs b/src/core/generator/json/operation_generator.rs index fe0aeb36aa..79bde56e71 100644 --- a/src/core/generator/json/operation_generator.rs +++ b/src/core/generator/json/operation_generator.rs @@ -41,7 +41,10 @@ impl OperationTypeGenerator { let arg_name_gen = NameGenerator::new(prefix.as_str()); let arg_name = arg_name_gen.next(); - http_resolver.body = Some(format!("{{{{.args.{}}}}}", arg_name)); + http_resolver.body = Some(serde_json::Value::String(format!( + "{{{{.args.{}}}}}", + arg_name + ))); http_resolver.method = request_sample.method.to_owned(); field.args.insert( diff --git a/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__append_field_if_operation_type_exists.snap b/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__append_field_if_operation_type_exists.snap index cb169612c6..6f5e577bdb 100644 --- a/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__append_field_if_operation_type_exists.snap +++ b/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__append_field_if_operation_type_exists.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/json/operation_generator.rs expression: config.to_sdl() +snapshot_kind: text --- type Query { post: Int diff --git a/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__mutation.snap b/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__mutation.snap index 68701229b8..0f5998c965 100644 --- a/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__mutation.snap +++ b/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__mutation.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/json/operation_generator.rs expression: config.to_sdl() +snapshot_kind: text --- input Input1 { body: String diff --git a/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__query.snap b/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__query.snap index 4cf288d906..b64367deb0 100644 --- a/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__query.snap +++ b/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__query.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/json/operation_generator.rs expression: config.to_sdl() +snapshot_kind: text --- type Query { postComments(postId: Int): T44 @http(url: "https://jsonplaceholder.typicode.com/comments", query: [{key: "postId", value: "{{.args.postId}}"}]) diff --git a/src/core/generator/proto/connect_rpc.rs b/src/core/generator/proto/connect_rpc.rs new file mode 100644 index 0000000000..14fb51243b --- /dev/null +++ b/src/core/generator/proto/connect_rpc.rs @@ -0,0 +1,176 @@ +use tailcall_valid::Valid; + +use crate::core::config::{Config, Grpc, Http, Resolver, ResolverSet}; +use crate::core::Transform; + +pub struct ConnectRPC; + +impl Transform for ConnectRPC { + type Value = Config; + type Error = String; + + fn transform(&self, mut config: Self::Value) -> Valid { + for type_ in config.types.values_mut() { + for field_ in type_.fields.values_mut() { + let new_resolvers = field_ + .resolvers + .0 + .iter() + .map(|resolver| match resolver { + Resolver::Grpc(grpc) => Resolver::Http(Http::from(grpc.clone())), + other => other.clone(), + }) + .collect(); + + field_.resolvers = ResolverSet(new_resolvers); + } + } + + Valid::succeed(config) + } +} + +impl From for Http { + fn from(grpc: Grpc) -> Self { + let url = grpc.url; + let body = grpc.body.or_else(|| { + // if body isn't present while transforming the resolver, we need to provide an + // empty object. + Some(serde_json::Value::Object(serde_json::Map::new())) + }); + + // remove the last + // method: package.service.method + // remove the method from the end. + let parts = grpc.method.split(".").collect::>(); + let method = parts[..parts.len() - 1].join(".").to_string(); + let endpoint = parts[parts.len() - 1].to_string(); + + let new_url = format!("{}/{}/{}", url, method, endpoint); + let headers = grpc.headers; + let batch_key = grpc.batch_key; + let dedupe = grpc.dedupe; + let select = grpc.select; + let on_response_body = grpc.on_response_body; + + Self { + url: new_url, + body, + method: crate::core::http::Method::POST, + headers, + batch_key, + dedupe, + select, + on_response_body, + ..Default::default() + } + } +} + +#[cfg(test)] +mod tests { + use serde_json::{json, Value}; + + use super::*; + use crate::core::config::KeyValue; + + #[test] + fn test_grpc_to_http_basic_conversion() { + let grpc = Grpc { + url: "http://localhost:8080".to_string(), + method: "package.service.method".to_string(), + body: Some(json!({"key": "value"})), + headers: Default::default(), + batch_key: Default::default(), + dedupe: Default::default(), + select: Default::default(), + on_response_body: Default::default(), + }; + + let http = Http::from(grpc); + + assert_eq!(http.url, "http://localhost:8080/package.service/method"); + assert_eq!(http.method, crate::core::http::Method::POST); + assert_eq!(http.body, Some(json!({"key": "value"}))); + } + + #[test] + fn test_grpc_to_http_empty_body() { + let grpc = Grpc { + url: "http://localhost:8080".to_string(), + method: "package.service.method".to_string(), + body: Default::default(), + headers: Default::default(), + batch_key: Default::default(), + dedupe: Default::default(), + select: Default::default(), + on_response_body: Default::default(), + }; + + let http = Http::from(grpc); + + assert_eq!(http.body, Some(json!({}))); + } + + #[test] + fn test_grpc_to_http_with_headers() { + let grpc = Grpc { + url: "http://localhost:8080".to_string(), + method: "a.b.c".to_string(), + body: None, + headers: vec![KeyValue { key: "X-Foo".to_string(), value: "bar".to_string() }], + batch_key: Default::default(), + dedupe: Default::default(), + select: Default::default(), + on_response_body: Default::default(), + }; + + let http = Http::from(grpc); + + assert_eq!(http.url, "http://localhost:8080/a.b/c"); + assert_eq!( + http.headers + .iter() + .find(|h| h.key == "X-Foo") + .unwrap() + .value, + "bar".to_string() + ); + assert_eq!(http.body, Some(json!({}))); + } + + #[test] + fn test_grpc_to_http_all_fields() { + let grpc = Grpc { + url: "http://localhost:8080".to_string(), + method: "package.service.method".to_string(), + body: Some(json!({"key": "value"})), + headers: vec![KeyValue { key: "X-Foo".to_string(), value: "bar".to_string() }], + batch_key: vec!["batch_key_value".to_string()], + dedupe: Some(true), + select: Some(Value::String("select_value".to_string())), + on_response_body: Some("on_response_body_value".to_string()), + }; + + let http = Http::from(grpc); + + assert_eq!(http.url, "http://localhost:8080/package.service/method"); + assert_eq!(http.method, crate::core::http::Method::POST); + assert_eq!(http.body, Some(json!({"key": "value"}))); + assert_eq!( + http.headers + .iter() + .find(|h| h.key == "X-Foo") + .unwrap() + .value, + "bar".to_string() + ); + assert_eq!(http.batch_key, vec!["batch_key_value".to_string()]); + assert_eq!(http.dedupe, Some(true)); + assert_eq!(http.select, Some(Value::String("select_value".to_string()))); + assert_eq!( + http.on_response_body, + Some("on_response_body_value".to_string()) + ); + } +} diff --git a/src/core/generator/proto/mod.rs b/src/core/generator/proto/mod.rs index c0a20dc3d4..f4ac9fa540 100644 --- a/src/core/generator/proto/mod.rs +++ b/src/core/generator/proto/mod.rs @@ -1,3 +1,4 @@ pub mod comments_builder; +pub mod connect_rpc; pub mod path_builder; pub mod path_field; diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_json__tests__generate_config_from_json.snap b/src/core/generator/snapshots/tailcall__core__generator__from_json__tests__generate_config_from_json.snap index 06b130ea6d..bc75c9bcac 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_json__tests__generate_config_from_json.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_json__tests__generate_config_from_json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_json.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["authorization"]) { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto.snap index e06e1948ea..19db0c9c07 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_pkg_file.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_pkg_file.snap index f78ccc36d7..703f167d26 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_pkg_file.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_pkg_file.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_service_file.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_service_file.snap index 61327c9de6..c5e16625bd 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_service_file.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_service_file.snap @@ -1,5 +1,6 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__greetings_proto_file.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__greetings_proto_file.snap index 8297302bf4..3326ca9904 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__greetings_proto_file.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__greetings_proto_file.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__map_types.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__map_types.snap index bad9a66493..d18fef56a9 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__map_types.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__map_types.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap index 1d23d60529..6902281cd0 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__nested_types.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__nested_types.snap index 6572244989..0371532223 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__nested_types.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__nested_types.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__oneof_types.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__oneof_types.snap index 395a63806f..30d734cef0 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__oneof_types.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__oneof_types.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__optional_fields.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__optional_fields.snap index 3fe01495f0..992573ee85 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__optional_fields.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__optional_fields.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__required_types.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__required_types.snap index bbc9e751a0..f464ef1652 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__required_types.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__required_types.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap index 025b8b84c6..fd9fa87cb6 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/from_proto.rs expression: result +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__generator__test__generate_from_config_from_multiple_jsons.snap b/src/core/generator/snapshots/tailcall__core__generator__generator__test__generate_from_config_from_multiple_jsons.snap index 820697c0fd..800f239813 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__generator__test__generate_from_config_from_multiple_jsons.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__generator__test__generate_from_config_from_multiple_jsons.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/generator.rs expression: cfg_module.config().to_sdl() +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["authorization"]) { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_combined_config.snap b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_combined_config.snap index 62d027c923..aec607ba25 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_combined_config.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_combined_config.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/generator.rs expression: cfg_module.config().to_sdl() +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream(allowedHeaders: ["authorization"], httpCache: 42) @link(src: "../../../tailcall-fixtures/fixtures/protobuf/news.proto", type: Protobuf) { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_configs.snap b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_configs.snap index 8d34015c98..9344a7758c 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_configs.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_configs.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/generator.rs expression: cfg_module.config().to_sdl() +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream(httpCache: 42) { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_json.snap b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_json.snap index bea2fb784c..80630b0c6f 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_json.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/generator.rs expression: cfg_module.config().to_sdl() +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["authorization"]) { query: Query diff --git a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_proto.snap b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_proto.snap index e4221c54d1..68c4560810 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_proto.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__generator__test__should_generate_config_from_proto.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/generator.rs expression: cfg_module.config().to_sdl() +snapshot_kind: text --- schema @server @upstream @link(src: "../../../tailcall-fixtures/fixtures/protobuf/news.proto", type: Protobuf) { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__add_cart.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__add_cart.json.snap index b9232784f8..c1abb2e4f0 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__add_cart.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__add_cart.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { mutation: Mutation diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__boolean.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__boolean.json.snap index c4ed346cad..3dda9a3375 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__boolean.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__boolean.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__create_post.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__create_post.json.snap index d1b65c95d2..5839562e6d 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__create_post.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__create_post.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { mutation: Mutation diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__create_product.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__create_product.json.snap index 0e363ab41f..d26de4a753 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__create_product.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__create_product.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { mutation: Mutation diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__create_user.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__create_user.json.snap index b80810870e..bd34fc682e 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__create_user.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__create_user.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { mutation: Mutation diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__empty_list.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__empty_list.json.snap index 9f26881c1c..fa92125727 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__empty_list.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__empty_list.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__generate_auth_token.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__generate_auth_token.json.snap index 072cbae6aa..8bdc0e7f3a 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__generate_auth_token.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__generate_auth_token.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { mutation: Mutation diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_properties.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_properties.json.snap index ec24b14514..1ed4e1ee63 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_properties.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_properties.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["authorization"]) { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_root_object.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_root_object.json.snap index efa94d5427..22e7b9b19b 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_root_object.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_root_object.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__list.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__list.json.snap index b84ac60e5e..d0863cf876 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__list.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__list.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__list_incompatible_object.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__list_incompatible_object.json.snap index 9b613c3e85..3210b6a15a 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__list_incompatible_object.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__list_incompatible_object.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__list_primitive_type.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__list_primitive_type.json.snap index 98d3e57a5c..7323efa93a 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__list_primitive_type.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__list_primitive_type.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__nested_list.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__nested_list.json.snap index 42dff08b2b..fba255d73a 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__nested_list.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__nested_list.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__nested_same_properties.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__nested_same_properties.json.snap index 01a562d70c..85243b122a 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__nested_same_properties.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__nested_same_properties.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__null.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__null.json.snap index b7f5063085..b1f2519807 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__null.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__null.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__number.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__number.json.snap index 303184bfcb..2df13ae08f 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__number.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__number.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/generator/tests/snapshots/json_to_config_spec__string.json.snap b/src/core/generator/tests/snapshots/json_to_config_spec__string.json.snap index 53f2406c26..2b68c0342e 100644 --- a/src/core/generator/tests/snapshots/json_to_config_spec__string.json.snap +++ b/src/core/generator/tests/snapshots/json_to_config_spec__string.json.snap @@ -1,6 +1,7 @@ --- source: src/core/generator/tests/json_to_config_spec.rs expression: cfg.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/http/data_loader.rs b/src/core/http/data_loader.rs index c5443d93fd..72d72c4a50 100644 --- a/src/core/http/data_loader.rs +++ b/src/core/http/data_loader.rs @@ -5,13 +5,17 @@ use std::time::Duration; use async_graphql::async_trait; use async_graphql::futures_util::future::join_all; use async_graphql_value::ConstValue; +use tailcall_valid::Validator; +use super::transformations::{BodyBatching, QueryBatching}; use crate::core::config::group_by::GroupBy; use crate::core::config::Batch; use crate::core::data_loader::{DataLoader, Loader}; use crate::core::http::{DataLoaderRequest, Response}; use crate::core::json::JsonLike; use crate::core::runtime::TargetRuntime; +use crate::core::transform::TransformerOps; +use crate::core::Transform; fn get_body_value_single(body_value: &HashMap>, id: &str) -> ConstValue { body_value @@ -35,19 +39,11 @@ fn get_body_value_list(body_value: &HashMap>, id: &str) pub struct HttpDataLoader { pub runtime: TargetRuntime, pub group_by: Option, - pub body: fn(&HashMap>, &str) -> ConstValue, + is_list: bool, } impl HttpDataLoader { pub fn new(runtime: TargetRuntime, group_by: Option, is_list: bool) -> Self { - HttpDataLoader { - runtime, - group_by, - body: if is_list { - get_body_value_list - } else { - get_body_value_single - }, - } + HttpDataLoader { runtime, group_by, is_list } } pub fn to_data_loader(self, batch: Batch) -> DataLoader { @@ -69,61 +65,86 @@ impl Loader for HttpDataLoader { if let Some(group_by) = &self.group_by { let query_name = group_by.key(); let mut dl_requests = keys.to_vec(); - - // Sort keys to build consistent URLs - // TODO: enable in tests only - dl_requests.sort_by(|a, b| a.to_request().url().cmp(b.to_request().url())); - - // Create base request - let mut request = dl_requests[0].to_request(); - let first_url = request.url_mut(); - - // Merge query params in the request - for key in &dl_requests[1..] { - let request = key.to_request(); - let url = request.url(); - let pairs: Vec<_> = url - .query_pairs() - .filter(|(key, _)| group_by.key().eq(&key.to_string())) - .collect(); - first_url.query_pairs_mut().extend_pairs(pairs); + if cfg!(debug_assertions) { + // Sort keys to build consistent URLs only in Testing environment. + dl_requests.sort_by(|a, b| a.to_request().url().cmp(b.to_request().url())); } - // Dispatch request - let res = self - .runtime - .http - .execute(request) - .await? - .to_json::()?; - - // Create a response HashMap - #[allow(clippy::mutable_key_type)] - let mut hashmap = HashMap::with_capacity(dl_requests.len()); - - // Parse the response body and group it by batchKey - let path = &group_by.path(); - - // ResponseMap contains the response body grouped by the batchKey - let response_map = res.body.group_by(path); - - // For each request and insert its corresponding value - for dl_req in dl_requests.iter() { - let url = dl_req.url(); - let query_set: HashMap<_, _> = url.query_pairs().collect(); - let id = query_set.get(query_name).ok_or(anyhow::anyhow!( - "Unable to find key {} in query params", - query_name - ))?; - - // Clone the response and set the body - let body = (self.body)(&response_map, id); - let res = res.clone().body(body); - - hashmap.insert(dl_req.clone(), res); + if let Some(base_dl_request) = dl_requests.first().as_mut() { + let base_request = if base_dl_request.method() == http::Method::GET { + QueryBatching::new( + &dl_requests.iter().skip(1).collect::>(), + Some(group_by.key()), + ) + .transform(base_dl_request.to_request()) + .to_result() + .map_err(|e| anyhow::anyhow!(e))? + } else { + QueryBatching::new(&dl_requests.iter().skip(1).collect::>(), None) + .pipe(BodyBatching::new(&dl_requests.iter().collect::>())) + .transform(base_dl_request.to_request()) + .to_result() + .map_err(|e| anyhow::anyhow!(e))? + }; + + // Dispatch request + let res = self + .runtime + .http + .execute(base_request) + .await? + .to_json::()?; + + // Create a response HashMap + #[allow(clippy::mutable_key_type)] + let mut hashmap = HashMap::with_capacity(dl_requests.len()); + + // Parse the response body and group it by batchKey + let path = &group_by.path(); + + // ResponseMap contains the response body grouped by the batchKey + let response_map = res.body.group_by(path); + + // depending on graphql type, it will extract the data out of the response. + let data_extractor = if self.is_list { + get_body_value_list + } else { + get_body_value_single + }; + + // For each request and insert its corresponding value + if base_dl_request.method() == reqwest::Method::GET { + for dl_req in dl_requests.iter() { + let url = dl_req.url(); + let query_set: HashMap<_, _> = url.query_pairs().collect(); + let id = query_set.get(query_name).ok_or(anyhow::anyhow!( + "Unable to find key {} in query params", + query_name + ))?; + + // Clone the response and set the body + let body = data_extractor(&response_map, id); + let res = res.clone().body(body); + + hashmap.insert(dl_req.clone(), res); + } + } else { + for dl_req in dl_requests.into_iter() { + let body_key = dl_req.batching_value().ok_or(anyhow::anyhow!( + "Unable to find batching value in the body for data loader request {}", + dl_req.url().as_str() + ))?; + let extracted_value = data_extractor(&response_map, body_key); + let res = res.clone().body(extracted_value); + hashmap.insert(dl_req.clone(), res); + } + } + + Ok(hashmap) + } else { + let error_message = "This is definitely a bug in http data loaders, please report it to the maintainers."; + Err(anyhow::anyhow!(error_message).into()) } - - Ok(hashmap) } else { let results = keys.iter().map(|key| async { let result = self.runtime.http.execute(key.to_request()).await; @@ -133,7 +154,7 @@ impl Loader for HttpDataLoader { let results = join_all(results).await; #[allow(clippy::mutable_key_type)] - let mut hashmap = HashMap::new(); + let mut hashmap = HashMap::with_capacity(results.len()); for (key, value) in results { hashmap.insert(key, value?.to_json()?); } diff --git a/src/core/http/data_loader_request.rs b/src/core/http/data_loader_request.rs index b386f8daea..4631fdd8a0 100644 --- a/src/core/http/data_loader_request.rs +++ b/src/core/http/data_loader_request.rs @@ -5,34 +5,48 @@ use std::ops::Deref; use tailcall_hasher::TailcallHasher; #[derive(Debug)] -pub struct DataLoaderRequest(reqwest::Request, BTreeSet); +pub struct DataLoaderRequest { + request: reqwest::Request, + headers: BTreeSet, + /// used for request body batching. + batching_value: Option, +} impl DataLoaderRequest { pub fn new(req: reqwest::Request, headers: BTreeSet) -> Self { // TODO: req should already have headers builtin, no? - DataLoaderRequest(req, headers) + Self { request: req, headers, batching_value: None } + } + + pub fn with_batching_value(self, body: Option) -> Self { + Self { batching_value: body, ..self } } + + pub fn batching_value(&self) -> Option<&String> { + self.batching_value.as_ref() + } + pub fn to_request(&self) -> reqwest::Request { // TODO: excessive clone for the whole structure instead of cloning only part of // it check if we really need to clone anything at all or just pass // references? - self.clone().0 + self.clone().request } pub fn headers(&self) -> &BTreeSet { - &self.1 + &self.headers } } impl Hash for DataLoaderRequest { fn hash(&self, state: &mut H) { - self.0.url().hash(state); + self.request.url().hash(state); // use body in hash for graphql queries with query operation as they used to // fetch data while http post and graphql mutation should not be loaded // through dataloader at all! - if let Some(body) = self.0.body() { + if let Some(body) = self.request.body() { body.as_bytes().hash(state); } - for name in &self.1 { - if let Some(value) = self.0.headers().get(name) { + for name in &self.headers { + if let Some(value) = self.request.headers().get(name) { name.hash(state); value.hash(state); } @@ -58,13 +72,15 @@ impl Eq for DataLoaderRequest {} impl Clone for DataLoaderRequest { fn clone(&self) -> Self { - let req = self.0.try_clone().unwrap_or_else(|| { - let mut req = reqwest::Request::new(self.0.method().clone(), self.0.url().clone()); - req.headers_mut().extend(self.0.headers().clone()); + let req = self.request.try_clone().unwrap_or_else(|| { + let mut req = + reqwest::Request::new(self.request.method().clone(), self.request.url().clone()); + req.headers_mut().extend(self.request.headers().clone()); req }); - DataLoaderRequest(req, self.1.clone()) + DataLoaderRequest::new(req, self.headers.clone()) + .with_batching_value(self.batching_value.clone()) } } @@ -72,7 +88,7 @@ impl Deref for DataLoaderRequest { type Target = reqwest::Request; fn deref(&self) -> &Self::Target { - &self.0 + &self.request } } diff --git a/src/core/http/mod.rs b/src/core/http/mod.rs index 69967ed098..816f0fcb70 100644 --- a/src/core/http/mod.rs +++ b/src/core/http/mod.rs @@ -1,7 +1,7 @@ pub use cache::*; pub use data_loader::*; pub use data_loader_request::*; -use http::header::HeaderValue; +use http::HeaderValue; pub use method::Method; pub use query_encoder::QueryEncoder; pub use request_context::RequestContext; @@ -20,19 +20,7 @@ mod request_template; mod response; pub mod showcase; mod telemetry; +mod transformations; pub static TAILCALL_HTTPS_ORIGIN: HeaderValue = HeaderValue::from_static("https://tailcall.run"); pub static TAILCALL_HTTP_ORIGIN: HeaderValue = HeaderValue::from_static("http://tailcall.run"); - -#[derive(Default, Clone, Debug)] -/// User can configure the filter/interceptor -/// for the http requests. -pub struct HttpFilter { - pub on_request: String, -} - -impl HttpFilter { - pub fn new(on_request: &str) -> Self { - HttpFilter { on_request: on_request.to_owned() } - } -} diff --git a/src/core/http/request_template.rs b/src/core/http/request_template.rs index 748cd395a1..1c57f140db 100644 --- a/src/core/http/request_template.rs +++ b/src/core/http/request_template.rs @@ -12,6 +12,7 @@ use crate::core::endpoint::Endpoint; use crate::core::has_headers::HasHeaders; use crate::core::helpers::headers::MustacheHeaders; use crate::core::ir::model::{CacheKey, IoId}; +use crate::core::ir::DynamicRequest; use crate::core::mustache::{Eval, Mustache, Segment}; use crate::core::path::{PathString, PathValue, ValueString}; @@ -91,7 +92,7 @@ impl RequestTemplate { /// Returns true if there are not templates pub fn is_const(&self) -> bool { self.root_url.is_const() - && self.body_path.as_ref().map_or(true, Mustache::is_const) + && self.body_path.as_ref().map_or(true, |b| b.is_const()) && self.query.iter().all(|query| query.value.is_const()) && self.headers.iter().all(|(_, v)| v.is_const()) } @@ -113,15 +114,12 @@ impl RequestTemplate { pub fn to_request( &self, ctx: &C, - ) -> anyhow::Result { - // Create url + ) -> anyhow::Result> { let url = self.create_url(ctx)?; let method = self.method.clone(); - let mut req = reqwest::Request::new(method, url); - req = self.set_headers(req, ctx); - req = self.set_body(req, ctx)?; - - Ok(req) + let req = reqwest::Request::new(method, url); + let req = self.set_headers(req, ctx); + self.set_body(req, ctx) } /// Sets the body for the request @@ -129,26 +127,32 @@ impl RequestTemplate { &self, mut req: reqwest::Request, ctx: &C, - ) -> anyhow::Result { - if let Some(body_path) = &self.body_path { + ) -> anyhow::Result> { + let batching_value = if let Some(body_path) = &self.body_path { match &self.encoding { Encoding::ApplicationJson => { - req.body_mut().replace(body_path.render(ctx).into()); + let (body, batching_value) = + ExpressionValueEval::default().eval(body_path, ctx); + req.body_mut().replace(body.into()); + batching_value } Encoding::ApplicationXWwwFormUrlencoded => { // TODO: this is a performance bottleneck // We first encode everything to string and then back to form-urlencoded - let body: String = body_path.render(ctx); + let body = body_path.render(ctx); let form_data = match serde_json::from_str::(&body) { Ok(deserialized_data) => serde_urlencoded::to_string(deserialized_data)?, Err(_) => body, }; req.body_mut().replace(form_data.into()); + None } } - } - Ok(req) + } else { + None + }; + Ok(DynamicRequest::new(req).with_batching_value(batching_value)) } /// Sets the headers for the request @@ -231,7 +235,7 @@ impl TryFrom for RequestTemplate { let body = endpoint .body .as_ref() - .map(|body| Mustache::parse(body.as_str())); + .map(|b| Mustache::parse(&b.to_string())); let encoding = endpoint.encoding.clone(); Ok(Self { @@ -302,6 +306,50 @@ impl<'a, A: PathValue> Eval<'a> for ValueStringEval { } } +struct ExpressionValueEval(std::marker::PhantomData); +impl Default for ExpressionValueEval { + fn default() -> Self { + Self(std::marker::PhantomData) + } +} + +impl<'a, A: PathString> Eval<'a> for ExpressionValueEval { + type In = A; + type Out = (String, Option); + + fn eval(&self, mustache: &Mustache, in_value: &'a Self::In) -> Self::Out { + let mut result = String::new(); + // This evaluator returns a tuple of (evaluated_string, body_key) where: + // 1. evaluated_string: The fully rendered template string + // 2. body_key: The value of the first expression found in the template + // + // This implementation is a critical optimization for request batching: + // - During batching, we need to extract individual request values from the + // batch response and map them back to their original requests + // - Instead of parsing the body JSON multiple times, we extract the key during + // initial template evaluation + // - Since we enforce that batch requests can only contain one expression in + // their body, this key uniquely identifies each request + // - This approach eliminates the need for repeated JSON parsing/serialization + // during the batching process, significantly improving performance + let mut first_expression_value = None; + for segment in mustache.segments().iter() { + match segment { + Segment::Literal(text) => result.push_str(text), + Segment::Expression(parts) => { + if let Some(value) = in_value.path_string(parts) { + result.push_str(value.as_ref()); + if first_expression_value.is_none() { + first_expression_value = Some(value.into_owned()); + } + } + } + } + } + (result, first_expression_value) + } +} + #[cfg(test)] mod tests { use std::borrow::Cow; @@ -361,6 +409,7 @@ mod tests { ) -> anyhow::Result { let body = self .to_request(ctx)? + .into_request() .body() .and_then(|a| a.as_bytes()) .map(|a| a.to_vec()) @@ -398,8 +447,8 @@ mod tests { } })); - let req = tmpl.to_request(&ctx).unwrap(); - + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!( req.url().to_string(), "http://localhost:3000/?baz=1&baz=2&baz=3&foo=12" @@ -410,7 +459,8 @@ mod tests { fn test_url() { let tmpl = RequestTemplate::new("http://localhost:3000/").unwrap(); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.url().to_string(), "http://localhost:3000/"); } @@ -418,7 +468,8 @@ mod tests { fn test_url_path() { let tmpl = RequestTemplate::new("http://localhost:3000/foo/bar").unwrap(); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.url().to_string(), "http://localhost:3000/foo/bar"); } @@ -431,7 +482,8 @@ mod tests { } })); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.url().to_string(), "http://localhost:3000/foo/bar"); } @@ -446,7 +498,9 @@ mod tests { "booz": 1 } })); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); + assert_eq!( req.url().to_string(), "http://localhost:3000/foo/bar/boozes/1" @@ -472,11 +526,15 @@ mod tests { skip_empty: false, }, ]; + let tmpl = RequestTemplate::new("http://localhost:3000") .unwrap() .query(query); + let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); + assert_eq!( req.url().to_string(), "http://localhost:3000/?foo=0&bar=1&baz=2" @@ -513,7 +571,8 @@ mod tests { "id": 2 } })); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!( req.url().to_string(), "http://localhost:3000/?foo=0&bar=1&baz=2" @@ -531,7 +590,8 @@ mod tests { .unwrap() .headers(headers); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.headers().get("foo").unwrap(), "foo"); assert_eq!(req.headers().get("bar").unwrap(), "bar"); assert_eq!(req.headers().get("baz").unwrap(), "baz"); @@ -561,7 +621,8 @@ mod tests { "id": 2 } })); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.headers().get("foo").unwrap(), "0"); assert_eq!(req.headers().get("bar").unwrap(), "1"); assert_eq!(req.headers().get("baz").unwrap(), "2"); @@ -574,7 +635,8 @@ mod tests { .method(reqwest::Method::POST) .encoding(crate::core::config::Encoding::ApplicationJson); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!( req.headers().get("Content-Type").unwrap(), "application/json" @@ -588,7 +650,8 @@ mod tests { .method(reqwest::Method::POST) .encoding(crate::core::config::Encoding::ApplicationXWwwFormUrlencoded); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!( req.headers().get("Content-Type").unwrap(), "application/x-www-form-urlencoded" @@ -601,7 +664,8 @@ mod tests { .unwrap() .method(reqwest::Method::POST); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.method(), reqwest::Method::POST); } @@ -662,11 +726,12 @@ mod tests { .body(Some("foo".into())); let tmpl = RequestTemplate::try_from(endpoint).unwrap(); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let req_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = req_wrapper.request(); assert_eq!(req.method(), reqwest::Method::POST); assert_eq!(req.headers().get("foo").unwrap(), "bar"); let body = req.body().unwrap().as_bytes().unwrap().to_owned(); - assert_eq!(body, "foo".as_bytes()); + assert_eq!(body, "\"foo\"".as_bytes()); assert_eq!(req.url().to_string(), "http://localhost:3000/"); } @@ -688,7 +753,8 @@ mod tests { "header": "abc" } })); - let req = tmpl.to_request(&ctx).unwrap(); + let req_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = req_wrapper.request(); assert_eq!(req.method(), reqwest::Method::POST); assert_eq!(req.headers().get("foo").unwrap(), "abc"); let body = req.body().unwrap().as_bytes().unwrap().to_owned(); @@ -703,7 +769,8 @@ mod tests { ); let tmpl = RequestTemplate::try_from(endpoint).unwrap(); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.url().to_string(), "http://localhost:3000/"); } @@ -718,7 +785,8 @@ mod tests { ]); let tmpl = RequestTemplate::try_from(endpoint).unwrap(); let ctx = Context::default(); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.url().to_string(), "http://localhost:3000/?q=1&b=1&c"); } @@ -734,7 +802,8 @@ mod tests { "d": "bar" } })); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!( req.url().to_string(), "http://localhost:3000/foo?b=foo&d=bar" @@ -758,7 +827,8 @@ mod tests { "d": "bar", } })); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!( req.url().to_string(), "http://localhost:3000/foo?b=foo&d=bar&f=baz&e" @@ -773,7 +843,8 @@ mod tests { let mut headers = HeaderMap::new(); headers.insert("baz", "qux".parse().unwrap()); let ctx = Context::default().headers(headers); - let req = tmpl.to_request(&ctx).unwrap(); + let request_wrapper = tmpl.to_request(&ctx).unwrap(); + let req = request_wrapper.request(); assert_eq!(req.headers().get("baz").unwrap(), "qux"); } } @@ -790,7 +861,8 @@ mod tests { let tmpl = RequestTemplate::form_encoded_url("http://localhost:3000") .unwrap() .body_path(Some(Mustache::parse("{{foo.bar}}"))); - let ctx = Context::default().value(json!({"foo": {"bar": "baz"}})); + let ctx = Context::default().value(json!({"foo": {"bar": + "baz"}})); let request_body = tmpl.to_body(&ctx); let body = request_body.unwrap(); assert_eq!(body, "baz"); diff --git a/src/core/http/transformations/body_batching.rs b/src/core/http/transformations/body_batching.rs new file mode 100644 index 0000000000..173b776546 --- /dev/null +++ b/src/core/http/transformations/body_batching.rs @@ -0,0 +1,248 @@ +use std::convert::Infallible; + +use reqwest::Request; +use tailcall_valid::Valid; + +use crate::core::http::DataLoaderRequest; +use crate::core::Transform; + +pub struct BodyBatching<'a> { + dl_requests: &'a [&'a DataLoaderRequest], +} + +impl<'a> BodyBatching<'a> { + pub fn new(dl_requests: &'a [&'a DataLoaderRequest]) -> Self { + BodyBatching { dl_requests } + } +} + +impl Transform for BodyBatching<'_> { + type Value = Request; + type Error = Infallible; + + // This function is used to batch the body of the requests. + // working of this function is as follows: + // 1. It takes the list of requests and extracts the body from each request. + // 2. It then clubs all the extracted bodies into list format. like [body1, + // body2, body3] + // 3. It does this all manually to avoid extra serialization cost. + fn transform(&self, mut base_request: Self::Value) -> Valid { + let mut request_bodies = Vec::with_capacity(self.dl_requests.len()); + + for req in self.dl_requests { + if let Some(body) = req.body().and_then(|b| b.as_bytes()) { + request_bodies.push(body); + } + } + + if !request_bodies.is_empty() { + if cfg!(debug_assertions) { + // sort the body to make it consistent for testing env. + request_bodies.sort(); + } + + // construct serialization manually. + let merged_body = request_bodies.iter().fold( + Vec::with_capacity( + request_bodies.iter().map(|i| i.len()).sum::() + request_bodies.len(), + ), + |mut acc, item| { + if !acc.is_empty() { + // add ',' to separate the body from each other. + acc.extend_from_slice(b","); + } + acc.extend_from_slice(item); + acc + }, + ); + + // add list brackets to the serialized body. + let mut serialized_body = Vec::with_capacity(merged_body.len() + 2); + serialized_body.extend_from_slice(b"["); + serialized_body.extend_from_slice(&merged_body); + serialized_body.extend_from_slice(b"]"); + base_request.body_mut().replace(serialized_body.into()); + } + + Valid::succeed(base_request) + } +} + +#[cfg(test)] +mod tests { + use http::Method; + use reqwest::Request; + use serde_json::json; + use tailcall_valid::Validator; + + use super::*; + use crate::core::http::DataLoaderRequest; + + fn create_request(body: Option) -> DataLoaderRequest { + let mut request = create_base_request(); + if let Some(body) = body { + let bytes_body = serde_json::to_vec(&body).unwrap(); + request.body_mut().replace(reqwest::Body::from(bytes_body)); + } + + DataLoaderRequest::new(request, Default::default()) + } + + fn create_base_request() -> Request { + Request::new(Method::POST, "http://example.com".parse().unwrap()) + } + + #[test] + fn test_empty_requests() { + let requests: Vec<&DataLoaderRequest> = vec![]; + let base_request = create_base_request(); + + let result = BodyBatching::new(&requests) + .transform(base_request) + .to_result() + .unwrap(); + + assert!(result.body().is_none()); + } + + #[test] + fn test_single_request() { + let req = create_request(Some(json!({"id": 1}))); + let requests = vec![&req]; + let base_request = create_base_request(); + + let request = BodyBatching::new(&requests) + .transform(base_request) + .to_result() + .unwrap(); + + let bytes = request + .body() + .and_then(|b| b.as_bytes()) + .unwrap_or_default(); + let body_str = String::from_utf8(bytes.to_vec()).unwrap(); + assert_eq!(body_str, r#"[{"id":1}]"#); + } + + #[test] + fn test_multiple_requests() { + let req1 = create_request(Some(json!({"id": 1}))); + let req2 = create_request(Some(json!({"id": 2}))); + let requests = vec![&req1, &req2]; + let base_request = create_base_request(); + + let result = BodyBatching::new(&requests) + .transform(base_request) + .to_result() + .unwrap(); + + let body = result.body().and_then(|b| b.as_bytes()).unwrap(); + let body_str = String::from_utf8(body.to_vec()).unwrap(); + assert_eq!(body_str, r#"[{"id":1},{"id":2}]"#); + } + + #[test] + fn test_requests_with_empty_bodies() { + let req1 = create_request(Some(json!({"id": 1}))); + let req2 = create_request(None); + let req3 = create_request(Some(json!({"id": 3}))); + let requests = vec![&req1, &req2, &req3]; + let base_request = create_base_request(); + + let result = BodyBatching::new(&requests) + .transform(base_request) + .to_result() + .unwrap(); + + let body_bytes = result + .body() + .and_then(|b| b.as_bytes()) + .expect("Body should be present"); + let parsed: Vec = serde_json::from_slice(body_bytes).unwrap(); + + assert_eq!(parsed.len(), 2); + assert_eq!(parsed[0]["id"], 1); + assert_eq!(parsed[1]["id"], 3); + } + + #[test] + #[cfg(test)] + fn test_body_sorting_in_test_env() { + let req1 = create_request(Some(json!({ + "id": 2, + "value": "second" + }))); + let req2 = create_request(Some(json!({ + "id": 1, + "value": "first" + }))); + let requests = vec![&req1, &req2]; + let base_request = create_base_request(); + + let result = BodyBatching::new(&requests) + .transform(base_request) + .to_result() + .unwrap(); + + let body_bytes = result + .body() + .and_then(|b| b.as_bytes()) + .expect("Body should be present"); + let parsed: Vec = serde_json::from_slice(body_bytes).unwrap(); + + // Verify sorting by comparing the serialized form + assert_eq!(parsed.len(), 2); + assert_eq!(parsed[0]["id"], 1); + assert_eq!(parsed[0]["value"], "first"); + assert_eq!(parsed[1]["id"], 2); + assert_eq!(parsed[1]["value"], "second"); + } + + #[test] + fn test_complex_json_bodies() { + let req1 = create_request(Some(json!({ + "id": 1, + "nested": { + "array": [1, 2, 3], + "object": {"key": "value"} + }, + "tags": ["a", "b", "c"] + }))); + let req2 = create_request(Some(json!({ + "id": 2, + "nested": { + "array": [4, 5, 6], + "object": {"key": "another"} + }, + "tags": ["x", "y", "z"] + }))); + let requests = vec![&req1, &req2]; + let base_request = create_base_request(); + + let result = BodyBatching::new(&requests) + .transform(base_request) + .to_result() + .unwrap(); + + let body_bytes = result + .body() + .and_then(|b| b.as_bytes()) + .expect("Body should be present"); + let parsed: Vec = serde_json::from_slice(body_bytes).unwrap(); + + // Verify structure and content of both objects + assert_eq!(parsed.len(), 2); + + // First object + assert_eq!(parsed[0]["id"], 1); + assert_eq!(parsed[0]["nested"]["array"], json!([1, 2, 3])); + assert_eq!(parsed[0]["nested"]["object"]["key"], "value"); + assert_eq!(parsed[0]["tags"], json!(["a", "b", "c"])); + + // Second object + assert_eq!(parsed[1]["id"], 2); + assert_eq!(parsed[1]["nested"]["array"], json!([4, 5, 6])); + assert_eq!(parsed[1]["nested"]["object"]["key"], "another"); + assert_eq!(parsed[1]["tags"], json!(["x", "y", "z"])); + } +} diff --git a/src/core/http/transformations/mod.rs b/src/core/http/transformations/mod.rs new file mode 100644 index 0000000000..b6ab71810c --- /dev/null +++ b/src/core/http/transformations/mod.rs @@ -0,0 +1,5 @@ +mod body_batching; +mod query_batching; + +pub use body_batching::BodyBatching; +pub use query_batching::QueryBatching; diff --git a/src/core/http/transformations/query_batching.rs b/src/core/http/transformations/query_batching.rs new file mode 100644 index 0000000000..1612608388 --- /dev/null +++ b/src/core/http/transformations/query_batching.rs @@ -0,0 +1,200 @@ +use std::convert::Infallible; + +use reqwest::Request; +use tailcall_valid::Valid; + +use crate::core::http::DataLoaderRequest; +use crate::core::Transform; + +pub struct QueryBatching<'a> { + dl_requests: &'a [&'a DataLoaderRequest], + group_by: Option<&'a str>, +} + +impl<'a> QueryBatching<'a> { + pub fn new(dl_requests: &'a [&'a DataLoaderRequest], group_by: Option<&'a str>) -> Self { + QueryBatching { dl_requests, group_by } + } +} + +impl Transform for QueryBatching<'_> { + type Value = Request; + type Error = Infallible; + fn transform(&self, mut base_request: Self::Value) -> Valid { + // Merge query params in the request + for key in self.dl_requests.iter() { + let request = key.to_request(); + let url = request.url(); + let pairs: Vec<_> = if let Some(group_by_key) = self.group_by { + url.query_pairs() + .filter(|(key, _)| group_by_key.eq(&key.to_string())) + .collect() + } else { + url.query_pairs().collect() + }; + + if !pairs.is_empty() { + // if pair's are empty then don't extend the query params else it ends + // up appending '?' to the url. + base_request.url_mut().query_pairs_mut().extend_pairs(pairs); + } + } + Valid::succeed(base_request) + } +} + +#[cfg(test)] +mod tests { + use std::collections::HashMap; + + use http::Method; + use reqwest::Url; + use tailcall_valid::Validator; + + use super::*; + + fn create_base_request() -> Request { + Request::new(Method::GET, "http://example.com".parse().unwrap()) + } + + fn create_request_with_params(params: &[(&str, &str)]) -> DataLoaderRequest { + let mut url = Url::parse("http://example.com").unwrap(); + { + let mut query_pairs = url.query_pairs_mut(); + for (key, value) in params { + query_pairs.append_pair(key, value); + } + } + let request = Request::new(Method::GET, url); + DataLoaderRequest::new(request, Default::default()) + } + + fn get_query_params(request: &Request) -> HashMap { + request + .url() + .query_pairs() + .map(|(k, v)| (k.to_string(), v.to_string())) + .collect() + } + + #[test] + fn test_empty_requests() { + let requests: Vec<&DataLoaderRequest> = vec![]; + let base_request = create_base_request(); + + let result = QueryBatching::new(&requests, None) + .transform(base_request) + .to_result() + .unwrap(); + + assert!(result.url().query().is_none()); + } + + #[test] + fn test_single_request_no_grouping() { + let req = create_request_with_params(&[("id", "1"), ("name", "test")]); + let requests = vec![&req]; + let base_request = create_base_request(); + + let result = QueryBatching::new(&requests, None) + .transform(base_request) + .to_result() + .unwrap(); + + let params = get_query_params(&result); + assert_eq!(params.len(), 2); + assert_eq!(params.get("id").unwrap(), "1"); + assert_eq!(params.get("name").unwrap(), "test"); + } + + #[test] + fn test_multiple_requests_with_grouping() { + let req1 = create_request_with_params(&[("user_id", "1"), ("extra", "data1")]); + let req2 = create_request_with_params(&[("user_id", "2"), ("extra", "data2")]); + let requests = vec![&req1, &req2]; + let base_request = create_base_request(); + + let result = QueryBatching::new(&requests, Some("user_id")) + .transform(base_request) + .to_result() + .unwrap(); + + let params = get_query_params(&result); + assert!(params.contains_key("user_id")); + assert!(!params.contains_key("extra")); + + // URL should contain both user_ids + let url = result.url().to_string(); + assert!(url.contains("user_id=1")); + assert!(url.contains("user_id=2")); + } + + #[test] + fn test_multiple_requests_no_grouping() { + let req1 = create_request_with_params(&[("param1", "value1"), ("shared", "a")]); + let req2 = create_request_with_params(&[("param2", "value2"), ("shared", "b")]); + let requests = vec![&req1, &req2]; + let base_request = create_base_request(); + + let result = QueryBatching::new(&requests, None) + .transform(base_request) + .to_result() + .unwrap(); + + let params = get_query_params(&result); + assert_eq!(params.get("param1").unwrap(), "value1"); + assert_eq!(params.get("param2").unwrap(), "value2"); + assert_eq!(params.get("shared").unwrap(), "b"); + } + + #[test] + fn test_requests_with_empty_params() { + let req1 = create_request_with_params(&[("id", "1")]); + let req2 = create_request_with_params(&[]); + let req3 = create_request_with_params(&[("id", "3")]); + let requests = vec![&req1, &req2, &req3]; + let base_request = create_base_request(); + + let result = QueryBatching::new(&requests, Some("id")) + .transform(base_request) + .to_result() + .unwrap(); + + let url = result.url().to_string(); + assert!(url.contains("id=1")); + assert!(url.contains("id=3")); + } + + #[test] + fn test_special_characters() { + let req1 = create_request_with_params(&[("query", "hello world"), ("tag", "a+b")]); + let req2 = create_request_with_params(&[("query", "foo&bar"), ("tag", "c%20d")]); + let requests = vec![&req1, &req2]; + let base_request = create_base_request(); + + let result = QueryBatching::new(&requests, None) + .transform(base_request) + .to_result() + .unwrap(); + + let params = get_query_params(&result); + // Verify URL encoding is preserved + assert!(params.values().any(|v| v.contains(" ") || v.contains("&"))); + } + + #[test] + fn test_group_by_with_missing_key() { + let req1 = create_request_with_params(&[("id", "1"), ("data", "test")]); + let req2 = create_request_with_params(&[("other", "2"), ("data", "test2")]); + let requests = vec![&req1, &req2]; + let base_request = create_base_request(); + + let result = QueryBatching::new(&requests, Some("missing_key")) + .transform(base_request) + .to_result() + .unwrap(); + + // Should have no query parameters since grouped key doesn't exist + assert!(result.url().query().is_none()); + } +} diff --git a/src/core/ir/eval_http.rs b/src/core/ir/eval_http.rs index c69b73c0ed..d863472fbd 100644 --- a/src/core/ir/eval_http.rs +++ b/src/core/ir/eval_http.rs @@ -5,18 +5,39 @@ use reqwest::Request; use tailcall_valid::Validator; use super::model::DataLoaderId; +use super::request::DynamicRequest; use super::{EvalContext, ResolverContextLike}; use crate::core::data_loader::{DataLoader, Loader}; use crate::core::grpc::protobuf::ProtobufOperation; use crate::core::grpc::request::execute_grpc_request; use crate::core::grpc::request_template::RenderedRequestTemplate; use crate::core::http::{ - cache_policy, DataLoaderRequest, HttpDataLoader, HttpFilter, RequestTemplate, Response, + cache_policy, DataLoaderRequest, HttpDataLoader, RequestTemplate, Response, }; use crate::core::ir::Error; use crate::core::json::JsonLike; +use crate::core::worker_hooks::WorkerHooks; use crate::core::{grpc, http, worker, WorkerIO}; +pub struct WorkerContext<'a> { + pub worker: &'a Arc>, + pub js_worker: + &'a Arc>, + pub js_hooks: &'a WorkerHooks, +} + +impl<'a> WorkerContext<'a> { + pub fn new( + worker: &'a Arc>, + js_worker: &'a Arc< + dyn WorkerIO, + >, + js_hooks: &'a WorkerHooks, + ) -> Self { + Self { worker, js_worker, js_hooks } + } +} + /// /// Executing a HTTP request is a bit more complex than just sending a request /// and getting a response. There are optimizations and customizations that the @@ -48,15 +69,18 @@ impl<'a, 'ctx, Context: ResolverContextLike + Sync> EvalHttp<'a, 'ctx, Context> Self { evaluation_ctx, data_loader, request_template } } - pub fn init_request(&self) -> Result { - Ok(self.request_template.to_request(self.evaluation_ctx)?) + pub fn init_request(&self) -> Result, Error> { + let inner = self.request_template.to_request(self.evaluation_ctx)?; + Ok(inner) } - pub async fn execute(&self, req: Request) -> Result, Error> { + pub async fn execute( + &self, + req: DynamicRequest, + ) -> Result, Error> { let ctx = &self.evaluation_ctx; - let is_get = req.method() == reqwest::Method::GET; let dl = &self.data_loader; - let response = if is_get && dl.is_some() { + let response = if dl.is_some() { execute_request_with_dl(ctx, req, self.data_loader).await? } else { execute_raw_request(ctx, req).await? @@ -77,21 +101,20 @@ impl<'a, 'ctx, Context: ResolverContextLike + Sync> EvalHttp<'a, 'ctx, Context> } #[async_recursion::async_recursion] - pub async fn execute_with_worker( + pub async fn execute_with_worker<'worker: 'async_recursion>( &self, - mut request: reqwest::Request, - worker: &Arc>, - http_filter: &HttpFilter, + mut request: DynamicRequest, + worker_ctx: WorkerContext<'worker>, ) -> Result, Error> { - let js_request = worker::WorkerRequest::try_from(&request)?; - let event = worker::Event::Request(js_request); - - let command = worker.call(&http_filter.on_request, event).await?; + // extract variables from the worker context. + let js_hooks = worker_ctx.js_hooks; + let worker = worker_ctx.worker; + let js_worker = worker_ctx.js_worker; - match command { + let response = match js_hooks.on_request(worker, request.request()).await? { Some(command) => match command { worker::Command::Request(w_request) => { - let response = self.execute(w_request.into()).await?; + let response = self.execute(w_request.try_into()?).await?; Ok(response) } worker::Command::Response(w_response) => { @@ -100,15 +123,23 @@ impl<'a, 'ctx, Context: ResolverContextLike + Sync> EvalHttp<'a, 'ctx, Context> && w_response.headers().contains_key("location") { request + .request_mut() .url_mut() .set_path(w_response.headers()["location"].as_str()); - self.execute_with_worker(request, worker, http_filter).await + self.execute_with_worker(request, worker_ctx).await } else { Ok(w_response.try_into()?) } } }, None => self.execute(request).await, + }; + + // send the final response to JS script for futher evaluation. + if let Ok(resp) = response { + js_hooks.on_response(js_worker, resp).await + } else { + response } } } @@ -119,7 +150,7 @@ pub async fn execute_request_with_dl< Dl: Loader, Error = Arc>, >( ctx: &EvalContext<'ctx, Ctx>, - req: Request, + req: DynamicRequest, data_loader: Option<&DataLoader>, ) -> Result, Error> { let headers = ctx @@ -129,7 +160,10 @@ pub async fn execute_request_with_dl< .clone() .map(|s| s.headers) .unwrap_or_default(); - let endpoint_key = crate::core::http::DataLoaderRequest::new(req, headers); + + let (req, batching_value) = req.into_parts(); + let endpoint_key = + crate::core::http::DataLoaderRequest::new(req, headers).with_batching_value(batching_value); Ok(data_loader .unwrap() @@ -177,13 +211,13 @@ fn set_cookie_headers( pub async fn execute_raw_request( ctx: &EvalContext<'_, Ctx>, - req: Request, + req: DynamicRequest, ) -> Result, Error> { let response = ctx .request_ctx .runtime .http - .execute(req) + .execute(req.into_request()) .await .map_err(Error::from)? .to_json()?; diff --git a/src/core/ir/eval_io.rs b/src/core/ir/eval_io.rs index 3a29d1daff..f9ef59b3da 100644 --- a/src/core/ir/eval_io.rs +++ b/src/core/ir/eval_io.rs @@ -2,10 +2,10 @@ use async_graphql_value::ConstValue; use super::eval_http::{ execute_grpc_request_with_dl, execute_raw_grpc_request, execute_raw_request, - execute_request_with_dl, parse_graphql_response, set_headers, EvalHttp, + execute_request_with_dl, parse_graphql_response, set_headers, EvalHttp, WorkerContext, }; use super::model::{CacheKey, IO}; -use super::{EvalContext, ResolverContextLike}; +use super::{DynamicRequest, EvalContext, ResolverContextLike}; use crate::core::config::GraphQLOperationType; use crate::core::data_loader::DataLoader; use crate::core::graphql::GraphqlDataLoader; @@ -45,15 +45,15 @@ where Ctx: ResolverContextLike + Sync, { match io { - IO::Http { req_template, dl_id, http_filter, .. } => { - let worker = &ctx.request_ctx.runtime.cmd_worker; + IO::Http { req_template, dl_id, hook, .. } => { + let event_worker = &ctx.request_ctx.runtime.cmd_worker; + let js_worker = &ctx.request_ctx.runtime.worker; let eval_http = EvalHttp::new(ctx, req_template, dl_id); let request = eval_http.init_request()?; - let response = match (&worker, http_filter) { - (Some(worker), Some(http_filter)) => { - eval_http - .execute_with_worker(request, worker, http_filter) - .await? + let response = match (&event_worker, js_worker, hook) { + (Some(worker), Some(js_worker), Some(hook)) => { + let worker_ctx = WorkerContext::new(worker, js_worker, hook); + eval_http.execute_with_worker(request, worker_ctx).await? } _ => eval_http.execute(request).await?, }; @@ -62,22 +62,23 @@ where } IO::GraphQL { req_template, field_name, dl_id, .. } => { let req = req_template.to_request(ctx)?; - + let request = DynamicRequest::new(req); let res = if ctx.request_ctx.upstream.batch.is_some() && matches!(req_template.operation_type, GraphQLOperationType::Query) { let data_loader: Option<&DataLoader> = dl_id.and_then(|dl| ctx.request_ctx.gql_data_loaders.get(dl.as_usize())); - execute_request_with_dl(ctx, req, data_loader).await? + execute_request_with_dl(ctx, request, data_loader).await? } else { - execute_raw_request(ctx, req).await? + execute_raw_request(ctx, request).await? }; set_headers(ctx, &res); parse_graphql_response(ctx, res, field_name) } - IO::Grpc { req_template, dl_id, .. } => { + IO::Grpc { req_template, dl_id, hook, .. } => { let rendered = req_template.render(ctx)?; + let worker = &ctx.request_ctx.runtime.worker; let res = if ctx.request_ctx.upstream.batch.is_some() && // TODO: share check for operation_type for resolvers @@ -91,6 +92,10 @@ where execute_raw_grpc_request(ctx, req, &req_template.operation).await? }; + let res = match (worker.as_ref(), hook.as_ref()) { + (Some(worker), Some(hook)) => hook.on_response(worker, res).await?, + _ => res, + }; set_headers(ctx, &res); Ok(res.body) diff --git a/src/core/ir/mod.rs b/src/core/ir/mod.rs index 4540424848..99008c585b 100644 --- a/src/core/ir/mod.rs +++ b/src/core/ir/mod.rs @@ -4,6 +4,7 @@ mod eval; mod eval_context; mod eval_http; mod eval_io; +mod request; mod resolver_context_like; pub mod model; @@ -13,6 +14,7 @@ use std::ops::Deref; pub use discriminator::*; pub use error::*; pub use eval_context::EvalContext; +pub(crate) use request::DynamicRequest; pub use resolver_context_like::{ EmptyResolverContext, ResolverContext, ResolverContextLike, SelectionField, }; diff --git a/src/core/ir/model.rs b/src/core/ir/model.rs index cf9e1bf812..f4fbfdb563 100644 --- a/src/core/ir/model.rs +++ b/src/core/ir/model.rs @@ -10,7 +10,7 @@ use super::{EvalContext, ResolverContextLike}; use crate::core::blueprint::{Auth, DynamicValue}; use crate::core::config::group_by::GroupBy; use crate::core::graphql::{self}; -use crate::core::http::HttpFilter; +use crate::core::worker_hooks::WorkerHooks; use crate::core::{grpc, http}; #[derive(Clone, Debug, Display)] @@ -47,9 +47,9 @@ pub enum IO { req_template: http::RequestTemplate, group_by: Option, dl_id: Option, - http_filter: Option, is_list: bool, dedupe: bool, + hook: Option, }, GraphQL { req_template: graphql::RequestTemplate, @@ -63,6 +63,7 @@ pub enum IO { group_by: Option, dl_id: Option, dedupe: bool, + hook: Option, }, Js { name: String, diff --git a/src/core/ir/request.rs b/src/core/ir/request.rs new file mode 100644 index 0000000000..7d5334f360 --- /dev/null +++ b/src/core/ir/request.rs @@ -0,0 +1,40 @@ +/// Holds necessary information for request execution. +pub struct DynamicRequest { + request: reqwest::Request, + /// used for request body batching. + batching_value: Option, +} + +impl DynamicRequest { + pub fn new(request: reqwest::Request) -> Self { + Self { request, batching_value: None } + } + + pub fn with_batching_value(self, body_key: Option) -> Self { + Self { batching_value: body_key, ..self } + } + + pub fn request(&self) -> &reqwest::Request { + &self.request + } + + pub fn request_mut(&mut self) -> &mut reqwest::Request { + &mut self.request + } + + pub fn body_key(&self) -> Option<&Value> { + self.batching_value.as_ref() + } + + pub fn into_request(self) -> reqwest::Request { + self.request + } + + pub fn into_body_key(self) -> Option { + self.batching_value + } + + pub fn into_parts(self) -> (reqwest::Request, Option) { + (self.request, self.batching_value) + } +} diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__alias_query.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__alias_query.snap index 55a962e53f..967079c79e 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__alias_query.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__alias_query.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__default_value.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__default_value.snap index 783937ff61..f3c536f21f 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__default_value.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__default_value.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__directives.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__directives.snap index 4ae3b7cc67..33e1e42728 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__directives.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__directives.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__fragments.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__fragments.snap index 43558fa415..f31d41f3c6 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__fragments.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__fragments.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__from_document.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__from_document.snap index dfe66ad529..897258d6b4 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__from_document.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__from_document.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__multiple_operations.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__multiple_operations.snap index efd0911f59..fb90b7c4bf 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__multiple_operations.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__multiple_operations.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation-2.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation-2.snap index 85bc18599b..d559ba0b57 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation-2.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation-2.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation.snap index 5a27256443..e440336255 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__resolving_operation.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_mutation.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_mutation.snap index 8899a472d8..be22bbd52f 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_mutation.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_mutation.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_query.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_query.snap index 3e08218120..a8bb8a66ff 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_query.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__simple_query.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__unions.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__unions.snap index 6d3590237c..adeacbe030 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__unions.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__unions.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__variables.snap b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__variables.snap index c2d15d78bf..d7b2b13adc 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__builder__tests__variables.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__builder__tests__variables.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/builder.rs expression: plan.selection +snapshot_kind: text --- [ Field { diff --git a/src/core/jit/snapshots/tailcall__core__jit__context__test__field.snap b/src/core/jit/snapshots/tailcall__core__jit__context__test__field.snap index eb5b1e40b8..1e4d3b1154 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__context__test__field.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__context__test__field.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/context.rs -expression: " as ResolverContextLike>::field(&ctx).unwrap()" +expression: expected +snapshot_kind: text --- SelectionField { name: "posts", diff --git a/src/core/jit/snapshots/tailcall__core__jit__model__test__from_custom_directive.snap b/src/core/jit/snapshots/tailcall__core__jit__model__test__from_custom_directive.snap index 99ddb19923..0ef365a77f 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__model__test__from_custom_directive.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__model__test__from_custom_directive.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/model.rs expression: async_directive +snapshot_kind: text --- ConstDirective { name: Positioned { diff --git a/src/core/jit/snapshots/tailcall__core__jit__response__test__adding_errors.snap b/src/core/jit/snapshots/tailcall__core__jit__response__test__adding_errors.snap index 528b311ba8..f6c7df1dab 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__response__test__adding_errors.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__response__test__adding_errors.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/response.rs expression: response +snapshot_kind: text --- Response { data: String( diff --git a/src/core/jit/snapshots/tailcall__core__jit__response__test__conversion_to_async_graphql.snap b/src/core/jit/snapshots/tailcall__core__jit__response__test__conversion_to_async_graphql.snap index d1e3515129..73498cd505 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__response__test__conversion_to_async_graphql.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__response__test__conversion_to_async_graphql.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/response.rs expression: async_response +snapshot_kind: text --- Response { data: Null, diff --git a/src/core/jit/snapshots/tailcall__core__jit__response__test__merging_of_errors.snap b/src/core/jit/snapshots/tailcall__core__jit__response__test__merging_of_errors.snap index b523434aa5..a8c5974628 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__response__test__merging_of_errors.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__response__test__merging_of_errors.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/response.rs expression: merged_resp +snapshot_kind: text --- { "data": null, diff --git a/src/core/jit/snapshots/tailcall__core__jit__response__test__with_error.snap b/src/core/jit/snapshots/tailcall__core__jit__response__test__with_error.snap index 3b3df4d638..3646bb7bf6 100644 --- a/src/core/jit/snapshots/tailcall__core__jit__response__test__with_error.snap +++ b/src/core/jit/snapshots/tailcall__core__jit__response__test__with_error.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/response.rs expression: response +snapshot_kind: text --- Response { data: Null, diff --git a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder.snap b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder.snap index b5af39402a..3679db7d97 100644 --- a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder.snap +++ b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/synth/synth.rs expression: "serde_json::to_string_pretty(&val).unwrap()" +snapshot_kind: text --- { "posts": [ diff --git a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_borrowed.snap b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_borrowed.snap index b5af39402a..3679db7d97 100644 --- a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_borrowed.snap +++ b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_borrowed.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/synth/synth.rs expression: "serde_json::to_string_pretty(&val).unwrap()" +snapshot_kind: text --- { "posts": [ diff --git a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename.snap b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename.snap index c00b1c6293..7886b00081 100644 --- a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename.snap +++ b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/synth/synth.rs expression: "serde_json::to_string_pretty(&val).unwrap()" +snapshot_kind: text --- { "posts": [ diff --git a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename_root_level.snap b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename_root_level.snap index a48b858ce3..4c06b77a9a 100644 --- a/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename_root_level.snap +++ b/src/core/jit/synth/snapshots/tailcall__core__jit__synth__synth__tests__json_placeholder_typename_root_level.snap @@ -1,6 +1,7 @@ --- source: src/core/jit/synth/synth.rs expression: "serde_json::to_string_pretty(&val).unwrap()" +snapshot_kind: text --- { "__typename": "Query", diff --git a/src/core/json/borrow.rs b/src/core/json/borrow.rs index ca93926b4f..60edafcc77 100644 --- a/src/core/json/borrow.rs +++ b/src/core/json/borrow.rs @@ -35,6 +35,14 @@ impl<'ctx> JsonObjectLike<'ctx> for ObjectAsVec<'ctx> { { self.iter() } + + fn len(&self) -> usize { + self.len() + } + + fn is_empty(&self) -> bool { + self.is_empty() + } } impl<'ctx> JsonLike<'ctx> for Value<'ctx> { diff --git a/src/core/json/graphql.rs b/src/core/json/graphql.rs index 2a0bc81b33..f9d4260f55 100644 --- a/src/core/json/graphql.rs +++ b/src/core/json/graphql.rs @@ -37,6 +37,14 @@ impl<'obj, Value: JsonLike<'obj>> JsonObjectLike<'obj> for IndexMap { self.iter().map(|(k, v)| (k.as_str(), v)) } + + fn len(&self) -> usize { + self.len() + } + + fn is_empty(&self) -> bool { + self.is_empty() + } } impl<'json> JsonLike<'json> for ConstValue { diff --git a/src/core/json/json_like.rs b/src/core/json/json_like.rs index 3a346b576f..364bee32d6 100644 --- a/src/core/json/json_like.rs +++ b/src/core/json/json_like.rs @@ -27,7 +27,7 @@ pub trait JsonLike<'json>: Sized { T::JsonObject: JsonObjectLike<'json, Value = T>, { if let Some(obj) = other.as_object() { - let mut fields = Vec::new(); + let mut fields = Vec::with_capacity(obj.len()); for (k, v) in obj.iter() { fields.push((k, Self::clone_from(v))); } @@ -67,6 +67,8 @@ pub trait JsonLike<'json>: Sized { pub trait JsonObjectLike<'obj>: Sized { type Value; fn new() -> Self; + fn is_empty(&self) -> bool; + fn len(&self) -> usize; fn with_capacity(n: usize) -> Self; fn from_vec(v: Vec<(&'obj str, Self::Value)>) -> Self; fn get_key(&self, key: &str) -> Option<&Self::Value>; diff --git a/src/core/json/serde.rs b/src/core/json/serde.rs index 62beed0f45..b726b061a6 100644 --- a/src/core/json/serde.rs +++ b/src/core/json/serde.rs @@ -35,6 +35,14 @@ impl<'obj> JsonObjectLike<'obj> for serde_json::Map { { self.iter().map(|(k, v)| (k.as_str(), v)) } + + fn len(&self) -> usize { + self.len() + } + + fn is_empty(&self) -> bool { + self.is_empty() + } } impl<'json> JsonLike<'json> for Value { diff --git a/src/core/merge_right.rs b/src/core/merge_right.rs index 71b40061ea..fd42bc0557 100644 --- a/src/core/merge_right.rs +++ b/src/core/merge_right.rs @@ -128,9 +128,9 @@ impl MergeRight for async_graphql_value::ConstValue { } } -impl MergeRight for serde_yaml::Value { +impl MergeRight for serde_yaml_ng::Value { fn merge_right(self, other: Self) -> Self { - use serde_yaml::Value; + use serde_yaml_ng::Value; match (self, other) { (Value::Null | Value::Bool(_) | Value::Number(_) | Value::String(_), other) => other, diff --git a/src/core/mod.rs b/src/core/mod.rs index a7bde1484e..702d5a0a22 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -41,6 +41,7 @@ mod transform; pub mod try_fold; pub mod variance; pub mod worker; +pub mod worker_hooks; pub mod wrapping_type; // Re-export everything from `tailcall_macros` as `macros` diff --git a/src/core/mustache/eval.rs b/src/core/mustache/eval.rs index 0726856af0..5fd1a011dc 100644 --- a/src/core/mustache/eval.rs +++ b/src/core/mustache/eval.rs @@ -10,10 +10,37 @@ pub trait Eval<'a> { pub struct PathStringEval(std::marker::PhantomData); +impl Default for PathStringEval { + fn default() -> Self { + Self::new() + } +} + impl PathStringEval { pub fn new() -> Self { Self(std::marker::PhantomData) } + + /// Tries to evaluate the mustache template with the given value. + /// If a path/value is not found, the template will be rendered as is. + pub fn eval_partial(&self, mustache: &Mustache, in_value: &A) -> String + where + A: PathString, + { + mustache + .segments() + .iter() + .map(|segment| match segment { + Segment::Literal(text) => text.clone(), + Segment::Expression(parts) => in_value + .path_string(parts) + .map(|a| a.to_string()) + .unwrap_or( + Mustache::from(vec![Segment::Expression(parts.to_vec())]).to_string(), + ), + }) + .collect() + } } impl Eval<'_> for PathStringEval { @@ -107,7 +134,6 @@ impl Mustache { #[cfg(test)] mod tests { - mod render { use std::borrow::Cow; diff --git a/src/core/mustache/mod.rs b/src/core/mustache/mod.rs index 13f906c339..723765f76d 100644 --- a/src/core/mustache/mod.rs +++ b/src/core/mustache/mod.rs @@ -1,5 +1,5 @@ mod eval; mod model; mod parse; -pub use eval::Eval; +pub use eval::{Eval, PathStringEval}; pub use model::*; diff --git a/src/core/mustache/model.rs b/src/core/mustache/model.rs index c007e7a875..6717533c48 100644 --- a/src/core/mustache/model.rs +++ b/src/core/mustache/model.rs @@ -62,7 +62,7 @@ impl Display for Mustache { .iter() .map(|segment| match segment { Segment::Literal(text) => text.clone(), - Segment::Expression(parts) => format!("{{{{{}}}}}", parts.join(".")), + Segment::Expression(parts) => format!("{{{{.{}}}}}", parts.join(".")), }) .collect::>() .join(""); diff --git a/src/core/mustache/parse.rs b/src/core/mustache/parse.rs index a814e22f53..6035f7895b 100644 --- a/src/core/mustache/parse.rs +++ b/src/core/mustache/parse.rs @@ -88,14 +88,14 @@ mod tests { #[test] fn test_to_string() { let expectations = vec![ - r"/users/{{value.id}}/todos", - r"http://localhost:8090/{{foo.bar}}/api/{{hello.world}}/end", - r"http://localhost:{{args.port}}", - r"/users/{{value.userId}}", - r"/bar?id={{args.id}}&flag={{args.flag}}", - r"/foo?id={{value.id}}", - r"{{value.d}}", - r"/posts/{{args.id}}", + r"/users/{{.value.id}}/todos", + r"http://localhost:8090/{{.foo.bar}}/api/{{.hello.world}}/end", + r"http://localhost:{{.args.port}}", + r"/users/{{.value.userId}}", + r"/bar?id={{.args.id}}&flag={{.args.flag}}", + r"/foo?id={{.value.id}}", + r"{{.value.d}}", + r"/posts/{{.args.id}}", r"http://localhost:8000", ]; diff --git a/src/core/proto_reader/fetch.rs b/src/core/proto_reader/fetch.rs index 7267918fe0..da2a34f5c8 100644 --- a/src/core/proto_reader/fetch.rs +++ b/src/core/proto_reader/fetch.rs @@ -169,11 +169,7 @@ impl GrpcReflection { operation_type: Default::default(), }; - let ctx = ConfigReaderContext { - runtime: &self.target_runtime, - vars: &Default::default(), - headers: Default::default(), - }; + let ctx = ConfigReaderContext::new(&self.target_runtime); let req = req_template.render(&ctx)?.to_request()?; let resp = self.target_runtime.http2_only.execute(req).await?; diff --git a/src/core/proto_reader/reader.rs b/src/core/proto_reader/reader.rs index 81c65cc16a..6fdd0cd476 100644 --- a/src/core/proto_reader/reader.rs +++ b/src/core/proto_reader/reader.rs @@ -65,7 +65,7 @@ impl ProtoReader { /// Asynchronously reads all proto files from a list of paths pub async fn read_all>(&self, paths: &[T]) -> anyhow::Result> { - let resolved_protos = join_all(paths.iter().map(|v| self.read(v.as_ref()))) + let resolved_protos = join_all(paths.iter().map(|v| self.read(v.as_ref(), None))) .await .into_iter() .collect::>>()?; @@ -73,12 +73,20 @@ impl ProtoReader { } /// Reads a proto file from a path - pub async fn read>(&self, path: T) -> anyhow::Result { - let file_read = self.read_proto(path.as_ref(), None).await?; + pub async fn read>( + &self, + path: T, + proto_paths: Option<&[String]>, + ) -> anyhow::Result { + let file_read = self.read_proto(path.as_ref(), None, None).await?; Self::check_package(&file_read)?; let descriptors = self - .file_resolve(file_read, PathBuf::from(path.as_ref()).parent()) + .file_resolve( + file_read, + PathBuf::from(path.as_ref()).parent(), + proto_paths, + ) .await?; let metadata = ProtoMetadata { descriptor_set: FileDescriptorSet { file: descriptors }, @@ -130,12 +138,22 @@ impl ProtoReader { &self, parent_proto: FileDescriptorProto, parent_path: Option<&Path>, + proto_paths: Option<&[String]>, ) -> anyhow::Result> { self.resolve_dependencies(parent_proto, |import| { let parent_path = parent_path.map(|p| p.to_path_buf()); let this = self.clone(); - - async move { this.read_proto(import, parent_path.as_deref()).await }.boxed() + let proto_paths = proto_paths.map(|paths| { + paths + .iter() + .map(|p| Path::new(p).to_path_buf()) + .collect::>() + }); + async move { + this.read_proto(import, parent_path.as_deref(), proto_paths.as_deref()) + .await + } + .boxed() }) .await } @@ -159,27 +177,39 @@ impl ProtoReader { &self, path: T, parent_dir: Option<&Path>, + proto_paths: Option<&[PathBuf]>, ) -> anyhow::Result { let content = if let Ok(file) = GoogleFileResolver::new().open_file(path.as_ref()) { file.source() .context("Unable to extract content of google well-known proto file")? .to_string() } else { - let path = Self::resolve_path(path.as_ref(), parent_dir); + let path = Self::resolve_path(path.as_ref(), parent_dir, proto_paths); self.reader.read_file(path).await?.content }; Ok(protox_parse::parse(path.as_ref(), &content)?) } /// Checks if path is absolute else it joins file path with relative dir /// path - fn resolve_path(src: &str, root_dir: Option<&Path>) -> String { + fn resolve_path(src: &str, root_dir: Option<&Path>, proto_paths: Option<&[PathBuf]>) -> String { if src.starts_with("http") { return src.to_string(); } if Path::new(&src).is_absolute() { - src.to_string() - } else if let Some(path) = root_dir { + return src.to_string(); + } + + if let Some(proto_paths) = proto_paths { + for proto_path in proto_paths { + let path = proto_path.join(src); + if path.exists() { + return path.to_string_lossy().to_string(); + } + } + } + + if let Some(path) = root_dir { path.join(src).to_string_lossy().to_string() } else { src.to_string() @@ -210,7 +240,7 @@ mod test_proto_config { let runtime = crate::core::runtime::test::init(None); let reader = ProtoReader::init(ResourceReader::::cached(runtime.clone()), runtime); reader - .read_proto("google/protobuf/empty.proto", None) + .read_proto("google/protobuf/empty.proto", None, None) .await .unwrap(); } @@ -225,7 +255,11 @@ mod test_proto_config { let reader = ProtoReader::init(ResourceReader::::cached(runtime.clone()), runtime); let file_descriptors = reader - .file_resolve(reader.read_proto(&test_file, None).await?, Some(test_dir)) + .file_resolve( + reader.read_proto(&test_file, None, None).await?, + Some(test_dir), + None, + ) .await?; for file in file_descriptors .iter() @@ -248,7 +282,7 @@ mod test_proto_config { let reader = ProtoReader::init(ResourceReader::::cached(runtime.clone()), runtime); let proto_no_pkg = PathBuf::from(tailcall_fixtures::configs::SELF).join("proto_no_pkg.graphql"); - let config_module = reader.read(proto_no_pkg.to_str().unwrap()).await; + let config_module = reader.read(proto_no_pkg.to_str().unwrap(), None).await; assert!(config_module.is_err()); Ok(()) } diff --git a/src/core/resource_reader.rs b/src/core/resource_reader.rs index 3352d1c1c1..5d0aed446c 100644 --- a/src/core/resource_reader.rs +++ b/src/core/resource_reader.rs @@ -7,7 +7,10 @@ use futures_util::TryFutureExt; use tailcall_hasher::TailcallHasher; use url::Url; +use crate::core::mustache::PathStringEval; +use crate::core::path::PathString; use crate::core::runtime::TargetRuntime; +use crate::core::Mustache; /// Response of a file read operation #[derive(Debug)] @@ -16,6 +19,16 @@ pub struct FileRead { pub path: String, } +impl FileRead { + /// Renders the content of the file using the given context + pub fn render(mut self, context: &impl PathString) -> Self { + let mustache = Mustache::parse(&self.content); + let schema = PathStringEval::new().eval_partial(&mustache, context); + self.content = schema; + self + } +} + /// Supported Resources by Resource Reader pub enum Resource { RawPath(String), diff --git a/src/core/snapshots/tailcall__core__tests__include_config.snap b/src/core/snapshots/tailcall__core__tests__include_config.snap index 34c85b2e1e..2c4fd3baf6 100644 --- a/src/core/snapshots/tailcall__core__tests__include_config.snap +++ b/src/core/snapshots/tailcall__core__tests__include_config.snap @@ -1,6 +1,7 @@ --- source: src/core/mod.rs expression: cfg +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/src/core/worker/worker.rs b/src/core/worker/worker.rs index 305cf90998..9b9ddd124e 100644 --- a/src/core/worker/worker.rs +++ b/src/core/worker/worker.rs @@ -3,9 +3,11 @@ use std::fmt::Display; use hyper::body::Bytes; use reqwest::Request; +use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use super::error::{Error, Result}; +use crate::core::ir::DynamicRequest; use crate::core::{is_default, Response}; #[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq)] @@ -37,6 +39,7 @@ pub struct WorkerRequest(pub reqwest::Request); #[derive(Debug)] pub enum Event { Request(WorkerRequest), + Response(WorkerResponse), } #[derive(Debug)] @@ -185,6 +188,14 @@ impl From for reqwest::Request { } } +impl TryFrom for DynamicRequest { + type Error = anyhow::Error; + + fn try_from(value: WorkerRequest) -> std::result::Result { + Ok(DynamicRequest::new(value.0)) + } +} + impl From<&reqwest::Url> for Uri { fn from(value: &reqwest::Url) -> Self { Self { diff --git a/src/core/worker_hooks.rs b/src/core/worker_hooks.rs new file mode 100644 index 0000000000..c3aa4792d7 --- /dev/null +++ b/src/core/worker_hooks.rs @@ -0,0 +1,63 @@ +use std::sync::Arc; + +use super::ir::Error; +use super::worker::WorkerRequest; +use super::{worker, WorkerIO}; +use crate::core::http::Response; + +/// User can configure the hooks on directive +/// for the requests. +#[derive(Clone, Debug)] +pub struct WorkerHooks { + pub on_request: Option, + pub on_response: Option, +} + +impl WorkerHooks { + pub fn try_new( + on_request: Option, + on_response: Option, + ) -> Result { + if on_request.is_none() && on_response.is_none() { + Err("At least one of on_request or on_response must be present") + } else { + Ok(Self { on_request, on_response }) + } + } + + /// on request hook called before the request is sent and it sends the + /// request to the worker for modification. + pub async fn on_request( + &self, + worker: &Arc>, + request: &reqwest::Request, + ) -> Result, Error> { + match &self.on_request { + Some(on_request) => { + let js_request = WorkerRequest::try_from(request)?; + let event = worker::Event::Request(js_request); + worker.call(on_request, event).await.map_err(|e| e.into()) + } + None => Ok(None), + } + } + + /// on response hook called after the response is received and it sends the + /// response body to the worker and returns the response. + pub async fn on_response( + &self, + worker: &Arc< + dyn WorkerIO, + >, + response: Response, + ) -> Result, Error> { + if let Some(on_response) = self.on_response.as_ref() { + match worker.call(on_response, response.body.clone()).await? { + Some(js_response) => Ok(response.body(js_response)), + None => Ok(response), + } + } else { + Ok(response) + } + } +} diff --git a/tailcall-cloudflare/package-lock.json b/tailcall-cloudflare/package-lock.json index efc4df36a3..c9d1fc5ce7 100644 --- a/tailcall-cloudflare/package-lock.json +++ b/tailcall-cloudflare/package-lock.json @@ -27,9 +27,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241022.0.tgz", - "integrity": "sha512-1NNYun37myMTgCUiPQEJ0cMal4mKZVTpkD0b2tx9hV70xji+frVJcSK8YVLeUm1P+Rw1d/ct8DMgQuCpsz3Fsw==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241205.0.tgz", + "integrity": "sha512-TArEZkSZkHJyEwnlWWkSpCI99cF6lJ14OVeEoI9Um/+cD9CKZLM9vCmsLeKglKheJ0KcdCnkA+DbeD15t3VaWg==", "cpu": [ "x64" ], @@ -43,9 +43,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241022.0.tgz", - "integrity": "sha512-FOO/0P0U82EsTLTdweNVgw+4VOk5nghExLPLSppdOziq6IR5HVgP44Kmq5LdsUeHUhwUmfOh9hzaTpkNzUqKvw==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241205.0.tgz", + "integrity": "sha512-u5eqKa9QRdA8MugfgCoD+ADDjY6EpKbv3hSYJETmmUh17l7WXjWBzv4pUvOKIX67C0UzMUy4jZYwC53MymhX3w==", "cpu": [ "arm64" ], @@ -59,9 +59,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241022.0.tgz", - "integrity": "sha512-RsNc19BQJG9yd+ngnjuDeG9ywZG+7t1L4JeglgceyY5ViMNMKVO7Zpbsu69kXslU9h6xyQG+lrmclg3cBpnhYA==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241205.0.tgz", + "integrity": "sha512-OYA7S5zpumMamWEW+IhhBU6YojIEocyE5X/YFPiTOCrDE3dsfr9t6oqNE7hxGm1VAAu+Irtl+a/5LwmBOU681w==", "cpu": [ "x64" ], @@ -75,9 +75,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241022.0.tgz", - "integrity": "sha512-x5mUXpKxfsosxcFmcq5DaqLs37PejHYVRsNz1cWI59ma7aC4y4Qn6Tf3i0r9MwQTF/MccP4SjVslMU6m4W7IaA==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241205.0.tgz", + "integrity": "sha512-qAzecONjFJGIAVJZKExQ5dlbic0f3d4A+GdKa+H6SoUJtPaWiE3K6WuePo4JOT7W3/Zfh25McmX+MmpMUUcM5Q==", "cpu": [ "arm64" ], @@ -91,9 +91,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241022.0.tgz", - "integrity": "sha512-eBCClx4szCOgKqOlxxbdNszMqQf3MRG1B9BRIqEM/diDfdR9IrZ8l3FaEm+l9gXgPmS6m1NBn40aWuGBl8UTSw==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241205.0.tgz", + "integrity": "sha512-BEab+HiUgCdl6GXAT7EI2yaRtDPiRJlB94XLvRvXi1ZcmQqsrq6awGo6apctFo4WUL29V7c09LxmN4HQ3X2Tvg==", "cpu": [ "x64" ], @@ -107,9 +107,9 @@ } }, "node_modules/@cloudflare/workers-shared": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-shared/-/workers-shared-0.7.0.tgz", - "integrity": "sha512-LLQRTqx7lKC7o2eCYMpyc5FXV8d0pUX6r3A+agzhqS9aoR5A6zCPefwQGcvbKx83ozX22ATZcemwxQXn12UofQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-shared/-/workers-shared-0.10.0.tgz", + "integrity": "sha512-j3EwZBc9ctavmFVOQT1gqztRO/Plx4ZR0LMEEOif+5YoCcuD1P7/NEjlODPMc5a1w+8+7A/H+Ci8Ihd55+x0Zw==", "dev": true, "dependencies": { "mime": "^3.0.0", @@ -120,9 +120,9 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241022.0.tgz", - "integrity": "sha512-1zOAw5QIDKItzGatzCrEpfLOB1AuMTwVqKmbw9B9eBfCUGRFNfJYMrJxIwcse9EmKahsQt2GruqU00pY/GyXgg==", + "version": "4.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241205.0.tgz", + "integrity": "sha512-pj1VKRHT/ScQbHOIMFODZaNAlJHQHdBSZXNIdr9ebJzwBff9Qz8VdqhbhggV7f+aUEh8WSbrsPIo4a+WtgjUvw==", "dev": true }, "node_modules/@cspotcode/source-map-support": { @@ -781,13 +781,13 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", - "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", "dev": true, "dependencies": { - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, @@ -796,12 +796,12 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", - "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", "dev": true, "dependencies": { - "@vitest/spy": "2.1.5", + "@vitest/spy": "2.1.8", "estree-walker": "^3.0.3", "magic-string": "^0.30.12" }, @@ -822,9 +822,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", - "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, "dependencies": { "tinyrainbow": "^1.2.0" @@ -834,12 +834,12 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz", - "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", "dev": true, "dependencies": { - "@vitest/utils": "2.1.5", + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" }, "funding": { @@ -847,12 +847,12 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz", - "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "magic-string": "^0.30.12", "pathe": "^1.1.2" }, @@ -861,9 +861,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz", - "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, "dependencies": { "tinyspy": "^3.0.2" @@ -873,12 +873,12 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz", - "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, @@ -907,19 +907,6 @@ "node": ">=0.4.0" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/as-table": { "version": "1.0.55", "resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz", @@ -938,33 +925,12 @@ "node": ">=12" } }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/blake3-wasm": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", "dev": true }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -1010,30 +976,18 @@ } }, "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "funding": { + "url": "https://paulmillr.com/funding/" } }, "node_modules/cookie": { @@ -1179,18 +1133,6 @@ "node": ">=12.0.0" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1224,18 +1166,6 @@ "source-map": "^0.6.1" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", @@ -1254,18 +1184,6 @@ "node": ">= 0.4" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -1278,36 +1196,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/itty-time": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/itty-time/-/itty-time-1.0.6.tgz", @@ -1342,9 +1230,9 @@ } }, "node_modules/miniflare": { - "version": "3.20241022.0", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241022.0.tgz", - "integrity": "sha512-x9Fbq1Hmz1f0osIT9Qmj78iX4UpCP2EqlZnA/tzj/3+I49vc3Kq0fNqSSKplcdf6HlCHdL3fOBicmreQF4BUUQ==", + "version": "3.20241205.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241205.0.tgz", + "integrity": "sha512-Z0cTtIf6ZrcAJ3SrOI9EUM3s4dkGhNeU6Ubl8sroYhsPVD+rtz3m5+p6McHFWCkcMff1o60X5XEKVTmkz0gbpA==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "0.8.1", @@ -1355,8 +1243,8 @@ "glob-to-regexp": "^0.4.1", "stoppable": "^1.1.0", "undici": "^5.28.4", - "workerd": "1.20241022.0", - "ws": "^8.17.1", + "workerd": "1.20241205.0", + "ws": "^8.18.0", "youch": "^3.2.2", "zod": "^3.22.3" }, @@ -1409,15 +1297,6 @@ "node": ">= 6.13.0" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ohash": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.4.tgz", @@ -1457,18 +1336,6 @@ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/postcss": { "version": "8.4.38", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", @@ -1504,15 +1371,16 @@ "dev": true }, "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/resolve": { @@ -1532,15 +1400,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/rollup": { "version": "4.14.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.1.tgz", @@ -1753,18 +1612,6 @@ "node": ">=14.0.0" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", @@ -1797,9 +1644,9 @@ }, "node_modules/unenv": { "name": "unenv-nightly", - "version": "2.0.0-20241024-111401-d4156ac", - "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241024-111401-d4156ac.tgz", - "integrity": "sha512-xJO1hfY+Te+/XnfCYrCbFbRcgu6XEODND1s5wnVbaBCkuQX7JXF7fHEXPrukFE2j8EOH848P8QN19VO47XN8hw==", + "version": "2.0.0-20241204-140205-a5d5190", + "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241204-140205-a5d5190.tgz", + "integrity": "sha512-jpmAytLeiiW01pl5bhVn9wYJ4vtiLdhGe10oXlJBuQEX8mxjxO8BlEXGHU4vr4yEikjFP1wsomTHt/CLU8kUwg==", "dev": true, "dependencies": { "defu": "^6.1.4", @@ -1864,9 +1711,9 @@ } }, "node_modules/vite-node": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz", - "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -1886,18 +1733,18 @@ } }, "node_modules/vitest": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", - "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", "dev": true, "dependencies": { - "@vitest/expect": "2.1.5", - "@vitest/mocker": "2.1.5", - "@vitest/pretty-format": "^2.1.5", - "@vitest/runner": "2.1.5", - "@vitest/snapshot": "2.1.5", - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", @@ -1909,7 +1756,7 @@ "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.5", + "vite-node": "2.1.8", "why-is-node-running": "^2.3.0" }, "bin": { @@ -1924,8 +1771,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.5", - "@vitest/ui": "2.1.5", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", "happy-dom": "*", "jsdom": "*" }, @@ -1967,9 +1814,9 @@ } }, "node_modules/workerd": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241022.0.tgz", - "integrity": "sha512-jyGXsgO9DRcJyx6Ovv7gUyDPc3UYC2i/E0p9GFUg6GUzpldw4Y93y9kOmdfsOnKZ3+lY53veSiUniiBPE6Q2NQ==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241205.0.tgz", + "integrity": "sha512-vso/2n0c5SdBDWiD+Sx5gM7unA6SiZXRVUHDqH1euoP/9mFVHZF8icoYsNLB87b/TX8zNgpae+I5N/xFpd9v0g==", "dev": true, "hasInstallScript": true, "bin": { @@ -1979,37 +1826,36 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20241022.0", - "@cloudflare/workerd-darwin-arm64": "1.20241022.0", - "@cloudflare/workerd-linux-64": "1.20241022.0", - "@cloudflare/workerd-linux-arm64": "1.20241022.0", - "@cloudflare/workerd-windows-64": "1.20241022.0" + "@cloudflare/workerd-darwin-64": "1.20241205.0", + "@cloudflare/workerd-darwin-arm64": "1.20241205.0", + "@cloudflare/workerd-linux-64": "1.20241205.0", + "@cloudflare/workerd-linux-arm64": "1.20241205.0", + "@cloudflare/workerd-windows-64": "1.20241205.0" } }, "node_modules/wrangler": { - "version": "3.84.1", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.84.1.tgz", - "integrity": "sha512-w27/QpIk2qz6aMIVi9T8cDcXMvh/RXjcL+vf4o5J2GpQAE4U7wTCNHyaY9H3oTJWRN97KqCAEbiHBNtTKoUJEw==", + "version": "3.93.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.93.0.tgz", + "integrity": "sha512-+wfxjOrtm6YgDS+NdJkB6aiBIS3ED97mNRQmfrEShRJW4pVo4sWY6oQ1FsGT+j4tGHplrTbWCE6U5yTgjNW/lw==", "dev": true, "dependencies": { "@cloudflare/kv-asset-handler": "0.3.4", - "@cloudflare/workers-shared": "0.7.0", + "@cloudflare/workers-shared": "0.10.0", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", "blake3-wasm": "^2.1.5", - "chokidar": "^3.5.3", + "chokidar": "^4.0.1", "date-fns": "^4.1.0", "esbuild": "0.17.19", "itty-time": "^1.0.6", - "miniflare": "3.20241022.0", + "miniflare": "3.20241205.0", "nanoid": "^3.3.3", "path-to-regexp": "^6.3.0", "resolve": "^1.22.8", - "resolve.exports": "^2.0.2", "selfsigned": "^2.0.1", "source-map": "^0.6.1", - "unenv": "npm:unenv-nightly@2.0.0-20241024-111401-d4156ac", - "workerd": "1.20241022.0", + "unenv": "npm:unenv-nightly@2.0.0-20241204-140205-a5d5190", + "workerd": "1.20241205.0", "xxhash-wasm": "^1.0.1" }, "bin": { @@ -2023,7 +1869,7 @@ "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20241022.0" + "@cloudflare/workers-types": "^4.20241205.0" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { @@ -2421,9 +2267,9 @@ } }, "node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "engines": { "node": ">=10.0.0" @@ -2479,44 +2325,44 @@ } }, "@cloudflare/workerd-darwin-64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241022.0.tgz", - "integrity": "sha512-1NNYun37myMTgCUiPQEJ0cMal4mKZVTpkD0b2tx9hV70xji+frVJcSK8YVLeUm1P+Rw1d/ct8DMgQuCpsz3Fsw==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241205.0.tgz", + "integrity": "sha512-TArEZkSZkHJyEwnlWWkSpCI99cF6lJ14OVeEoI9Um/+cD9CKZLM9vCmsLeKglKheJ0KcdCnkA+DbeD15t3VaWg==", "dev": true, "optional": true }, "@cloudflare/workerd-darwin-arm64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241022.0.tgz", - "integrity": "sha512-FOO/0P0U82EsTLTdweNVgw+4VOk5nghExLPLSppdOziq6IR5HVgP44Kmq5LdsUeHUhwUmfOh9hzaTpkNzUqKvw==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241205.0.tgz", + "integrity": "sha512-u5eqKa9QRdA8MugfgCoD+ADDjY6EpKbv3hSYJETmmUh17l7WXjWBzv4pUvOKIX67C0UzMUy4jZYwC53MymhX3w==", "dev": true, "optional": true }, "@cloudflare/workerd-linux-64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241022.0.tgz", - "integrity": "sha512-RsNc19BQJG9yd+ngnjuDeG9ywZG+7t1L4JeglgceyY5ViMNMKVO7Zpbsu69kXslU9h6xyQG+lrmclg3cBpnhYA==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241205.0.tgz", + "integrity": "sha512-OYA7S5zpumMamWEW+IhhBU6YojIEocyE5X/YFPiTOCrDE3dsfr9t6oqNE7hxGm1VAAu+Irtl+a/5LwmBOU681w==", "dev": true, "optional": true }, "@cloudflare/workerd-linux-arm64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241022.0.tgz", - "integrity": "sha512-x5mUXpKxfsosxcFmcq5DaqLs37PejHYVRsNz1cWI59ma7aC4y4Qn6Tf3i0r9MwQTF/MccP4SjVslMU6m4W7IaA==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241205.0.tgz", + "integrity": "sha512-qAzecONjFJGIAVJZKExQ5dlbic0f3d4A+GdKa+H6SoUJtPaWiE3K6WuePo4JOT7W3/Zfh25McmX+MmpMUUcM5Q==", "dev": true, "optional": true }, "@cloudflare/workerd-windows-64": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241022.0.tgz", - "integrity": "sha512-eBCClx4szCOgKqOlxxbdNszMqQf3MRG1B9BRIqEM/diDfdR9IrZ8l3FaEm+l9gXgPmS6m1NBn40aWuGBl8UTSw==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241205.0.tgz", + "integrity": "sha512-BEab+HiUgCdl6GXAT7EI2yaRtDPiRJlB94XLvRvXi1ZcmQqsrq6awGo6apctFo4WUL29V7c09LxmN4HQ3X2Tvg==", "dev": true, "optional": true }, "@cloudflare/workers-shared": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-shared/-/workers-shared-0.7.0.tgz", - "integrity": "sha512-LLQRTqx7lKC7o2eCYMpyc5FXV8d0pUX6r3A+agzhqS9aoR5A6zCPefwQGcvbKx83ozX22ATZcemwxQXn12UofQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-shared/-/workers-shared-0.10.0.tgz", + "integrity": "sha512-j3EwZBc9ctavmFVOQT1gqztRO/Plx4ZR0LMEEOif+5YoCcuD1P7/NEjlODPMc5a1w+8+7A/H+Ci8Ihd55+x0Zw==", "dev": true, "requires": { "mime": "^3.0.0", @@ -2524,9 +2370,9 @@ } }, "@cloudflare/workers-types": { - "version": "4.20241022.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241022.0.tgz", - "integrity": "sha512-1zOAw5QIDKItzGatzCrEpfLOB1AuMTwVqKmbw9B9eBfCUGRFNfJYMrJxIwcse9EmKahsQt2GruqU00pY/GyXgg==", + "version": "4.20241205.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241205.0.tgz", + "integrity": "sha512-pj1VKRHT/ScQbHOIMFODZaNAlJHQHdBSZXNIdr9ebJzwBff9Qz8VdqhbhggV7f+aUEh8WSbrsPIo4a+WtgjUvw==", "dev": true }, "@cspotcode/source-map-support": { @@ -2874,74 +2720,74 @@ } }, "@vitest/expect": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", - "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", "dev": true, "requires": { - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "tinyrainbow": "^1.2.0" } }, "@vitest/mocker": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", - "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", "dev": true, "requires": { - "@vitest/spy": "2.1.5", + "@vitest/spy": "2.1.8", "estree-walker": "^3.0.3", "magic-string": "^0.30.12" } }, "@vitest/pretty-format": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", - "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, "requires": { "tinyrainbow": "^1.2.0" } }, "@vitest/runner": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz", - "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", "dev": true, "requires": { - "@vitest/utils": "2.1.5", + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" } }, "@vitest/snapshot": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz", - "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", "dev": true, "requires": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "magic-string": "^0.30.12", "pathe": "^1.1.2" } }, "@vitest/spy": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz", - "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, "requires": { "tinyspy": "^3.0.2" } }, "@vitest/utils": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz", - "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", "dev": true, "requires": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" } @@ -2958,16 +2804,6 @@ "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true }, - "anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, "as-table": { "version": "1.0.55", "resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz", @@ -2983,27 +2819,12 @@ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, "blake3-wasm": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", "dev": true }, - "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "requires": { - "fill-range": "^7.1.1" - } - }, "cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -3040,19 +2861,12 @@ "dev": true }, "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", "dev": true, "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" } }, "cookie": { @@ -3158,15 +2972,6 @@ "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", "dev": true }, - "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -3190,15 +2995,6 @@ "source-map": "^0.6.1" } }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, "glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", @@ -3214,15 +3010,6 @@ "function-bind": "^1.1.2" } }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, "is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -3232,27 +3019,6 @@ "hasown": "^2.0.0" } }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "itty-time": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/itty-time/-/itty-time-1.0.6.tgz", @@ -3281,9 +3047,9 @@ "dev": true }, "miniflare": { - "version": "3.20241022.0", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241022.0.tgz", - "integrity": "sha512-x9Fbq1Hmz1f0osIT9Qmj78iX4UpCP2EqlZnA/tzj/3+I49vc3Kq0fNqSSKplcdf6HlCHdL3fOBicmreQF4BUUQ==", + "version": "3.20241205.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241205.0.tgz", + "integrity": "sha512-Z0cTtIf6ZrcAJ3SrOI9EUM3s4dkGhNeU6Ubl8sroYhsPVD+rtz3m5+p6McHFWCkcMff1o60X5XEKVTmkz0gbpA==", "dev": true, "requires": { "@cspotcode/source-map-support": "0.8.1", @@ -3294,8 +3060,8 @@ "glob-to-regexp": "^0.4.1", "stoppable": "^1.1.0", "undici": "^5.28.4", - "workerd": "1.20241022.0", - "ws": "^8.17.1", + "workerd": "1.20241205.0", + "ws": "^8.18.0", "youch": "^3.2.2", "zod": "^3.22.3" } @@ -3324,12 +3090,6 @@ "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", "dev": true }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, "ohash": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.4.tgz", @@ -3366,12 +3126,6 @@ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, "postcss": { "version": "8.4.38", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", @@ -3390,13 +3144,10 @@ "dev": true }, "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", + "dev": true }, "resolve": { "version": "1.22.8", @@ -3409,12 +3160,6 @@ "supports-preserve-symlinks-flag": "^1.0.0" } }, - "resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true - }, "rollup": { "version": "4.14.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.1.tgz", @@ -3592,15 +3337,6 @@ "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", "dev": true }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", @@ -3629,9 +3365,9 @@ "dev": true }, "unenv": { - "version": "npm:unenv-nightly@2.0.0-20241024-111401-d4156ac", - "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241024-111401-d4156ac.tgz", - "integrity": "sha512-xJO1hfY+Te+/XnfCYrCbFbRcgu6XEODND1s5wnVbaBCkuQX7JXF7fHEXPrukFE2j8EOH848P8QN19VO47XN8hw==", + "version": "npm:unenv-nightly@2.0.0-20241204-140205-a5d5190", + "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241204-140205-a5d5190.tgz", + "integrity": "sha512-jpmAytLeiiW01pl5bhVn9wYJ4vtiLdhGe10oXlJBuQEX8mxjxO8BlEXGHU4vr4yEikjFP1wsomTHt/CLU8kUwg==", "dev": true, "requires": { "defu": "^6.1.4", @@ -3653,9 +3389,9 @@ } }, "vite-node": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz", - "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dev": true, "requires": { "cac": "^6.7.14", @@ -3666,18 +3402,18 @@ } }, "vitest": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", - "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", "dev": true, "requires": { - "@vitest/expect": "2.1.5", - "@vitest/mocker": "2.1.5", - "@vitest/pretty-format": "^2.1.5", - "@vitest/runner": "2.1.5", - "@vitest/snapshot": "2.1.5", - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", @@ -3689,7 +3425,7 @@ "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.5", + "vite-node": "2.1.8", "why-is-node-running": "^2.3.0" } }, @@ -3704,43 +3440,42 @@ } }, "workerd": { - "version": "1.20241022.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241022.0.tgz", - "integrity": "sha512-jyGXsgO9DRcJyx6Ovv7gUyDPc3UYC2i/E0p9GFUg6GUzpldw4Y93y9kOmdfsOnKZ3+lY53veSiUniiBPE6Q2NQ==", + "version": "1.20241205.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241205.0.tgz", + "integrity": "sha512-vso/2n0c5SdBDWiD+Sx5gM7unA6SiZXRVUHDqH1euoP/9mFVHZF8icoYsNLB87b/TX8zNgpae+I5N/xFpd9v0g==", "dev": true, "requires": { - "@cloudflare/workerd-darwin-64": "1.20241022.0", - "@cloudflare/workerd-darwin-arm64": "1.20241022.0", - "@cloudflare/workerd-linux-64": "1.20241022.0", - "@cloudflare/workerd-linux-arm64": "1.20241022.0", - "@cloudflare/workerd-windows-64": "1.20241022.0" + "@cloudflare/workerd-darwin-64": "1.20241205.0", + "@cloudflare/workerd-darwin-arm64": "1.20241205.0", + "@cloudflare/workerd-linux-64": "1.20241205.0", + "@cloudflare/workerd-linux-arm64": "1.20241205.0", + "@cloudflare/workerd-windows-64": "1.20241205.0" } }, "wrangler": { - "version": "3.84.1", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.84.1.tgz", - "integrity": "sha512-w27/QpIk2qz6aMIVi9T8cDcXMvh/RXjcL+vf4o5J2GpQAE4U7wTCNHyaY9H3oTJWRN97KqCAEbiHBNtTKoUJEw==", + "version": "3.93.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.93.0.tgz", + "integrity": "sha512-+wfxjOrtm6YgDS+NdJkB6aiBIS3ED97mNRQmfrEShRJW4pVo4sWY6oQ1FsGT+j4tGHplrTbWCE6U5yTgjNW/lw==", "dev": true, "requires": { "@cloudflare/kv-asset-handler": "0.3.4", - "@cloudflare/workers-shared": "0.7.0", + "@cloudflare/workers-shared": "0.10.0", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", "blake3-wasm": "^2.1.5", - "chokidar": "^3.5.3", + "chokidar": "^4.0.1", "date-fns": "^4.1.0", "esbuild": "0.17.19", "fsevents": "~2.3.2", "itty-time": "^1.0.6", - "miniflare": "3.20241022.0", + "miniflare": "3.20241205.0", "nanoid": "^3.3.3", "path-to-regexp": "^6.3.0", "resolve": "^1.22.8", - "resolve.exports": "^2.0.2", "selfsigned": "^2.0.1", "source-map": "^0.6.1", - "unenv": "npm:unenv-nightly@2.0.0-20241024-111401-d4156ac", - "workerd": "1.20241022.0", + "unenv": "npm:unenv-nightly@2.0.0-20241204-140205-a5d5190", + "workerd": "1.20241205.0", "xxhash-wasm": "^1.0.1" }, "dependencies": { @@ -3931,9 +3666,9 @@ } }, "ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "requires": {} }, diff --git a/tailcall-fixtures/fixtures/configs/flatten_single_field.graphql b/tailcall-fixtures/fixtures/configs/flatten_single_field.graphql index 8eba1e7287..31db63646b 100644 --- a/tailcall-fixtures/fixtures/configs/flatten_single_field.graphql +++ b/tailcall-fixtures/fixtures/configs/flatten_single_field.graphql @@ -2,11 +2,16 @@ schema { query: Query } +input Input { + a: Bar +} + type Query { foo: Foo not_single: NotSingle not_single_middle: NotSingleMiddle user: User + a(input: Input!): Empty } # Type with only one field diff --git a/tailcall-fixtures/fixtures/configs/yaml-nested-unions-recursive.yaml b/tailcall-fixtures/fixtures/configs/yaml-nested-unions-recursive.yaml deleted file mode 100644 index 829afc48ff..0000000000 --- a/tailcall-fixtures/fixtures/configs/yaml-nested-unions-recursive.yaml +++ /dev/null @@ -1,56 +0,0 @@ -schema: - query: Query - -types: - T1: - fields: - t1: - type: - name: String - T2: - fields: - t2: - type: - name: Int - T3: - fields: - t3: - type: - name: Boolean - t33: - type: - name: Float - required: true - - T4: - fields: - t4: - type: - name: String - - T5: - fields: - t5: - type: - name: Boolean - - Query: - fields: - test: - type: - name: U - args: - u: - type: - name: U - required: true - http: - url: http://localhost/users/{{args.u}} - -unions: - U1: - types: ["T1", "T2", "T3", "U2"] - U2: - types: ["T3", "T4", "U1"] - U: - types: ["U1", "U2", "T5"] diff --git a/tailcall-fixtures/fixtures/configs/yaml-nested-unions.yaml b/tailcall-fixtures/fixtures/configs/yaml-nested-unions.yaml deleted file mode 100644 index 4672968a04..0000000000 --- a/tailcall-fixtures/fixtures/configs/yaml-nested-unions.yaml +++ /dev/null @@ -1,56 +0,0 @@ -schema: - query: Query - -types: - T1: - fields: - t1: - type: - name: String - T2: - fields: - t2: - type: - name: Int - T3: - fields: - t3: - type: - name: Boolean - t33: - type: - name: Float - required: true - - T4: - fields: - t4: - type: - name: String - - T5: - fields: - t5: - type: - name: Boolean - - Query: - fields: - test: - type: - name: U - args: - u: - type: - name: U - required: true - http: - url: http://localhost/users/{{args.u}} - -unions: - U1: - types: ["T1", "T2", "T3"] - U2: - types: ["T3", "T4"] - U: - types: ["U1", "U2", "T5"] diff --git a/tailcall-fixtures/fixtures/configs/yaml-recursive-input.yaml b/tailcall-fixtures/fixtures/configs/yaml-recursive-input.yaml deleted file mode 100644 index 43ee7c3c72..0000000000 --- a/tailcall-fixtures/fixtures/configs/yaml-recursive-input.yaml +++ /dev/null @@ -1,34 +0,0 @@ -server: - port: 8000 -schema: - query: Query -types: - Bar: - fields: - name: - type: - name: Foo - rec: - type: - name: Bar - - Query: - fields: - bars: - type: - name: String - args: - filter: - type: - name: Bar - graphql: - args: - - key: baz - value: '{{.args.baz}}' - url: http://localhost - name: bars - Foo: - fields: - name: - type: - name: String diff --git a/tailcall-fixtures/fixtures/configs/yaml-union-in-type.yaml b/tailcall-fixtures/fixtures/configs/yaml-union-in-type.yaml deleted file mode 100644 index 66cf2edaae..0000000000 --- a/tailcall-fixtures/fixtures/configs/yaml-union-in-type.yaml +++ /dev/null @@ -1,64 +0,0 @@ -schema: - query: Query - -types: - T1: - fields: - t1: - type: - name: String - T2: - fields: - t2: - type: - name: Int - T3: - fields: - t3: - type: - name: Boolean - t33: - type: - name: Float - required: true - - NU: - fields: - test: - type: - name: String - u: - type: - name: U - - NNU: - fields: - other: - type: - name: Int - new: - type: - name: Boolean - nu: - type: - name: NU - - Query: - fields: - test: - type: - name: U - args: - nu: - type: - name: NU - required: true - nnu: - type: - name: NNU - http: - url: http://localhost/users/{{args.nu.u}} - -unions: - U: - types: ["T1", "T2", "T3"] diff --git a/tailcall-fixtures/fixtures/configs/yaml-union.yaml b/tailcall-fixtures/fixtures/configs/yaml-union.yaml deleted file mode 100644 index 1398fe227c..0000000000 --- a/tailcall-fixtures/fixtures/configs/yaml-union.yaml +++ /dev/null @@ -1,40 +0,0 @@ -schema: - query: Query - -types: - T1: - fields: - t1: - type: - name: String - T2: - fields: - t2: - type: - name: Int - T3: - fields: - t3: - type: - name: Boolean - t33: - type: - name: Float - required: true - - Query: - fields: - test: - type: - name: U - args: - u: - type: - name: U - required: true - http: - url: http://localhost/users/{{args.u}} - -unions: - U: - types: ["T1", "T2", "T3"] diff --git a/tailcall-fixtures/fixtures/generator/simple-json.json b/tailcall-fixtures/fixtures/generator/simple-json.json deleted file mode 100644 index 9e1d8f61cf..0000000000 --- a/tailcall-fixtures/fixtures/generator/simple-json.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "inputs": [ - { - "curl": { - "src": "https://jsonplaceholder.typicode.com/posts/1", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json" - }, - "fieldName": "post" - } - }, - { - "curl": { - "src": "https://jsonplaceholder.typicode.com/posts", - "fieldName": "posts" - } - }, - { - "proto": { - "src": "../protobuf/news.proto" - } - } - ], - "preset": { - "mergeType": 1.0, - "consolidateURL": 0.5 - }, - "output": { - "path": "./output.graphql", - "format": "graphQL" - }, - "schema": { - "query": "Query" - } -} diff --git a/tailcall-fixtures/fixtures/protobuf/news_proto_paths.proto b/tailcall-fixtures/fixtures/protobuf/news_proto_paths.proto new file mode 100644 index 0000000000..e4d9b6c72b --- /dev/null +++ b/tailcall-fixtures/fixtures/protobuf/news_proto_paths.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package news; + +import "protobuf/news_dto.proto"; +import "google/protobuf/empty.proto"; + +service NewsService { + rpc GetAllNews(google.protobuf.Empty) returns (NewsList) {} + rpc GetNews(NewsId) returns (News) {} + rpc GetMultipleNews(MultipleNewsId) returns (NewsList) {} + rpc DeleteNews(NewsId) returns (google.protobuf.Empty) {} + rpc EditNews(News) returns (News) {} + rpc AddNews(News) returns (News) {} +} \ No newline at end of file diff --git a/tailcall-typedefs-common/src/directive_definition.rs b/tailcall-typedefs-common/src/directive_definition.rs index 908e9087c7..c662130e49 100644 --- a/tailcall-typedefs-common/src/directive_definition.rs +++ b/tailcall-typedefs-common/src/directive_definition.rs @@ -80,7 +80,7 @@ pub fn into_directive_definition( TypeSystemDefinition::Directive(pos(async_graphql::parser::types::DirectiveDefinition { description: description.map(|inner| pos(inner.clone())), name: pos(Name::new(name)), - arguments: into_input_value_definition(&schema), + arguments: into_input_value_definition(schema), is_repeatable: attrs.repeatable, locations: attrs .locations diff --git a/tailcall-typedefs-common/src/enum_definition.rs b/tailcall-typedefs-common/src/enum_definition.rs index 59b96413f4..6ffa67063f 100644 --- a/tailcall-typedefs-common/src/enum_definition.rs +++ b/tailcall-typedefs-common/src/enum_definition.rs @@ -4,9 +4,21 @@ use async_graphql::parser::types::{ use async_graphql::{Name, Positioned}; use schemars::schema::Schema; +#[derive(Debug)] +pub struct EnumVariant { + pub value: String, + pub description: Option>, +} + +impl EnumVariant { + pub fn new(value: String) -> Self { + Self { value, description: None } + } +} + #[derive(Debug)] pub struct EnumValue { - pub variants: Vec, + pub variants: Vec, pub description: Option>, } @@ -14,15 +26,16 @@ use crate::common::{get_description, pos}; pub fn into_enum_definition(enum_value: EnumValue, name: &str) -> TypeSystemDefinition { let mut enum_value_definition = vec![]; - for enum_value in enum_value.variants { - let formatted_value: String = enum_value + for enum_variant in enum_value.variants { + let formatted_value: String = enum_variant + .value .to_string() .chars() .filter(|ch| ch != &'"') .collect(); enum_value_definition.push(pos(EnumValueDefinition { value: pos(Name::new(formatted_value)), - description: None, + description: enum_variant.description, directives: vec![], })); } @@ -39,16 +52,49 @@ pub fn into_enum_definition(enum_value: EnumValue, name: &str) -> TypeSystemDefi pub fn into_enum_value(obj: &Schema) -> Option { match obj { Schema::Object(schema_object) => { - let description = get_description(schema_object); + let description = + get_description(schema_object).map(|description| pos(description.to_owned())); + + // if it has enum_values then it's raw enum if let Some(enum_values) = &schema_object.enum_values { return Some(EnumValue { variants: enum_values .iter() - .map(|val| val.to_string()) - .collect::>(), - description: description.map(|description| pos(description.to_owned())), + .map(|val| EnumVariant::new(val.to_string())) + .collect::>(), + description, }); } + + // in case enum has description docs for the variants they will be generated + // as schema with `one_of` entry, where every enum variant is separate enum + // entry + if let Some(subschema) = &schema_object.subschemas { + if let Some(one_ofs) = &subschema.one_of { + let variants = one_ofs + .iter() + .filter_map(|one_of| { + // try to parse one_of value as enum + into_enum_value(one_of).and_then(|mut en| { + // if it has only single variant it's our high-level enum + if en.variants.len() == 1 { + Some(EnumVariant { + value: en.variants.pop().unwrap().value, + description: en.description, + }) + } else { + None + } + }) + }) + .collect::>(); + + if !variants.is_empty() { + return Some(EnumValue { variants, description }); + } + } + } + None } _ => None, diff --git a/tailcall-typedefs-common/src/input_definition.rs b/tailcall-typedefs-common/src/input_definition.rs index 0d8819c8ef..086722e2d2 100644 --- a/tailcall-typedefs-common/src/input_definition.rs +++ b/tailcall-typedefs-common/src/input_definition.rs @@ -14,27 +14,27 @@ pub trait InputDefinition { } pub fn into_input_definition(schema: SchemaObject, name: &str) -> TypeSystemDefinition { - let description = get_description(&schema); + let description = get_description(&schema).cloned(); TypeSystemDefinition::Type(pos(TypeDefinition { name: pos(Name::new(name)), kind: TypeKind::InputObject(InputObjectType { - fields: into_input_value_definition(&schema), + fields: into_input_value_definition(schema), }), - description: description.map(|inner| pos(inner.clone())), + description: description.map(pos), directives: vec![], extend: false, })) } -pub fn into_input_value_definition(schema: &SchemaObject) -> Vec> { +pub fn into_input_value_definition(schema: SchemaObject) -> Vec> { let mut arguments_type = vec![]; if let Some(subschema) = schema.subschemas.clone() { let list = subschema.any_of.or(subschema.all_of).or(subschema.one_of); if let Some(list) = list { for schema in list { let schema_object = schema.into_object(); - arguments_type.extend(build_arguments_type(&schema_object)); + arguments_type.extend(build_arguments_type(schema_object)); } return arguments_type; @@ -44,22 +44,19 @@ pub fn into_input_value_definition(schema: &SchemaObject) -> Vec Vec> { +fn build_arguments_type(schema: SchemaObject) -> Vec> { let mut arguments = vec![]; - if let Some(properties) = schema - .object - .as_ref() - .map(|object| object.properties.clone()) - { - for (name, property) in properties.into_iter() { + if let Some(obj) = schema.object { + let required = obj.required; + for (name, property) in obj.properties.into_iter() { let property = property.into_object(); let description = get_description(&property); + let nullable = !required.contains(&name); let definition = pos(InputValueDefinition { description: description.map(|inner| pos(inner.to_owned())), name: pos(Name::new(&name)), ty: pos(determine_input_value_type_from_schema( - name, - property.clone(), + name, &property, nullable, )), default_value: None, directives: Vec::new(), @@ -72,7 +69,11 @@ fn build_arguments_type(schema: &SchemaObject) -> Vec Type { +fn determine_input_value_type_from_schema( + mut name: String, + schema: &SchemaObject, + nullable: bool, +) -> Type { first_char_to_upper(&mut name); if let Some(instance_type) = &schema.instance_type { match instance_type { @@ -82,10 +83,10 @@ fn determine_input_value_type_from_schema(mut name: String, schema: SchemaObject | InstanceType::Number | InstanceType::String | InstanceType::Integer => Type { - nullable: false, + nullable, base: BaseType::Named(Name::new(get_instance_type_name(typ))), }, - _ => determine_type_from_schema(name, &schema), + _ => determine_type_from_schema(name, schema), }, SingleOrVec::Vec(typ) => match typ.first().unwrap() { InstanceType::Null @@ -93,14 +94,14 @@ fn determine_input_value_type_from_schema(mut name: String, schema: SchemaObject | InstanceType::Number | InstanceType::String | InstanceType::Integer => Type { - nullable: true, + nullable, base: BaseType::Named(Name::new(get_instance_type_name(typ.first().unwrap()))), }, - _ => determine_type_from_schema(name, &schema), + _ => determine_type_from_schema(name, schema), }, } } else { - determine_type_from_schema(name, &schema) + determine_type_from_schema(name, schema) } } @@ -145,14 +146,16 @@ fn determine_type_from_arr_valid(name: String, array_valid: &ArrayValidation) -> nullable: true, base: BaseType::List(Box::new(determine_input_value_type_from_schema( name, - schema.clone().into_object(), + &schema.clone().into_object(), + false, ))), }, SingleOrVec::Vec(schemas) => Type { nullable: true, base: BaseType::List(Box::new(determine_input_value_type_from_schema( name, - schemas[0].clone().into_object(), + &schemas[0].clone().into_object(), + false, ))), }, } diff --git a/tailcall-typedefs/src/main.rs b/tailcall-typedefs/src/main.rs index 4023a02089..aecf725b24 100644 --- a/tailcall-typedefs/src/main.rs +++ b/tailcall-typedefs/src/main.rs @@ -1,7 +1,8 @@ mod gen_gql_schema; use std::env; -use std::path::PathBuf; +use std::ops::Deref; +use std::path::{Path, PathBuf}; use std::process::exit; use std::sync::Arc; @@ -15,8 +16,8 @@ use tailcall::core::config::Config; use tailcall::core::tracing::default_tracing_for_name; use tailcall::core::{scalar, FileIO}; -static JSON_SCHEMA_FILE: &str = "../generated/.tailcallrc.schema.json"; -static GRAPHQL_SCHEMA_FILE: &str = "../generated/.tailcallrc.graphql"; +static JSON_SCHEMA_FILE: &str = "generated/.tailcallrc.schema.json"; +static GRAPHQL_SCHEMA_FILE: &str = "generated/.tailcallrc.graphql"; #[tokio::main] async fn main() { @@ -51,9 +52,17 @@ async fn main() { } async fn mode_check() -> Result<()> { - let json_schema = get_file_path(); let rt = cli::runtime::init(&Default::default()); - let file_io = rt.file; + let file_io = rt.file.deref(); + + check_json(file_io).await?; + check_graphql(file_io).await?; + + Ok(()) +} + +async fn check_json(file_io: &dyn FileIO) -> Result<()> { + let json_schema = get_json_path(); let content = file_io .read( json_schema @@ -62,10 +71,26 @@ async fn mode_check() -> Result<()> { ) .await?; let content = serde_json::from_str::(&content)?; - let schema = get_updated_json().await?; + let schema = get_updated_json()?; match content.eq(&schema) { true => Ok(()), - false => Err(anyhow!("Schema mismatch")), + false => Err(anyhow!("Schema file '{}' mismatch", JSON_SCHEMA_FILE)), + } +} + +async fn check_graphql(file_io: &dyn FileIO) -> Result<()> { + let graphql_schema = get_graphql_path(); + let content = file_io + .read( + graphql_schema + .to_str() + .ok_or(anyhow!("Unable to determine path"))?, + ) + .await?; + let schema = get_updated_graphql(); + match content.eq(&schema) { + true => Ok(()), + false => Err(anyhow!("Schema file '{}' mismatch", GRAPHQL_SCHEMA_FILE)), } } @@ -74,27 +99,28 @@ async fn mode_fix() -> Result<()> { let file_io = rt.file; update_json(file_io.clone()).await?; - update_gql(file_io.clone()).await?; + update_graphql(file_io.clone()).await?; Ok(()) } -async fn update_gql(file_io: Arc) -> Result<()> { - let doc = gen_gql_schema::build_service_document(); +async fn update_graphql(file_io: Arc) -> Result<()> { + let schema = get_updated_graphql(); - let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(GRAPHQL_SCHEMA_FILE); + let path = get_graphql_path(); + tracing::info!("Updating Graphql Schema: {}", GRAPHQL_SCHEMA_FILE); file_io .write( path.to_str().ok_or(anyhow!("Unable to determine path"))?, - tailcall::core::document::print(doc).as_bytes(), + schema.as_bytes(), ) .await?; Ok(()) } async fn update_json(file_io: Arc) -> Result<()> { - let path = get_file_path(); - let schema = serde_json::to_string_pretty(&get_updated_json().await?)?; - tracing::info!("Updating JSON Schema: {}", path.to_str().unwrap()); + let path = get_json_path(); + let schema = serde_json::to_string_pretty(&get_updated_json()?)?; + tracing::info!("Updating JSON Schema: {}", JSON_SCHEMA_FILE); file_io .write( path.to_str().ok_or(anyhow!("Unable to determine path"))?, @@ -104,11 +130,19 @@ async fn update_json(file_io: Arc) -> Result<()> { Ok(()) } -fn get_file_path() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(JSON_SCHEMA_FILE) +fn get_root_path() -> &'static Path { + Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap() +} + +fn get_json_path() -> PathBuf { + get_root_path().join(JSON_SCHEMA_FILE) } -async fn get_updated_json() -> Result { +fn get_graphql_path() -> PathBuf { + get_root_path().join(GRAPHQL_SCHEMA_FILE) +} + +fn get_updated_json() -> Result { let mut schema: RootSchema = schemars::schema_for!(Config); let scalar = scalar::Scalar::iter() .map(|scalar| (scalar.name(), scalar.schema())) @@ -118,3 +152,9 @@ async fn get_updated_json() -> Result { let schema = json!(schema); Ok(schema) } + +fn get_updated_graphql() -> String { + let doc = gen_gql_schema::build_service_document(); + + tailcall::core::document::print(doc) +} diff --git a/tests/cli/fixtures/generator/gen_deezer.md b/tests/cli/fixtures/generator/gen_deezer.md index 744b7e1bc8..3dc19e88d3 100644 --- a/tests/cli/fixtures/generator/gen_deezer.md +++ b/tests/cli/fixtures/generator/gen_deezer.md @@ -56,8 +56,7 @@ "inferTypeNames": true }, "output": { - "path": "./output.graphql", - "format": "graphQL" + "path": "./output.graphql" }, "schema": { "query": "Query" diff --git a/tests/cli/fixtures/generator/gen_json_proto_mix_config.md b/tests/cli/fixtures/generator/gen_json_proto_mix_config.md index 5fe595e5f0..42a8406490 100644 --- a/tests/cli/fixtures/generator/gen_json_proto_mix_config.md +++ b/tests/cli/fixtures/generator/gen_json_proto_mix_config.md @@ -20,8 +20,7 @@ "treeShake": true }, "output": { - "path": "./output.graphql", - "format": "graphQL" + "path": "./output.graphql" }, "schema": { "query": "Query" diff --git a/tests/cli/fixtures/generator/gen_jsonplaceholder.md b/tests/cli/fixtures/generator/gen_jsonplaceholder.md index 9c3066ff49..d1f6335ea2 100644 --- a/tests/cli/fixtures/generator/gen_jsonplaceholder.md +++ b/tests/cli/fixtures/generator/gen_jsonplaceholder.md @@ -78,8 +78,7 @@ "inferTypeNames": true }, "output": { - "path": "./output.graphql", - "format": "graphQL" + "path": "./output.graphql" }, "schema": { "query": "Query" diff --git a/tests/cli/fixtures/generator/gen_proto_with_proto_paths_config.md b/tests/cli/fixtures/generator/gen_proto_with_proto_paths_config.md new file mode 100644 index 0000000000..5b508368e3 --- /dev/null +++ b/tests/cli/fixtures/generator/gen_proto_with_proto_paths_config.md @@ -0,0 +1,30 @@ +```json @config +{ + "inputs": [ + { + "curl": { + "src": "http://jsonplaceholder.typicode.com/users", + "fieldName": "users" + } + }, + { + "proto": { + "src": "tailcall-fixtures/fixtures/protobuf/news_proto_paths.proto", + "url": "http://localhost:50051", + "protoPaths": ["tailcall-fixtures/fixtures/"] + } + } + ], + "preset": { + "mergeType": 1.0, + "inferTypeNames": true, + "treeShake": true + }, + "output": { + "path": "./output.graphql" + }, + "schema": { + "query": "Query" + } +} +``` diff --git a/tests/cli/fixtures/generator/proto-connect-rpc.md b/tests/cli/fixtures/generator/proto-connect-rpc.md new file mode 100644 index 0000000000..8bbe9bde78 --- /dev/null +++ b/tests/cli/fixtures/generator/proto-connect-rpc.md @@ -0,0 +1,30 @@ +```json @config +{ + "inputs": [ + { + "curl": { + "src": "http://jsonplaceholder.typicode.com/users", + "fieldName": "users" + } + }, + { + "proto": { + "src": "tailcall-fixtures/fixtures/protobuf/news.proto", + "url": "http://localhost:50051", + "connectRPC": true + } + } + ], + "preset": { + "mergeType": 1.0, + "inferTypeNames": true, + "treeShake": true + }, + "output": { + "path": "./output.graphql" + }, + "schema": { + "query": "Query" + } +} +``` diff --git a/tests/cli/parser.rs b/tests/cli/parser.rs index 32d826f953..23bf6f67cf 100644 --- a/tests/cli/parser.rs +++ b/tests/cli/parser.rs @@ -106,7 +106,7 @@ impl ExecutionSpec { "env" => { let vars: HashMap = match source { Source::Json => Ok(serde_json::from_str(&content)?), - Source::Yml => Ok(serde_yaml::from_str(&content)?), + Source::Yml => Ok(serde_yaml_ng::from_str(&content)?), _ => Err(anyhow!("Unexpected language in env block in {:?} (only JSON and YAML are supported)", path)), }?; diff --git a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_deezer.md.snap b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_deezer.md.snap index a35abec942..d1a0f9d29f 100644 --- a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_deezer.md.snap +++ b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_deezer.md.snap @@ -1,6 +1,7 @@ --- source: tests/cli/gen.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_json_proto_mix_config.md.snap b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_json_proto_mix_config.md.snap index e5123e7567..160f27d421 100644 --- a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_json_proto_mix_config.md.snap +++ b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_json_proto_mix_config.md.snap @@ -1,13 +1,14 @@ --- source: tests/cli/gen.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream { query: Query } -input GEN__news__MultipleNewsId @addField(name: "ids", path: ["ids", "id"]) { - ids: [Id]@omit +input GEN__news__MultipleNewsId { + ids: [Id] } input GEN__news__NewsInput { diff --git a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_jsonplaceholder.md.snap b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_jsonplaceholder.md.snap index ed5c4a6229..ddf6fa2e87 100644 --- a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_jsonplaceholder.md.snap +++ b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_jsonplaceholder.md.snap @@ -1,6 +1,7 @@ --- source: tests/cli/gen.rs expression: config.to_sdl() +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["Accept", "Content-Type"]) { query: Query diff --git a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_proto_with_proto_paths_config.md.snap b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_proto_with_proto_paths_config.md.snap new file mode 100644 index 0000000000..160f27d421 --- /dev/null +++ b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__gen_proto_with_proto_paths_config.md.snap @@ -0,0 +1,82 @@ +--- +source: tests/cli/gen.rs +expression: config.to_sdl() +snapshot_kind: text +--- +schema @server @upstream { + query: Query +} + +input GEN__news__MultipleNewsId { + ids: [Id] +} + +input GEN__news__NewsInput { + body: String + id: Int + postImage: String + status: Status + title: String +} + +input Id { + id: Int +} + +enum Status { + DELETED + DRAFT + PUBLISHED +} + +type Address { + city: String + geo: Geo + street: String + suite: String + zipcode: String +} + +type Company { + bs: String + catchPhrase: String + name: String +} + +type GEN__news__NewsList { + news: [News] +} + +type Geo { + lat: String + lng: String +} + +type News { + body: String + id: Int + postImage: String + status: Status + title: String +} + +type Query { + GEN__news__NewsService__AddNews(news: GEN__news__NewsInput!): News @grpc(url: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.AddNews") + GEN__news__NewsService__DeleteNews(newsId: Id!): Empty @grpc(url: "http://localhost:50051", body: "{{.args.newsId}}", method: "news.NewsService.DeleteNews") + GEN__news__NewsService__EditNews(news: GEN__news__NewsInput!): News @grpc(url: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.EditNews") + GEN__news__NewsService__GetAllNews: GEN__news__NewsList @grpc(url: "http://localhost:50051", method: "news.NewsService.GetAllNews") + GEN__news__NewsService__GetMultipleNews(multipleNewsId: GEN__news__MultipleNewsId!): GEN__news__NewsList @grpc(url: "http://localhost:50051", body: "{{.args.multipleNewsId}}", method: "news.NewsService.GetMultipleNews") + GEN__news__NewsService__GetNews(newsId: Id!): News @grpc(url: "http://localhost:50051", body: "{{.args.newsId}}", method: "news.NewsService.GetNews") + users: [User] @http(url: "http://jsonplaceholder.typicode.com/users") +} + +type User { + address: Address + company: Company + email: String + id: Int + name: String + phone: String + username: String + website: String +} diff --git a/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__proto-connect-rpc.md.snap b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__proto-connect-rpc.md.snap new file mode 100644 index 0000000000..0a12fd5dc6 --- /dev/null +++ b/tests/cli/snapshots/cli_spec__test__generator_spec__tests__cli__fixtures__generator__proto-connect-rpc.md.snap @@ -0,0 +1,82 @@ +--- +source: tests/cli/gen.rs +expression: config.to_sdl() +snapshot_kind: text +--- +schema @server @upstream { + query: Query +} + +input GEN__news__MultipleNewsId { + ids: [Id] +} + +input GEN__news__NewsInput { + body: String + id: Int + postImage: String + status: Status + title: String +} + +input Id { + id: Int +} + +enum Status { + DELETED + DRAFT + PUBLISHED +} + +type Address { + city: String + geo: Geo + street: String + suite: String + zipcode: String +} + +type Company { + bs: String + catchPhrase: String + name: String +} + +type GEN__news__NewsList { + news: [News] +} + +type Geo { + lat: String + lng: String +} + +type News { + body: String + id: Int + postImage: String + status: Status + title: String +} + +type Query { + GEN__news__NewsService__AddNews(news: GEN__news__NewsInput!): News @http(url: "http://localhost:50051/news.NewsService/AddNews", body: "{{.args.news}}", method: "POST") + GEN__news__NewsService__DeleteNews(newsId: Id!): Empty @http(url: "http://localhost:50051/news.NewsService/DeleteNews", body: "{{.args.newsId}}", method: "POST") + GEN__news__NewsService__EditNews(news: GEN__news__NewsInput!): News @http(url: "http://localhost:50051/news.NewsService/EditNews", body: "{{.args.news}}", method: "POST") + GEN__news__NewsService__GetAllNews: GEN__news__NewsList @http(url: "http://localhost:50051/news.NewsService/GetAllNews", body: {}, method: "POST") + GEN__news__NewsService__GetMultipleNews(multipleNewsId: GEN__news__MultipleNewsId!): GEN__news__NewsList @http(url: "http://localhost:50051/news.NewsService/GetMultipleNews", body: "{{.args.multipleNewsId}}", method: "POST") + GEN__news__NewsService__GetNews(newsId: Id!): News @http(url: "http://localhost:50051/news.NewsService/GetNews", body: "{{.args.newsId}}", method: "POST") + users: [User] @http(url: "http://jsonplaceholder.typicode.com/users") +} + +type User { + address: Address + company: Company + email: String + id: Int + name: String + phone: String + username: String + website: String +} diff --git a/tests/core/parse.rs b/tests/core/parse.rs index 00744100cc..a438a31e89 100644 --- a/tests/core/parse.rs +++ b/tests/core/parse.rs @@ -179,7 +179,7 @@ impl ExecutionSpec { if mock.is_none() { mock = match source { Source::Json => Ok(serde_json::from_str(&content)?), - Source::Yml => Ok(serde_yaml::from_str(&content)?), + Source::Yml => Ok(serde_yaml_ng::from_str(&content)?), _ => Err(anyhow!("Unexpected language in mock block in {:?} (only JSON and YAML are supported)", path)), }?; } else { @@ -190,7 +190,7 @@ impl ExecutionSpec { if env.is_none() { env = match source { Source::Json => Ok(serde_json::from_str(&content)?), - Source::Yml => Ok(serde_yaml::from_str(&content)?), + Source::Yml => Ok(serde_yaml_ng::from_str(&content)?), _ => Err(anyhow!("Unexpected language in env block in {:?} (only JSON and YAML are supported)", path)), }?; } else { @@ -201,7 +201,7 @@ impl ExecutionSpec { if test.is_none() { test = match source { Source::Json => Ok(serde_json::from_str(&content)?), - Source::Yml => Ok(serde_yaml::from_str(&content)?), + Source::Yml => Ok(serde_yaml_ng::from_str(&content)?), _ => Err(anyhow!("Unexpected language in test block in {:?} (only JSON and YAML are supported)", path)), }?; } else { diff --git a/tests/core/snapshots/add-field-index-list.md_0.snap b/tests/core/snapshots/add-field-index-list.md_0.snap index a5b7c188b6..5316822d92 100644 --- a/tests/core/snapshots/add-field-index-list.md_0.snap +++ b/tests/core/snapshots/add-field-index-list.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/add-field-index-list.md_client.snap b/tests/core/snapshots/add-field-index-list.md_client.snap index 0621209324..93420ff53f 100644 --- a/tests/core/snapshots/add-field-index-list.md_client.snap +++ b/tests/core/snapshots/add-field-index-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { username: String diff --git a/tests/core/snapshots/add-field-index-list.md_merged.snap b/tests/core/snapshots/add-field-index-list.md_merged.snap index 2e2d9544a5..83b7126da0 100644 --- a/tests/core/snapshots/add-field-index-list.md_merged.snap +++ b/tests/core/snapshots/add-field-index-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/add-field-many-list.md_client.snap b/tests/core/snapshots/add-field-many-list.md_client.snap index 2de3b45764..459e0a5c84 100644 --- a/tests/core/snapshots/add-field-many-list.md_client.snap +++ b/tests/core/snapshots/add-field-many-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type A { b: [String] diff --git a/tests/core/snapshots/add-field-many-list.md_merged.snap b/tests/core/snapshots/add-field-many-list.md_merged.snap index cd3c909596..80606fd2c7 100644 --- a/tests/core/snapshots/add-field-many-list.md_merged.snap +++ b/tests/core/snapshots/add-field-many-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/add-field-many.md_client.snap b/tests/core/snapshots/add-field-many.md_client.snap index 9faf468474..a634b0702c 100644 --- a/tests/core/snapshots/add-field-many.md_client.snap +++ b/tests/core/snapshots/add-field-many.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Foo { a: String diff --git a/tests/core/snapshots/add-field-many.md_merged.snap b/tests/core/snapshots/add-field-many.md_merged.snap index 949429e670..1cd7979460 100644 --- a/tests/core/snapshots/add-field-many.md_merged.snap +++ b/tests/core/snapshots/add-field-many.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/add-field-modify.md_0.snap b/tests/core/snapshots/add-field-modify.md_0.snap index 0e5c653400..fc260d1e65 100644 --- a/tests/core/snapshots/add-field-modify.md_0.snap +++ b/tests/core/snapshots/add-field-modify.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/add-field-modify.md_client.snap b/tests/core/snapshots/add-field-modify.md_client.snap index 5415fb1a15..fda2fe027b 100644 --- a/tests/core/snapshots/add-field-modify.md_client.snap +++ b/tests/core/snapshots/add-field-modify.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Address { city: String diff --git a/tests/core/snapshots/add-field-modify.md_merged.snap b/tests/core/snapshots/add-field-modify.md_merged.snap index 983ec36527..d4d6474fcc 100644 --- a/tests/core/snapshots/add-field-modify.md_merged.snap +++ b/tests/core/snapshots/add-field-modify.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/add-field-with-composition.md_0.snap b/tests/core/snapshots/add-field-with-composition.md_0.snap index 68e1ab14ee..5dd800158d 100644 --- a/tests/core/snapshots/add-field-with-composition.md_0.snap +++ b/tests/core/snapshots/add-field-with-composition.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/add-field-with-composition.md_1.snap b/tests/core/snapshots/add-field-with-composition.md_1.snap index cbe3b96cf9..9d4df79f86 100644 --- a/tests/core/snapshots/add-field-with-composition.md_1.snap +++ b/tests/core/snapshots/add-field-with-composition.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/add-field-with-composition.md_client.snap b/tests/core/snapshots/add-field-with-composition.md_client.snap index b46761f427..dacc639c2a 100644 --- a/tests/core/snapshots/add-field-with-composition.md_client.snap +++ b/tests/core/snapshots/add-field-with-composition.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Address { geo: Geo diff --git a/tests/core/snapshots/add-field-with-composition.md_merged.snap b/tests/core/snapshots/add-field-with-composition.md_merged.snap index 6c517c2f1c..e6879805cb 100644 --- a/tests/core/snapshots/add-field-with-composition.md_merged.snap +++ b/tests/core/snapshots/add-field-with-composition.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/add-field-with-modify.md_0.snap b/tests/core/snapshots/add-field-with-modify.md_0.snap index f6d155936f..7f39f78b41 100644 --- a/tests/core/snapshots/add-field-with-modify.md_0.snap +++ b/tests/core/snapshots/add-field-with-modify.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/add-field-with-modify.md_1.snap b/tests/core/snapshots/add-field-with-modify.md_1.snap index 7dbe361ffc..571b7aefc2 100644 --- a/tests/core/snapshots/add-field-with-modify.md_1.snap +++ b/tests/core/snapshots/add-field-with-modify.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/add-field-with-modify.md_client.snap b/tests/core/snapshots/add-field-with-modify.md_client.snap index 495d594bc1..2a995d66b8 100644 --- a/tests/core/snapshots/add-field-with-modify.md_client.snap +++ b/tests/core/snapshots/add-field-with-modify.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { person1: User diff --git a/tests/core/snapshots/add-field-with-modify.md_merged.snap b/tests/core/snapshots/add-field-with-modify.md_merged.snap index 9fedd3356b..6541ffad9b 100644 --- a/tests/core/snapshots/add-field-with-modify.md_merged.snap +++ b/tests/core/snapshots/add-field-with-modify.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/add-field.md_0.snap b/tests/core/snapshots/add-field.md_0.snap index 46dcd8c3b2..309c9484e9 100644 --- a/tests/core/snapshots/add-field.md_0.snap +++ b/tests/core/snapshots/add-field.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/add-field.md_client.snap b/tests/core/snapshots/add-field.md_client.snap index ade40aa4a1..59dc2b31b1 100644 --- a/tests/core/snapshots/add-field.md_client.snap +++ b/tests/core/snapshots/add-field.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Address { geo: Geo diff --git a/tests/core/snapshots/add-field.md_merged.snap b/tests/core/snapshots/add-field.md_merged.snap index 8b39ec30f5..8f31490b9f 100644 --- a/tests/core/snapshots/add-field.md_merged.snap +++ b/tests/core/snapshots/add-field.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/apollo-federation-entities-batch.md_0.snap b/tests/core/snapshots/apollo-federation-entities-batch.md_0.snap index cdd18ea9a9..8530bc6c9e 100644 --- a/tests/core/snapshots/apollo-federation-entities-batch.md_0.snap +++ b/tests/core/snapshots/apollo-federation-entities-batch.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/apollo-federation-entities-batch.md_1.snap b/tests/core/snapshots/apollo-federation-entities-batch.md_1.snap index 53faa2e036..358a041cd5 100644 --- a/tests/core/snapshots/apollo-federation-entities-batch.md_1.snap +++ b/tests/core/snapshots/apollo-federation-entities-batch.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/apollo-federation-entities-batch.md_client.snap b/tests/core/snapshots/apollo-federation-entities-batch.md_client.snap index 240fff3b5b..2f54cc63f9 100644 --- a/tests/core/snapshots/apollo-federation-entities-batch.md_client.snap +++ b/tests/core/snapshots/apollo-federation-entities-batch.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int! diff --git a/tests/core/snapshots/apollo-federation-entities-batch.md_merged.snap b/tests/core/snapshots/apollo-federation-entities-batch.md_merged.snap index 8511079c2c..d85e9f7717 100644 --- a/tests/core/snapshots/apollo-federation-entities-batch.md_merged.snap +++ b/tests/core/snapshots/apollo-federation-entities-batch.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(enableFederation: true, port: 8000) @upstream(batch: {delay: 100, headers: []}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/apollo-federation-entities-validation.md_error.snap b/tests/core/snapshots/apollo-federation-entities-validation.md_error.snap index 876c8e3ed9..80fc5eaabe 100644 --- a/tests/core/snapshots/apollo-federation-entities-validation.md_error.snap +++ b/tests/core/snapshots/apollo-federation-entities-validation.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/apollo-federation-entities.md_0.snap b/tests/core/snapshots/apollo-federation-entities.md_0.snap index 071a6837f3..76942f93e3 100644 --- a/tests/core/snapshots/apollo-federation-entities.md_0.snap +++ b/tests/core/snapshots/apollo-federation-entities.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/apollo-federation-entities.md_1.snap b/tests/core/snapshots/apollo-federation-entities.md_1.snap index 53faa2e036..358a041cd5 100644 --- a/tests/core/snapshots/apollo-federation-entities.md_1.snap +++ b/tests/core/snapshots/apollo-federation-entities.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/apollo-federation-entities.md_client.snap b/tests/core/snapshots/apollo-federation-entities.md_client.snap index 240fff3b5b..2f54cc63f9 100644 --- a/tests/core/snapshots/apollo-federation-entities.md_client.snap +++ b/tests/core/snapshots/apollo-federation-entities.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int! diff --git a/tests/core/snapshots/apollo-federation-entities.md_merged.snap b/tests/core/snapshots/apollo-federation-entities.md_merged.snap index dd26a0e9a3..e18bcb796d 100644 --- a/tests/core/snapshots/apollo-federation-entities.md_merged.snap +++ b/tests/core/snapshots/apollo-federation-entities.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(enableFederation: true, port: 8000) diff --git a/tests/core/snapshots/apollo-federation-validation.md_error.snap b/tests/core/snapshots/apollo-federation-validation.md_error.snap index fb321eb5ae..0ecf8a83bd 100644 --- a/tests/core/snapshots/apollo-federation-validation.md_error.snap +++ b/tests/core/snapshots/apollo-federation-validation.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/apollo-tracing.md_0.snap b/tests/core/snapshots/apollo-tracing.md_0.snap index d1aa07b391..24dccb3955 100644 --- a/tests/core/snapshots/apollo-tracing.md_0.snap +++ b/tests/core/snapshots/apollo-tracing.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/apollo-tracing.md_client.snap b/tests/core/snapshots/apollo-tracing.md_client.snap index d07b38f527..3d053758db 100644 --- a/tests/core/snapshots/apollo-tracing.md_client.snap +++ b/tests/core/snapshots/apollo-tracing.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { hello: String! diff --git a/tests/core/snapshots/apollo-tracing.md_merged.snap b/tests/core/snapshots/apollo-tracing.md_merged.snap index 330ab43603..e7ca2b0596 100644 --- a/tests/core/snapshots/apollo-tracing.md_merged.snap +++ b/tests/core/snapshots/apollo-tracing.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/async-cache-disabled.md_0.snap b/tests/core/snapshots/async-cache-disabled.md_0.snap index 96461ffba6..6f5dc445e8 100644 --- a/tests/core/snapshots/async-cache-disabled.md_0.snap +++ b/tests/core/snapshots/async-cache-disabled.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/async-cache-disabled.md_client.snap b/tests/core/snapshots/async-cache-disabled.md_client.snap index ffe1589053..285a44bbfb 100644 --- a/tests/core/snapshots/async-cache-disabled.md_client.snap +++ b/tests/core/snapshots/async-cache-disabled.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/async-cache-disabled.md_merged.snap b/tests/core/snapshots/async-cache-disabled.md_merged.snap index 6fb6ca4f37..19034b2930 100644 --- a/tests/core/snapshots/async-cache-disabled.md_merged.snap +++ b/tests/core/snapshots/async-cache-disabled.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) @upstream { query: Query diff --git a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_0.snap b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_0.snap index 5774eaa25a..79cef1ba6a 100644 --- a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_0.snap +++ b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap index a1e6771d53..408aa1959f 100644 --- a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap +++ b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_merged.snap b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_merged.snap index 1b3803ad06..9b23299848 100644 --- a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_merged.snap +++ b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) @upstream { query: Query diff --git a/tests/core/snapshots/async-cache-enabled.md_0.snap b/tests/core/snapshots/async-cache-enabled.md_0.snap index b2709ed123..0032dadd59 100644 --- a/tests/core/snapshots/async-cache-enabled.md_0.snap +++ b/tests/core/snapshots/async-cache-enabled.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/async-cache-enabled.md_client.snap b/tests/core/snapshots/async-cache-enabled.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/async-cache-enabled.md_client.snap +++ b/tests/core/snapshots/async-cache-enabled.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/async-cache-enabled.md_merged.snap b/tests/core/snapshots/async-cache-enabled.md_merged.snap index 3506d4506b..5a9eaefc3d 100644 --- a/tests/core/snapshots/async-cache-enabled.md_merged.snap +++ b/tests/core/snapshots/async-cache-enabled.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) @upstream { query: Query diff --git a/tests/core/snapshots/async-cache-global.md_0.snap b/tests/core/snapshots/async-cache-global.md_0.snap index 62ed8b07b6..7bd6ff89bb 100644 --- a/tests/core/snapshots/async-cache-global.md_0.snap +++ b/tests/core/snapshots/async-cache-global.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/async-cache-global.md_client.snap b/tests/core/snapshots/async-cache-global.md_client.snap index c48b74aa3d..5335b2d393 100644 --- a/tests/core/snapshots/async-cache-global.md_client.snap +++ b/tests/core/snapshots/async-cache-global.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/async-cache-global.md_merged.snap b/tests/core/snapshots/async-cache-global.md_merged.snap index 628bcda6e6..d753b1f6fa 100644 --- a/tests/core/snapshots/async-cache-global.md_merged.snap +++ b/tests/core/snapshots/async-cache-global.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) @upstream { query: Query diff --git a/tests/core/snapshots/async-cache-inflight-request.md_0.snap b/tests/core/snapshots/async-cache-inflight-request.md_0.snap index b2709ed123..0032dadd59 100644 --- a/tests/core/snapshots/async-cache-inflight-request.md_0.snap +++ b/tests/core/snapshots/async-cache-inflight-request.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/async-cache-inflight-request.md_client.snap b/tests/core/snapshots/async-cache-inflight-request.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/async-cache-inflight-request.md_client.snap +++ b/tests/core/snapshots/async-cache-inflight-request.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/async-cache-inflight-request.md_merged.snap b/tests/core/snapshots/async-cache-inflight-request.md_merged.snap index 3506d4506b..5a9eaefc3d 100644 --- a/tests/core/snapshots/async-cache-inflight-request.md_merged.snap +++ b/tests/core/snapshots/async-cache-inflight-request.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) @upstream { query: Query diff --git a/tests/core/snapshots/auth-basic.md_0.snap b/tests/core/snapshots/auth-basic.md_0.snap index 19966dbd12..60f7ffff7f 100644 --- a/tests/core/snapshots/auth-basic.md_0.snap +++ b/tests/core/snapshots/auth-basic.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-basic.md_3.snap b/tests/core/snapshots/auth-basic.md_3.snap index 5a8bbd2fd3..8a1605ad84 100644 --- a/tests/core/snapshots/auth-basic.md_3.snap +++ b/tests/core/snapshots/auth-basic.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-basic.md_5.snap b/tests/core/snapshots/auth-basic.md_5.snap index 1afd85d51b..48b019c813 100644 --- a/tests/core/snapshots/auth-basic.md_5.snap +++ b/tests/core/snapshots/auth-basic.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-basic.md_client.snap b/tests/core/snapshots/auth-basic.md_client.snap index 4b69aeb528..25d3727b0f 100644 --- a/tests/core/snapshots/auth-basic.md_client.snap +++ b/tests/core/snapshots/auth-basic.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Mutation { protectedType: ProtectedType diff --git a/tests/core/snapshots/auth-basic.md_merged.snap b/tests/core/snapshots/auth-basic.md_merged.snap index 7317c1c588..a7faae5b0f 100644 --- a/tests/core/snapshots/auth-basic.md_merged.snap +++ b/tests/core/snapshots/auth-basic.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) { query: Query diff --git a/tests/core/snapshots/auth-jwt.md_0.snap b/tests/core/snapshots/auth-jwt.md_0.snap index 19966dbd12..60f7ffff7f 100644 --- a/tests/core/snapshots/auth-jwt.md_0.snap +++ b/tests/core/snapshots/auth-jwt.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-jwt.md_2.snap b/tests/core/snapshots/auth-jwt.md_2.snap index 5a8bbd2fd3..8a1605ad84 100644 --- a/tests/core/snapshots/auth-jwt.md_2.snap +++ b/tests/core/snapshots/auth-jwt.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-jwt.md_4.snap b/tests/core/snapshots/auth-jwt.md_4.snap index 1afd85d51b..48b019c813 100644 --- a/tests/core/snapshots/auth-jwt.md_4.snap +++ b/tests/core/snapshots/auth-jwt.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-jwt.md_client.snap b/tests/core/snapshots/auth-jwt.md_client.snap index 4b69aeb528..25d3727b0f 100644 --- a/tests/core/snapshots/auth-jwt.md_client.snap +++ b/tests/core/snapshots/auth-jwt.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Mutation { protectedType: ProtectedType diff --git a/tests/core/snapshots/auth-jwt.md_merged.snap b/tests/core/snapshots/auth-jwt.md_merged.snap index f4d83de801..36e2f512b4 100644 --- a/tests/core/snapshots/auth-jwt.md_merged.snap +++ b/tests/core/snapshots/auth-jwt.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream @link(id: "jwks", src: "jwks.json", type: Jwks) { query: Query diff --git a/tests/core/snapshots/auth-multiple-complex.md_0.snap b/tests/core/snapshots/auth-multiple-complex.md_0.snap index b8378a8700..34235ef4d8 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_0.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_1.snap b/tests/core/snapshots/auth-multiple-complex.md_1.snap index 810687be1d..05850d1bba 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_1.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_2.snap b/tests/core/snapshots/auth-multiple-complex.md_2.snap index 5a69c6e6ca..8987f03180 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_2.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_3.snap b/tests/core/snapshots/auth-multiple-complex.md_3.snap index 5a69c6e6ca..8987f03180 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_3.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_4.snap b/tests/core/snapshots/auth-multiple-complex.md_4.snap index b8378a8700..34235ef4d8 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_4.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_5.snap b/tests/core/snapshots/auth-multiple-complex.md_5.snap index 810687be1d..05850d1bba 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_5.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_6.snap b/tests/core/snapshots/auth-multiple-complex.md_6.snap index c145e53e8d..aad1de9c9d 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_6.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_7.snap b/tests/core/snapshots/auth-multiple-complex.md_7.snap index 759f37b8d7..624b0d894f 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_7.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_8.snap b/tests/core/snapshots/auth-multiple-complex.md_8.snap index 54359c9181..ba323b762e 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_8.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple-complex.md_client.snap b/tests/core/snapshots/auth-multiple-complex.md_client.snap index f5c70f34ce..8de999b082 100644 --- a/tests/core/snapshots/auth-multiple-complex.md_client.snap +++ b/tests/core/snapshots/auth-multiple-complex.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- union Animal = Bird | Cat | Dog diff --git a/tests/core/snapshots/auth-multiple.md_1.snap b/tests/core/snapshots/auth-multiple.md_1.snap index 85ddc15b9a..1ccf560169 100644 --- a/tests/core/snapshots/auth-multiple.md_1.snap +++ b/tests/core/snapshots/auth-multiple.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_10.snap b/tests/core/snapshots/auth-multiple.md_10.snap index 3ed3d718ac..c11bd23cd6 100644 --- a/tests/core/snapshots/auth-multiple.md_10.snap +++ b/tests/core/snapshots/auth-multiple.md_10.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_11.snap b/tests/core/snapshots/auth-multiple.md_11.snap index 3ed3d718ac..c11bd23cd6 100644 --- a/tests/core/snapshots/auth-multiple.md_11.snap +++ b/tests/core/snapshots/auth-multiple.md_11.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_12.snap b/tests/core/snapshots/auth-multiple.md_12.snap index 3ed3d718ac..c11bd23cd6 100644 --- a/tests/core/snapshots/auth-multiple.md_12.snap +++ b/tests/core/snapshots/auth-multiple.md_12.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_13.snap b/tests/core/snapshots/auth-multiple.md_13.snap index 3ed3d718ac..c11bd23cd6 100644 --- a/tests/core/snapshots/auth-multiple.md_13.snap +++ b/tests/core/snapshots/auth-multiple.md_13.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_14.snap b/tests/core/snapshots/auth-multiple.md_14.snap index 3ed3d718ac..c11bd23cd6 100644 --- a/tests/core/snapshots/auth-multiple.md_14.snap +++ b/tests/core/snapshots/auth-multiple.md_14.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_5.snap b/tests/core/snapshots/auth-multiple.md_5.snap index 6c9bf317bc..4a8c78140d 100644 --- a/tests/core/snapshots/auth-multiple.md_5.snap +++ b/tests/core/snapshots/auth-multiple.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_6.snap b/tests/core/snapshots/auth-multiple.md_6.snap index cd0c842b9b..59b4abc42b 100644 --- a/tests/core/snapshots/auth-multiple.md_6.snap +++ b/tests/core/snapshots/auth-multiple.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_9.snap b/tests/core/snapshots/auth-multiple.md_9.snap index 3ed3d718ac..c11bd23cd6 100644 --- a/tests/core/snapshots/auth-multiple.md_9.snap +++ b/tests/core/snapshots/auth-multiple.md_9.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/auth-multiple.md_client.snap b/tests/core/snapshots/auth-multiple.md_client.snap index af4690518b..dafe0fd26a 100644 --- a/tests/core/snapshots/auth-multiple.md_client.snap +++ b/tests/core/snapshots/auth-multiple.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { a_and_b: String diff --git a/tests/core/snapshots/auth-protected-without-auth.md_error.snap b/tests/core/snapshots/auth-protected-without-auth.md_error.snap index 7330dede2f..9db8f40243 100644 --- a/tests/core/snapshots/auth-protected-without-auth.md_error.snap +++ b/tests/core/snapshots/auth-protected-without-auth.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/auth-validations.md_error.snap b/tests/core/snapshots/auth-validations.md_error.snap index 19dd962929..b4ea48d8f7 100644 --- a/tests/core/snapshots/auth-validations.md_error.snap +++ b/tests/core/snapshots/auth-validations.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/auth.md_client.snap b/tests/core/snapshots/auth.md_client.snap index 66a444f416..310967ec09 100644 --- a/tests/core/snapshots/auth.md_client.snap +++ b/tests/core/snapshots/auth.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { data: String diff --git a/tests/core/snapshots/auth.md_merged.snap b/tests/core/snapshots/auth.md_merged.snap index 9ad0fc322d..a4c0ba1805 100644 --- a/tests/core/snapshots/auth.md_merged.snap +++ b/tests/core/snapshots/auth.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server diff --git a/tests/core/snapshots/auth_order.md_client.snap b/tests/core/snapshots/auth_order.md_client.snap index 66a444f416..310967ec09 100644 --- a/tests/core/snapshots/auth_order.md_client.snap +++ b/tests/core/snapshots/auth_order.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { data: String diff --git a/tests/core/snapshots/auth_order.md_merged.snap b/tests/core/snapshots/auth_order.md_merged.snap index e53d975500..87d48f1a66 100644 --- a/tests/core/snapshots/auth_order.md_merged.snap +++ b/tests/core/snapshots/auth_order.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) { query: Query diff --git a/tests/core/snapshots/batching-default.md_0.snap b/tests/core/snapshots/batching-default.md_0.snap index f83fd2bba9..2acc507b95 100644 --- a/tests/core/snapshots/batching-default.md_0.snap +++ b/tests/core/snapshots/batching-default.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching-default.md_client.snap b/tests/core/snapshots/batching-default.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/batching-default.md_client.snap +++ b/tests/core/snapshots/batching-default.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/batching-default.md_merged.snap b/tests/core/snapshots/batching-default.md_merged.snap index 2760790e5a..84995c2b57 100644 --- a/tests/core/snapshots/batching-default.md_merged.snap +++ b/tests/core/snapshots/batching-default.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 10, headers: []}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/batching-disabled.md_0.snap b/tests/core/snapshots/batching-disabled.md_0.snap index e8bca1fdcc..fe63cd4831 100644 --- a/tests/core/snapshots/batching-disabled.md_0.snap +++ b/tests/core/snapshots/batching-disabled.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching-disabled.md_client.snap b/tests/core/snapshots/batching-disabled.md_client.snap index 47edbb3102..983973bacd 100644 --- a/tests/core/snapshots/batching-disabled.md_client.snap +++ b/tests/core/snapshots/batching-disabled.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/batching-disabled.md_merged.snap b/tests/core/snapshots/batching-disabled.md_merged.snap index 3b12a7c11d..381b4ce9d9 100644 --- a/tests/core/snapshots/batching-disabled.md_merged.snap +++ b/tests/core/snapshots/batching-disabled.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 0, headers: [], maxSize: 100}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/batching-group-by-default.md_0.snap b/tests/core/snapshots/batching-group-by-default.md_0.snap index f83fd2bba9..2acc507b95 100644 --- a/tests/core/snapshots/batching-group-by-default.md_0.snap +++ b/tests/core/snapshots/batching-group-by-default.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching-group-by-default.md_client.snap b/tests/core/snapshots/batching-group-by-default.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/batching-group-by-default.md_client.snap +++ b/tests/core/snapshots/batching-group-by-default.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/batching-group-by-default.md_merged.snap b/tests/core/snapshots/batching-group-by-default.md_merged.snap index 23b00350fb..8b3c506b4c 100644 --- a/tests/core/snapshots/batching-group-by-default.md_merged.snap +++ b/tests/core/snapshots/batching-group-by-default.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/batching-group-by-optional-key.md_0.snap b/tests/core/snapshots/batching-group-by-optional-key.md_0.snap index 03825cb57b..9a76fbdef8 100644 --- a/tests/core/snapshots/batching-group-by-optional-key.md_0.snap +++ b/tests/core/snapshots/batching-group-by-optional-key.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching-group-by-optional-key.md_client.snap b/tests/core/snapshots/batching-group-by-optional-key.md_client.snap index a8ef80479f..f3aa67a0d8 100644 --- a/tests/core/snapshots/batching-group-by-optional-key.md_client.snap +++ b/tests/core/snapshots/batching-group-by-optional-key.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/batching-group-by-optional-key.md_merged.snap b/tests/core/snapshots/batching-group-by-optional-key.md_merged.snap index c72f004372..59f89eab5a 100644 --- a/tests/core/snapshots/batching-group-by-optional-key.md_merged.snap +++ b/tests/core/snapshots/batching-group-by-optional-key.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) diff --git a/tests/core/snapshots/batching-group-by.md_0.snap b/tests/core/snapshots/batching-group-by.md_0.snap index f83fd2bba9..2acc507b95 100644 --- a/tests/core/snapshots/batching-group-by.md_0.snap +++ b/tests/core/snapshots/batching-group-by.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching-group-by.md_client.snap b/tests/core/snapshots/batching-group-by.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/batching-group-by.md_client.snap +++ b/tests/core/snapshots/batching-group-by.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/batching-group-by.md_merged.snap b/tests/core/snapshots/batching-group-by.md_merged.snap index 840c3b2cb2..73e02720a8 100644 --- a/tests/core/snapshots/batching-group-by.md_merged.snap +++ b/tests/core/snapshots/batching-group-by.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) diff --git a/tests/core/snapshots/batching-post.md_0.snap b/tests/core/snapshots/batching-post.md_0.snap index 43853b4346..044cc851d2 100644 --- a/tests/core/snapshots/batching-post.md_0.snap +++ b/tests/core/snapshots/batching-post.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching-post.md_client.snap b/tests/core/snapshots/batching-post.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/batching-post.md_client.snap +++ b/tests/core/snapshots/batching-post.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/batching-post.md_merged.snap b/tests/core/snapshots/batching-post.md_merged.snap index f98c413920..6a327f1fb0 100644 --- a/tests/core/snapshots/batching-post.md_merged.snap +++ b/tests/core/snapshots/batching-post.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) diff --git a/tests/core/snapshots/batching-validation.md_error.snap b/tests/core/snapshots/batching-validation.md_error.snap new file mode 100644 index 0000000000..68d218897f --- /dev/null +++ b/tests/core/snapshots/batching-validation.md_error.snap @@ -0,0 +1,46 @@ +--- +source: tests/core/spec.rs +expression: errors +snapshot_kind: text +--- +[ + { + "message": "batchKey requires either body or query parameters", + "trace": [ + "Query", + "posts", + "@http" + ], + "description": null + }, + { + "message": "Request body batching requires exactly one dynamic value in the body.", + "trace": [ + "Query", + "user", + "@http", + "body" + ], + "description": null + }, + { + "message": "Request body batching requires exactly one dynamic value in the body.", + "trace": [ + "Query", + "userWithId", + "@http", + "body" + ], + "description": null + }, + { + "message": "Request body batching requires exactly one dynamic value in the body.", + "trace": [ + "Query", + "userWithIdTest", + "@http", + "body" + ], + "description": null + } +] diff --git a/tests/core/snapshots/batching.md_0.snap b/tests/core/snapshots/batching.md_0.snap index b1a1411d19..ea094e8fb6 100644 --- a/tests/core/snapshots/batching.md_0.snap +++ b/tests/core/snapshots/batching.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching.md_1.snap b/tests/core/snapshots/batching.md_1.snap index 4a83588a1a..3b77c86b75 100644 --- a/tests/core/snapshots/batching.md_1.snap +++ b/tests/core/snapshots/batching.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching.md_2.snap b/tests/core/snapshots/batching.md_2.snap index 2d278c54f5..7cb398ac8b 100644 --- a/tests/core/snapshots/batching.md_2.snap +++ b/tests/core/snapshots/batching.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/batching.md_client.snap b/tests/core/snapshots/batching.md_client.snap index 52d67b233a..e7241293e9 100644 --- a/tests/core/snapshots/batching.md_client.snap +++ b/tests/core/snapshots/batching.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/batching.md_merged.snap b/tests/core/snapshots/batching.md_merged.snap index ea42772fad..ed80eff673 100644 --- a/tests/core/snapshots/batching.md_merged.snap +++ b/tests/core/snapshots/batching.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(batchRequests: true) @upstream { query: Query diff --git a/tests/core/snapshots/body-batching-cases.md_0.snap b/tests/core/snapshots/body-batching-cases.md_0.snap new file mode 100644 index 0000000000..c065aa5471 --- /dev/null +++ b/tests/core/snapshots/body-batching-cases.md_0.snap @@ -0,0 +1,35 @@ +--- +source: tests/core/spec.rs +expression: response +snapshot_kind: text +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "users": [ + { + "id": 1, + "name": "user-1", + "post": { + "id": 1, + "title": "user-1", + "userId": 1 + } + }, + { + "id": 2, + "name": "user-2", + "post": { + "id": 2, + "title": "user-2", + "userId": 2 + } + } + ] + } + } +} diff --git a/tests/core/snapshots/body-batching-cases.md_1.snap b/tests/core/snapshots/body-batching-cases.md_1.snap new file mode 100644 index 0000000000..141d28fb60 --- /dev/null +++ b/tests/core/snapshots/body-batching-cases.md_1.snap @@ -0,0 +1,33 @@ +--- +source: tests/core/spec.rs +expression: response +snapshot_kind: text +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "id": 1, + "title": "user-1", + "user": { + "id": 1, + "name": "user-1" + } + }, + { + "id": 2, + "title": "user-2", + "user": { + "id": 2, + "name": "user-2" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/body-batching-cases.md_2.snap b/tests/core/snapshots/body-batching-cases.md_2.snap new file mode 100644 index 0000000000..c89aaefc44 --- /dev/null +++ b/tests/core/snapshots/body-batching-cases.md_2.snap @@ -0,0 +1,33 @@ +--- +source: tests/core/spec.rs +expression: response +snapshot_kind: text +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "foo": [ + { + "a": 11, + "b": 12, + "bar": { + "a": 11, + "b": 12 + } + }, + { + "a": 21, + "b": 22, + "bar": { + "a": 21, + "b": 22 + } + } + ] + } + } +} diff --git a/tests/core/snapshots/body-batching-cases.md_client.snap b/tests/core/snapshots/body-batching-cases.md_client.snap new file mode 100644 index 0000000000..c6c47a3db1 --- /dev/null +++ b/tests/core/snapshots/body-batching-cases.md_client.snap @@ -0,0 +1,41 @@ +--- +source: tests/core/spec.rs +expression: formatted +snapshot_kind: text +--- +type Bar { + a: Int + b: Int +} + +type Foo { + a: Int + b: Int + bar: Bar +} + +type Post { + body: String! + id: Int! + title: String! + user: User + userId: Int! +} + +type Query { + foo: [Foo] + posts: [Post] + user: User + users: [User] +} + +type User { + email: String! + id: Int! + name: String! + post: Post +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/body-batching-cases.md_merged.snap b/tests/core/snapshots/body-batching-cases.md_merged.snap new file mode 100644 index 0000000000..776650bab0 --- /dev/null +++ b/tests/core/snapshots/body-batching-cases.md_merged.snap @@ -0,0 +1,54 @@ +--- +source: tests/core/spec.rs +expression: formatter +snapshot_kind: text +--- +schema @server(port: 8000) @upstream(batch: {delay: 1, headers: []}, httpCache: 42) { + query: Query +} + +type Bar { + a: Int + b: Int +} + +type Foo { + a: Int + b: Int + bar: Bar + @http(url: "http://jsonplaceholder.typicode.com/bar", body: {id: "{{.value.a}}"}, batchKey: ["a"], method: "POST") +} + +type Post { + body: String! + id: Int! + title: String! + user: User + @http( + url: "http://jsonplaceholder.typicode.com/users" + body: {key: "id", value: "{{.value.userId}}"} + batchKey: ["id"] + method: "POST" + ) + userId: Int! +} + +type Query { + foo: [Foo] @http(url: "http://jsonplaceholder.typicode.com/foo") + posts: [Post] @http(url: "http://jsonplaceholder.typicode.com/posts") + user: User @http(url: "http://jsonplaceholder.typicode.com/users/1") + users: [User] @http(url: "http://jsonplaceholder.typicode.com/users") +} + +type User { + email: String! + id: Int! + name: String! + post: Post + @http( + url: "http://jsonplaceholder.typicode.com/posts" + body: {userId: "{{.value.id}}", title: "title", body: "body"} + batchKey: ["userId"] + method: "POST" + ) +} diff --git a/tests/core/snapshots/body-batching.md_0.snap b/tests/core/snapshots/body-batching.md_0.snap new file mode 100644 index 0000000000..2505c26109 --- /dev/null +++ b/tests/core/snapshots/body-batching.md_0.snap @@ -0,0 +1,44 @@ +--- +source: tests/core/spec.rs +expression: response +snapshot_kind: text +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "users": [ + { + "id": 1, + "posts": [ + { + "userId": 1, + "title": "foo" + } + ] + }, + { + "id": 2, + "posts": [ + { + "userId": 2, + "title": "foo" + } + ] + }, + { + "id": 3, + "posts": [ + { + "userId": 3, + "title": "foo" + } + ] + } + ] + } + } +} diff --git a/tests/core/snapshots/body-batching.md_1.snap b/tests/core/snapshots/body-batching.md_1.snap new file mode 100644 index 0000000000..e167446553 --- /dev/null +++ b/tests/core/snapshots/body-batching.md_1.snap @@ -0,0 +1,41 @@ +--- +source: tests/core/spec.rs +expression: response +snapshot_kind: text +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "users": [ + { + "id": 1, + "comments": [ + { + "id": 1 + } + ] + }, + { + "id": 2, + "comments": [ + { + "id": 2 + } + ] + }, + { + "id": 3, + "comments": [ + { + "id": 3 + } + ] + } + ] + } + } +} diff --git a/tests/core/snapshots/body-batching.md_client.snap b/tests/core/snapshots/body-batching.md_client.snap new file mode 100644 index 0000000000..d7a434694d --- /dev/null +++ b/tests/core/snapshots/body-batching.md_client.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: formatted +snapshot_kind: text +--- +type Comment { + id: Int +} + +type Post { + body: String + id: Int + title: String + userId: Int! +} + +type Query { + users: [User] +} + +type User { + comments: [Comment] + id: Int! + name: String! + posts: [Post] +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/body-batching.md_merged.snap b/tests/core/snapshots/body-batching.md_merged.snap new file mode 100644 index 0000000000..4818a68eee --- /dev/null +++ b/tests/core/snapshots/body-batching.md_merged.snap @@ -0,0 +1,44 @@ +--- +source: tests/core/spec.rs +expression: formatter +snapshot_kind: text +--- +schema + @server(port: 8000, queryValidation: false) + @upstream(batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: 42) { + query: Query +} + +type Comment { + id: Int +} + +type Post { + body: String + id: Int + title: String + userId: Int! +} + +type Query { + users: [User] @http(url: "http://jsonplaceholder.typicode.com/users") +} + +type User { + comments: [Comment] + @http( + url: "https://jsonplaceholder.typicode.com/comments" + body: {title: "foo", body: "bar", meta: {information: {userId: "{{.value.id}}"}}} + batchKey: ["userId"] + method: "POST" + ) + id: Int! + name: String! + posts: [Post] + @http( + url: "https://jsonplaceholder.typicode.com/posts" + body: {userId: "{{.value.id}}", title: "foo", body: "bar"} + batchKey: ["userId"] + method: "POST" + ) +} diff --git a/tests/core/snapshots/cache-control.md_0.snap b/tests/core/snapshots/cache-control.md_0.snap index c3c2762363..170cdf8572 100644 --- a/tests/core/snapshots/cache-control.md_0.snap +++ b/tests/core/snapshots/cache-control.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/cache-control.md_1.snap b/tests/core/snapshots/cache-control.md_1.snap index c84152761a..6ec04a82a1 100644 --- a/tests/core/snapshots/cache-control.md_1.snap +++ b/tests/core/snapshots/cache-control.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/cache-control.md_2.snap b/tests/core/snapshots/cache-control.md_2.snap index 5ca46d4fd2..126be71c6a 100644 --- a/tests/core/snapshots/cache-control.md_2.snap +++ b/tests/core/snapshots/cache-control.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/cache-control.md_3.snap b/tests/core/snapshots/cache-control.md_3.snap index 33705363d3..1ff49d5f10 100644 --- a/tests/core/snapshots/cache-control.md_3.snap +++ b/tests/core/snapshots/cache-control.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/cache-control.md_client.snap b/tests/core/snapshots/cache-control.md_client.snap index 5e9fd2fa39..455588a80b 100644 --- a/tests/core/snapshots/cache-control.md_client.snap +++ b/tests/core/snapshots/cache-control.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int): User diff --git a/tests/core/snapshots/cache-control.md_merged.snap b/tests/core/snapshots/cache-control.md_merged.snap index cb766383ea..d9e977c16d 100644 --- a/tests/core/snapshots/cache-control.md_merged.snap +++ b/tests/core/snapshots/cache-control.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(headers: {cacheControl: true}) @upstream { query: Query diff --git a/tests/core/snapshots/caching-collision.md_0.snap b/tests/core/snapshots/caching-collision.md_0.snap index 78dc9d88b8..2c2832002c 100644 --- a/tests/core/snapshots/caching-collision.md_0.snap +++ b/tests/core/snapshots/caching-collision.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/caching-collision.md_client.snap b/tests/core/snapshots/caching-collision.md_client.snap index 8b73880b37..d3c71c98af 100644 --- a/tests/core/snapshots/caching-collision.md_client.snap +++ b/tests/core/snapshots/caching-collision.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { foo: Foo diff --git a/tests/core/snapshots/caching-collision.md_merged.snap b/tests/core/snapshots/caching-collision.md_merged.snap index b79b449f74..e87b1e063a 100644 --- a/tests/core/snapshots/caching-collision.md_merged.snap +++ b/tests/core/snapshots/caching-collision.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 1000}) { query: Query diff --git a/tests/core/snapshots/caching.md_0.snap b/tests/core/snapshots/caching.md_0.snap index 2121b43f17..ce24a8f5cf 100644 --- a/tests/core/snapshots/caching.md_0.snap +++ b/tests/core/snapshots/caching.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/caching.md_1.snap b/tests/core/snapshots/caching.md_1.snap index 40625200f5..e1280db53a 100644 --- a/tests/core/snapshots/caching.md_1.snap +++ b/tests/core/snapshots/caching.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/caching.md_2.snap b/tests/core/snapshots/caching.md_2.snap index 40625200f5..e1280db53a 100644 --- a/tests/core/snapshots/caching.md_2.snap +++ b/tests/core/snapshots/caching.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/caching.md_client.snap b/tests/core/snapshots/caching.md_client.snap index 5fc689497a..f1806a34d5 100644 --- a/tests/core/snapshots/caching.md_client.snap +++ b/tests/core/snapshots/caching.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { fieldCache: Type diff --git a/tests/core/snapshots/caching.md_merged.snap b/tests/core/snapshots/caching.md_merged.snap index 120fca795d..393125bad6 100644 --- a/tests/core/snapshots/caching.md_merged.snap +++ b/tests/core/snapshots/caching.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 1000}) { query: Query diff --git a/tests/core/snapshots/call-graphql-datasource.md_0.snap b/tests/core/snapshots/call-graphql-datasource.md_0.snap index b4420e10c7..cdcd20d61f 100644 --- a/tests/core/snapshots/call-graphql-datasource.md_0.snap +++ b/tests/core/snapshots/call-graphql-datasource.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-graphql-datasource.md_client.snap b/tests/core/snapshots/call-graphql-datasource.md_client.snap index 65c726c3dd..e7f490418f 100644 --- a/tests/core/snapshots/call-graphql-datasource.md_client.snap +++ b/tests/core/snapshots/call-graphql-datasource.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String! diff --git a/tests/core/snapshots/call-graphql-datasource.md_merged.snap b/tests/core/snapshots/call-graphql-datasource.md_merged.snap index 391f71c593..c37609aaf3 100644 --- a/tests/core/snapshots/call-graphql-datasource.md_merged.snap +++ b/tests/core/snapshots/call-graphql-datasource.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_0.snap b/tests/core/snapshots/call-multiple-steps-piping.md_0.snap index dc07f0ac53..72e6ed2385 100644 --- a/tests/core/snapshots/call-multiple-steps-piping.md_0.snap +++ b/tests/core/snapshots/call-multiple-steps-piping.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_1.snap b/tests/core/snapshots/call-multiple-steps-piping.md_1.snap index dcd399b30f..2e38fb1d90 100644 --- a/tests/core/snapshots/call-multiple-steps-piping.md_1.snap +++ b/tests/core/snapshots/call-multiple-steps-piping.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_client.snap b/tests/core/snapshots/call-multiple-steps-piping.md_client.snap index 32cb3a821c..00d1931a3d 100644 --- a/tests/core/snapshots/call-multiple-steps-piping.md_client.snap +++ b/tests/core/snapshots/call-multiple-steps-piping.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar JSON diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_merged.snap b/tests/core/snapshots/call-multiple-steps-piping.md_merged.snap index 64fce1675f..2c8904f528 100644 --- a/tests/core/snapshots/call-multiple-steps-piping.md_merged.snap +++ b/tests/core/snapshots/call-multiple-steps-piping.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/call-mutation.md_0.snap b/tests/core/snapshots/call-mutation.md_0.snap index a0b72d835b..4f1b70831d 100644 --- a/tests/core/snapshots/call-mutation.md_0.snap +++ b/tests/core/snapshots/call-mutation.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-mutation.md_1.snap b/tests/core/snapshots/call-mutation.md_1.snap index ac831dbf76..bc6826d3d3 100644 --- a/tests/core/snapshots/call-mutation.md_1.snap +++ b/tests/core/snapshots/call-mutation.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-mutation.md_2.snap b/tests/core/snapshots/call-mutation.md_2.snap index e2c0d0eb8a..922ea11f26 100644 --- a/tests/core/snapshots/call-mutation.md_2.snap +++ b/tests/core/snapshots/call-mutation.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-mutation.md_3.snap b/tests/core/snapshots/call-mutation.md_3.snap index 2e8dd036cd..297588d29e 100644 --- a/tests/core/snapshots/call-mutation.md_3.snap +++ b/tests/core/snapshots/call-mutation.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-mutation.md_4.snap b/tests/core/snapshots/call-mutation.md_4.snap index e082082e7d..e0213a8e98 100644 --- a/tests/core/snapshots/call-mutation.md_4.snap +++ b/tests/core/snapshots/call-mutation.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-mutation.md_client.snap b/tests/core/snapshots/call-mutation.md_client.snap index 81e7e3b2d7..639edd557e 100644 --- a/tests/core/snapshots/call-mutation.md_client.snap +++ b/tests/core/snapshots/call-mutation.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Mutation { attachPostToFirstUser(postId: Int!): User diff --git a/tests/core/snapshots/call-mutation.md_merged.snap b/tests/core/snapshots/call-mutation.md_merged.snap index 2123be8662..1aa6696906 100644 --- a/tests/core/snapshots/call-mutation.md_merged.snap +++ b/tests/core/snapshots/call-mutation.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/call-operator.md_0.snap b/tests/core/snapshots/call-operator.md_0.snap index 70bb1cdebb..e440a185b2 100644 --- a/tests/core/snapshots/call-operator.md_0.snap +++ b/tests/core/snapshots/call-operator.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_1.snap b/tests/core/snapshots/call-operator.md_1.snap index 8b3a950db1..a1386b374b 100644 --- a/tests/core/snapshots/call-operator.md_1.snap +++ b/tests/core/snapshots/call-operator.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_10.snap b/tests/core/snapshots/call-operator.md_10.snap index 87b277bf3c..918899e206 100644 --- a/tests/core/snapshots/call-operator.md_10.snap +++ b/tests/core/snapshots/call-operator.md_10.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_11.snap b/tests/core/snapshots/call-operator.md_11.snap index e90dc644de..b44bb8e5eb 100644 --- a/tests/core/snapshots/call-operator.md_11.snap +++ b/tests/core/snapshots/call-operator.md_11.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_12.snap b/tests/core/snapshots/call-operator.md_12.snap index c37773a9b8..03c8299b71 100644 --- a/tests/core/snapshots/call-operator.md_12.snap +++ b/tests/core/snapshots/call-operator.md_12.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_2.snap b/tests/core/snapshots/call-operator.md_2.snap index cd98048d91..77c25b94ac 100644 --- a/tests/core/snapshots/call-operator.md_2.snap +++ b/tests/core/snapshots/call-operator.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_3.snap b/tests/core/snapshots/call-operator.md_3.snap index 00eff50b9a..f1fbcb7e23 100644 --- a/tests/core/snapshots/call-operator.md_3.snap +++ b/tests/core/snapshots/call-operator.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_4.snap b/tests/core/snapshots/call-operator.md_4.snap index 00eff50b9a..f1fbcb7e23 100644 --- a/tests/core/snapshots/call-operator.md_4.snap +++ b/tests/core/snapshots/call-operator.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_5.snap b/tests/core/snapshots/call-operator.md_5.snap index 806ab8a84d..8fd40e8d49 100644 --- a/tests/core/snapshots/call-operator.md_5.snap +++ b/tests/core/snapshots/call-operator.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_6.snap b/tests/core/snapshots/call-operator.md_6.snap index 660a3716c6..caf50ad9ed 100644 --- a/tests/core/snapshots/call-operator.md_6.snap +++ b/tests/core/snapshots/call-operator.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_7.snap b/tests/core/snapshots/call-operator.md_7.snap index 226a9c3e3a..bc2a039177 100644 --- a/tests/core/snapshots/call-operator.md_7.snap +++ b/tests/core/snapshots/call-operator.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_8.snap b/tests/core/snapshots/call-operator.md_8.snap index 555ce24bfc..ad34d04c3e 100644 --- a/tests/core/snapshots/call-operator.md_8.snap +++ b/tests/core/snapshots/call-operator.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_9.snap b/tests/core/snapshots/call-operator.md_9.snap index f4f2990d59..29091d9912 100644 --- a/tests/core/snapshots/call-operator.md_9.snap +++ b/tests/core/snapshots/call-operator.md_9.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/call-operator.md_client.snap b/tests/core/snapshots/call-operator.md_client.snap index b45a50d9a7..bdd9934d15 100644 --- a/tests/core/snapshots/call-operator.md_client.snap +++ b/tests/core/snapshots/call-operator.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { body: String diff --git a/tests/core/snapshots/call-operator.md_merged.snap b/tests/core/snapshots/call-operator.md_merged.snap index 52aa9cb5d6..f21b1bec91 100644 --- a/tests/core/snapshots/call-operator.md_merged.snap +++ b/tests/core/snapshots/call-operator.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) diff --git a/tests/core/snapshots/cors-allow-cred-false.md_0.snap b/tests/core/snapshots/cors-allow-cred-false.md_0.snap index 396411301d..d5158a7e06 100644 --- a/tests/core/snapshots/cors-allow-cred-false.md_0.snap +++ b/tests/core/snapshots/cors-allow-cred-false.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/cors-allow-cred-false.md_client.snap b/tests/core/snapshots/cors-allow-cred-false.md_client.snap index 90ef607f77..6367b0cf96 100644 --- a/tests/core/snapshots/cors-allow-cred-false.md_client.snap +++ b/tests/core/snapshots/cors-allow-cred-false.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { val: Int diff --git a/tests/core/snapshots/cors-allow-cred-false.md_merged.snap b/tests/core/snapshots/cors-allow-cred-false.md_merged.snap index 2105c4fc1d..563575f96f 100644 --- a/tests/core/snapshots/cors-allow-cred-false.md_merged.snap +++ b/tests/core/snapshots/cors-allow-cred-false.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server( diff --git a/tests/core/snapshots/cors-allow-cred-true.md_0.snap b/tests/core/snapshots/cors-allow-cred-true.md_0.snap index 0d277c5d44..05235a8f70 100644 --- a/tests/core/snapshots/cors-allow-cred-true.md_0.snap +++ b/tests/core/snapshots/cors-allow-cred-true.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/cors-allow-cred-true.md_client.snap b/tests/core/snapshots/cors-allow-cred-true.md_client.snap index 90ef607f77..6367b0cf96 100644 --- a/tests/core/snapshots/cors-allow-cred-true.md_client.snap +++ b/tests/core/snapshots/cors-allow-cred-true.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { val: Int diff --git a/tests/core/snapshots/cors-allow-cred-true.md_merged.snap b/tests/core/snapshots/cors-allow-cred-true.md_merged.snap index 772c09bada..214ac18c0e 100644 --- a/tests/core/snapshots/cors-allow-cred-true.md_merged.snap +++ b/tests/core/snapshots/cors-allow-cred-true.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server( diff --git a/tests/core/snapshots/cors-allow-cred-vary.md_0.snap b/tests/core/snapshots/cors-allow-cred-vary.md_0.snap index 027484ed4f..7c0af0d2bf 100644 --- a/tests/core/snapshots/cors-allow-cred-vary.md_0.snap +++ b/tests/core/snapshots/cors-allow-cred-vary.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/cors-allow-cred-vary.md_client.snap b/tests/core/snapshots/cors-allow-cred-vary.md_client.snap index 90ef607f77..6367b0cf96 100644 --- a/tests/core/snapshots/cors-allow-cred-vary.md_client.snap +++ b/tests/core/snapshots/cors-allow-cred-vary.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { val: Int diff --git a/tests/core/snapshots/cors-allow-cred-vary.md_merged.snap b/tests/core/snapshots/cors-allow-cred-vary.md_merged.snap index 772c09bada..214ac18c0e 100644 --- a/tests/core/snapshots/cors-allow-cred-vary.md_merged.snap +++ b/tests/core/snapshots/cors-allow-cred-vary.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server( diff --git a/tests/core/snapshots/cors-invalid-expose-headers.md_error.snap b/tests/core/snapshots/cors-invalid-expose-headers.md_error.snap index 746e69d015..3a48ece312 100644 --- a/tests/core/snapshots/cors-invalid-expose-headers.md_error.snap +++ b/tests/core/snapshots/cors-invalid-expose-headers.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/cors-invalid-headers.md_error.snap b/tests/core/snapshots/cors-invalid-headers.md_error.snap index 581594e0b9..220bba772d 100644 --- a/tests/core/snapshots/cors-invalid-headers.md_error.snap +++ b/tests/core/snapshots/cors-invalid-headers.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/cors-invalid-methods.md_error.snap b/tests/core/snapshots/cors-invalid-methods.md_error.snap index f4c9b4b2f7..2d23f1ccaa 100644 --- a/tests/core/snapshots/cors-invalid-methods.md_error.snap +++ b/tests/core/snapshots/cors-invalid-methods.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/cors-invalid-origins.md_error.snap b/tests/core/snapshots/cors-invalid-origins.md_error.snap index d8799954bb..1d3683d6a9 100644 --- a/tests/core/snapshots/cors-invalid-origins.md_error.snap +++ b/tests/core/snapshots/cors-invalid-origins.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/custom-headers.md_0.snap b/tests/core/snapshots/custom-headers.md_0.snap index 4dc49a862b..924096b6bc 100644 --- a/tests/core/snapshots/custom-headers.md_0.snap +++ b/tests/core/snapshots/custom-headers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/custom-headers.md_client.snap b/tests/core/snapshots/custom-headers.md_client.snap index e749432d28..dfc1b5f0a0 100644 --- a/tests/core/snapshots/custom-headers.md_client.snap +++ b/tests/core/snapshots/custom-headers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { greet: String diff --git a/tests/core/snapshots/custom-headers.md_merged.snap b/tests/core/snapshots/custom-headers.md_merged.snap index 6a061abf08..2c70e18cae 100644 --- a/tests/core/snapshots/custom-headers.md_merged.snap +++ b/tests/core/snapshots/custom-headers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(headers: {custom: [{key: "x-id", value: "1"}, {key: "x-name", value: "John Doe"}]}) @upstream { query: Query diff --git a/tests/core/snapshots/custom-scalars.md_0.snap b/tests/core/snapshots/custom-scalars.md_0.snap index 8fee86ee58..b24ba203d6 100644 --- a/tests/core/snapshots/custom-scalars.md_0.snap +++ b/tests/core/snapshots/custom-scalars.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/custom-scalars.md_client.snap b/tests/core/snapshots/custom-scalars.md_client.snap index 4c487138d6..33106fe43a 100644 --- a/tests/core/snapshots/custom-scalars.md_client.snap +++ b/tests/core/snapshots/custom-scalars.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Bytes diff --git a/tests/core/snapshots/custom-scalars.md_merged.snap b/tests/core/snapshots/custom-scalars.md_merged.snap index 689a424bae..c40ea49cdf 100644 --- a/tests/core/snapshots/custom-scalars.md_merged.snap +++ b/tests/core/snapshots/custom-scalars.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/dedupe_batch_query_execution.md_0.snap b/tests/core/snapshots/dedupe_batch_query_execution.md_0.snap index 62ed8b07b6..7bd6ff89bb 100644 --- a/tests/core/snapshots/dedupe_batch_query_execution.md_0.snap +++ b/tests/core/snapshots/dedupe_batch_query_execution.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/dedupe_batch_query_execution.md_client.snap b/tests/core/snapshots/dedupe_batch_query_execution.md_client.snap index c48b74aa3d..5335b2d393 100644 --- a/tests/core/snapshots/dedupe_batch_query_execution.md_client.snap +++ b/tests/core/snapshots/dedupe_batch_query_execution.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/dedupe_batch_query_execution.md_merged.snap b/tests/core/snapshots/dedupe_batch_query_execution.md_merged.snap index 628bcda6e6..d753b1f6fa 100644 --- a/tests/core/snapshots/dedupe_batch_query_execution.md_merged.snap +++ b/tests/core/snapshots/dedupe_batch_query_execution.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, queryValidation: false) @upstream { query: Query diff --git a/tests/core/snapshots/default-value-arg.md_0.snap b/tests/core/snapshots/default-value-arg.md_0.snap index c3d9995606..fa74ccec1c 100644 --- a/tests/core/snapshots/default-value-arg.md_0.snap +++ b/tests/core/snapshots/default-value-arg.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/default-value-arg.md_1.snap b/tests/core/snapshots/default-value-arg.md_1.snap index 7fb28bfef9..08e3f81dcc 100644 --- a/tests/core/snapshots/default-value-arg.md_1.snap +++ b/tests/core/snapshots/default-value-arg.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/default-value-arg.md_client.snap b/tests/core/snapshots/default-value-arg.md_client.snap index 2d58111153..059f218b96 100644 --- a/tests/core/snapshots/default-value-arg.md_client.snap +++ b/tests/core/snapshots/default-value-arg.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input Input { id: Int! diff --git a/tests/core/snapshots/default-value-arg.md_merged.snap b/tests/core/snapshots/default-value-arg.md_merged.snap index 2603c4c8a4..8486447f4d 100644 --- a/tests/core/snapshots/default-value-arg.md_merged.snap +++ b/tests/core/snapshots/default-value-arg.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/default-value-config.md_client.snap b/tests/core/snapshots/default-value-config.md_client.snap index 1a5111fb83..e783427e31 100644 --- a/tests/core/snapshots/default-value-config.md_client.snap +++ b/tests/core/snapshots/default-value-config.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input Input { id: Int = 1 diff --git a/tests/core/snapshots/default-value-config.md_merged.snap b/tests/core/snapshots/default-value-config.md_merged.snap index b0ca4d47d7..c0a2a87b4b 100644 --- a/tests/core/snapshots/default-value-config.md_merged.snap +++ b/tests/core/snapshots/default-value-config.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/enum-args.md_0.snap b/tests/core/snapshots/enum-args.md_0.snap index 3b976af00b..8cb62c20a8 100644 --- a/tests/core/snapshots/enum-args.md_0.snap +++ b/tests/core/snapshots/enum-args.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/enum-args.md_client.snap b/tests/core/snapshots/enum-args.md_client.snap index 0372f32e76..3c3aa974d6 100644 --- a/tests/core/snapshots/enum-args.md_client.snap +++ b/tests/core/snapshots/enum-args.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- enum COLOR { BLUE diff --git a/tests/core/snapshots/enum-args.md_merged.snap b/tests/core/snapshots/enum-args.md_merged.snap index 1b707cab39..4abfde83d2 100644 --- a/tests/core/snapshots/enum-args.md_merged.snap +++ b/tests/core/snapshots/enum-args.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/env-value.md_0.snap b/tests/core/snapshots/env-value.md_0.snap index 2c2d8a3107..2c3eb64a6c 100644 --- a/tests/core/snapshots/env-value.md_0.snap +++ b/tests/core/snapshots/env-value.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/env-value.md_client.snap b/tests/core/snapshots/env-value.md_client.snap index 3ecc060530..9320b62afd 100644 --- a/tests/core/snapshots/env-value.md_client.snap +++ b/tests/core/snapshots/env-value.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/env-value.md_merged.snap b/tests/core/snapshots/env-value.md_merged.snap index ae2ea9bd84..7098abde18 100644 --- a/tests/core/snapshots/env-value.md_merged.snap +++ b/tests/core/snapshots/env-value.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query @@ -14,7 +15,7 @@ type Post { } type Query { - post1: Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.env.ID}}") - post2: Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.env.POST_ID}}") - post3: Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.env.NESTED_POST_ID}}") + post1: Post @http(url: "http://jsonplaceholder.typicode.com/posts/1") + post2: Post @http(url: "http://jsonplaceholder.typicode.com/posts/2") + post3: Post @http(url: "http://jsonplaceholder.typicode.com/posts/3") } diff --git a/tests/core/snapshots/experimental-headers-error.md_error.snap b/tests/core/snapshots/experimental-headers-error.md_error.snap index ec99849386..936af28fe8 100644 --- a/tests/core/snapshots/experimental-headers-error.md_error.snap +++ b/tests/core/snapshots/experimental-headers-error.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/experimental-headers.md_0.snap b/tests/core/snapshots/experimental-headers.md_0.snap index 559c15b572..79e632be1b 100644 --- a/tests/core/snapshots/experimental-headers.md_0.snap +++ b/tests/core/snapshots/experimental-headers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/experimental-headers.md_client.snap b/tests/core/snapshots/experimental-headers.md_client.snap index 9f6354f50d..ce382b2ba5 100644 --- a/tests/core/snapshots/experimental-headers.md_client.snap +++ b/tests/core/snapshots/experimental-headers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { users: [User] diff --git a/tests/core/snapshots/experimental-headers.md_merged.snap b/tests/core/snapshots/experimental-headers.md_merged.snap index 21ea54563b..523d454de4 100644 --- a/tests/core/snapshots/experimental-headers.md_merged.snap +++ b/tests/core/snapshots/experimental-headers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(headers: {experimental: ["X-experimental", "x-tailcall"]}) @upstream { query: Query diff --git a/tests/core/snapshots/federation-subgraph-force-disabled.md_0.snap b/tests/core/snapshots/federation-subgraph-force-disabled.md_0.snap index 661accca7b..279fcf6e75 100644 --- a/tests/core/snapshots/federation-subgraph-force-disabled.md_0.snap +++ b/tests/core/snapshots/federation-subgraph-force-disabled.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/federation-subgraph-force-disabled.md_1.snap b/tests/core/snapshots/federation-subgraph-force-disabled.md_1.snap index 661accca7b..279fcf6e75 100644 --- a/tests/core/snapshots/federation-subgraph-force-disabled.md_1.snap +++ b/tests/core/snapshots/federation-subgraph-force-disabled.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/federation-subgraph-force-disabled.md_client.snap b/tests/core/snapshots/federation-subgraph-force-disabled.md_client.snap index f0cf6e9796..627d54d3cb 100644 --- a/tests/core/snapshots/federation-subgraph-force-disabled.md_client.snap +++ b/tests/core/snapshots/federation-subgraph-force-disabled.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/federation-subgraph-force-disabled.md_merged.snap b/tests/core/snapshots/federation-subgraph-force-disabled.md_merged.snap index 181c9e7a12..dbc35e22c5 100644 --- a/tests/core/snapshots/federation-subgraph-force-disabled.md_merged.snap +++ b/tests/core/snapshots/federation-subgraph-force-disabled.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(enableFederation: false, port: 8000) @upstream(batch: {delay: 100, headers: []}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/federation-subgraph-force-enabled.md_0.snap b/tests/core/snapshots/federation-subgraph-force-enabled.md_0.snap index 661accca7b..279fcf6e75 100644 --- a/tests/core/snapshots/federation-subgraph-force-enabled.md_0.snap +++ b/tests/core/snapshots/federation-subgraph-force-enabled.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/federation-subgraph-force-enabled.md_1.snap b/tests/core/snapshots/federation-subgraph-force-enabled.md_1.snap index 3de0e06d04..a9d9f3e09d 100644 --- a/tests/core/snapshots/federation-subgraph-force-enabled.md_1.snap +++ b/tests/core/snapshots/federation-subgraph-force-enabled.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/federation-subgraph-force-enabled.md_client.snap b/tests/core/snapshots/federation-subgraph-force-enabled.md_client.snap index 607627ad6e..83206884c7 100644 --- a/tests/core/snapshots/federation-subgraph-force-enabled.md_client.snap +++ b/tests/core/snapshots/federation-subgraph-force-enabled.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { """ diff --git a/tests/core/snapshots/federation-subgraph-force-enabled.md_merged.snap b/tests/core/snapshots/federation-subgraph-force-enabled.md_merged.snap index ce491b9ef6..c9e0056ba0 100644 --- a/tests/core/snapshots/federation-subgraph-force-enabled.md_merged.snap +++ b/tests/core/snapshots/federation-subgraph-force-enabled.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(enableFederation: true, port: 8000) @upstream(batch: {delay: 100, headers: []}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/federation-subgraph-no-entities.md_0.snap b/tests/core/snapshots/federation-subgraph-no-entities.md_0.snap index 661accca7b..279fcf6e75 100644 --- a/tests/core/snapshots/federation-subgraph-no-entities.md_0.snap +++ b/tests/core/snapshots/federation-subgraph-no-entities.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/federation-subgraph-no-entities.md_1.snap b/tests/core/snapshots/federation-subgraph-no-entities.md_1.snap index 661accca7b..279fcf6e75 100644 --- a/tests/core/snapshots/federation-subgraph-no-entities.md_1.snap +++ b/tests/core/snapshots/federation-subgraph-no-entities.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/federation-subgraph-no-entities.md_client.snap b/tests/core/snapshots/federation-subgraph-no-entities.md_client.snap index f0cf6e9796..627d54d3cb 100644 --- a/tests/core/snapshots/federation-subgraph-no-entities.md_client.snap +++ b/tests/core/snapshots/federation-subgraph-no-entities.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/federation-subgraph-no-entities.md_merged.snap b/tests/core/snapshots/federation-subgraph-no-entities.md_merged.snap index 0446b75947..c51133fa15 100644 --- a/tests/core/snapshots/federation-subgraph-no-entities.md_merged.snap +++ b/tests/core/snapshots/federation-subgraph-no-entities.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream(batch: {delay: 100, headers: []}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-001.md_0.snap b/tests/core/snapshots/graphql-conformance-001.md_0.snap index 1e1d93fa3a..380ff38f7c 100644 --- a/tests/core/snapshots/graphql-conformance-001.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-001.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-001.md_1.snap b/tests/core/snapshots/graphql-conformance-001.md_1.snap index 275bc566d0..a3d7b06b20 100644 --- a/tests/core/snapshots/graphql-conformance-001.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-001.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-001.md_2.snap b/tests/core/snapshots/graphql-conformance-001.md_2.snap index ecc91653fd..cb1fc60cd3 100644 --- a/tests/core/snapshots/graphql-conformance-001.md_2.snap +++ b/tests/core/snapshots/graphql-conformance-001.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-001.md_3.snap b/tests/core/snapshots/graphql-conformance-001.md_3.snap index 2cc5607f01..61460074e4 100644 --- a/tests/core/snapshots/graphql-conformance-001.md_3.snap +++ b/tests/core/snapshots/graphql-conformance-001.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-001.md_4.snap b/tests/core/snapshots/graphql-conformance-001.md_4.snap index 13997f40e9..f2b4762c8a 100644 --- a/tests/core/snapshots/graphql-conformance-001.md_4.snap +++ b/tests/core/snapshots/graphql-conformance-001.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-001.md_client.snap b/tests/core/snapshots/graphql-conformance-001.md_client.snap index fe68975d19..2e759f3b7c 100644 --- a/tests/core/snapshots/graphql-conformance-001.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-001.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-001.md_merged.snap b/tests/core/snapshots/graphql-conformance-001.md_merged.snap index 1e9172d87d..a28dcd3c81 100644 --- a/tests/core/snapshots/graphql-conformance-001.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-001.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-003.md_0.snap b/tests/core/snapshots/graphql-conformance-003.md_0.snap index e2ef14ebd5..6099be43df 100644 --- a/tests/core/snapshots/graphql-conformance-003.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-003.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-003.md_1.snap b/tests/core/snapshots/graphql-conformance-003.md_1.snap index 2cc5f40539..7cd1d6647e 100644 --- a/tests/core/snapshots/graphql-conformance-003.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-003.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-003.md_client.snap b/tests/core/snapshots/graphql-conformance-003.md_client.snap index cb05e461f7..987a81bf82 100644 --- a/tests/core/snapshots/graphql-conformance-003.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-003.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-003.md_merged.snap b/tests/core/snapshots/graphql-conformance-003.md_merged.snap index 5936d93fac..4a492f6d1f 100644 --- a/tests/core/snapshots/graphql-conformance-003.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-003.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-010.md_0.snap b/tests/core/snapshots/graphql-conformance-010.md_0.snap index b0703e0d4e..3dc744ed82 100644 --- a/tests/core/snapshots/graphql-conformance-010.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-010.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-010.md_1.snap b/tests/core/snapshots/graphql-conformance-010.md_1.snap index b0703e0d4e..3dc744ed82 100644 --- a/tests/core/snapshots/graphql-conformance-010.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-010.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-010.md_client.snap b/tests/core/snapshots/graphql-conformance-010.md_client.snap index a8a2a67c6c..f375d83f86 100644 --- a/tests/core/snapshots/graphql-conformance-010.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-010.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Location { lat: Int! diff --git a/tests/core/snapshots/graphql-conformance-010.md_merged.snap b/tests/core/snapshots/graphql-conformance-010.md_merged.snap index 8d51398c20..742a9a8290 100644 --- a/tests/core/snapshots/graphql-conformance-010.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-010.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-013.md_0.snap b/tests/core/snapshots/graphql-conformance-013.md_0.snap index f48d074d00..f182201d7f 100644 --- a/tests/core/snapshots/graphql-conformance-013.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-013.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-013.md_client.snap b/tests/core/snapshots/graphql-conformance-013.md_client.snap index 6d42200537..a5ce7809f1 100644 --- a/tests/core/snapshots/graphql-conformance-013.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-013.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Date diff --git a/tests/core/snapshots/graphql-conformance-013.md_merged.snap b/tests/core/snapshots/graphql-conformance-013.md_merged.snap index 3daa957b60..5d4857500c 100644 --- a/tests/core/snapshots/graphql-conformance-013.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-013.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-014.md_0.snap b/tests/core/snapshots/graphql-conformance-014.md_0.snap index e6efc64331..9f520416ce 100644 --- a/tests/core/snapshots/graphql-conformance-014.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-014.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-014.md_1.snap b/tests/core/snapshots/graphql-conformance-014.md_1.snap index 85143a1efb..5af023abeb 100644 --- a/tests/core/snapshots/graphql-conformance-014.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-014.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-014.md_client.snap b/tests/core/snapshots/graphql-conformance-014.md_client.snap index fe68975d19..2e759f3b7c 100644 --- a/tests/core/snapshots/graphql-conformance-014.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-014.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-014.md_merged.snap b/tests/core/snapshots/graphql-conformance-014.md_merged.snap index 1e9172d87d..a28dcd3c81 100644 --- a/tests/core/snapshots/graphql-conformance-014.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-014.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-015.md_0.snap b/tests/core/snapshots/graphql-conformance-015.md_0.snap index b4f7ff70a1..1b8596d04b 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_1.snap b/tests/core/snapshots/graphql-conformance-015.md_1.snap index 7217296fd3..df6d21c5ab 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_11.snap b/tests/core/snapshots/graphql-conformance-015.md_11.snap index a24ffcbc5d..aa1d127cfd 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_11.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_11.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_2.snap b/tests/core/snapshots/graphql-conformance-015.md_2.snap index cdb5df7fc9..cdf95c2973 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_2.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_3.snap b/tests/core/snapshots/graphql-conformance-015.md_3.snap index ace07bd203..0e28b7d401 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_3.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_4.snap b/tests/core/snapshots/graphql-conformance-015.md_4.snap index e586519b7b..82efcf907d 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_4.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_5.snap b/tests/core/snapshots/graphql-conformance-015.md_5.snap index d4492073ee..2491eed07b 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_5.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_6.snap b/tests/core/snapshots/graphql-conformance-015.md_6.snap index b8a9fc7dfd..bf2d89754c 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_6.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_7.snap b/tests/core/snapshots/graphql-conformance-015.md_7.snap index cef9e058e8..0ff0fb9040 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_7.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_8.snap b/tests/core/snapshots/graphql-conformance-015.md_8.snap index ada31c2959..da0549a44c 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_8.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-015.md_client.snap b/tests/core/snapshots/graphql-conformance-015.md_client.snap index 2b1b4a30a0..f276398c28 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input Foo { bar: String! = "BUZZ" diff --git a/tests/core/snapshots/graphql-conformance-015.md_merged.snap b/tests/core/snapshots/graphql-conformance-015.md_merged.snap index f220edfaf4..6fa190cb9c 100644 --- a/tests/core/snapshots/graphql-conformance-015.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-015.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-018.md_0.snap b/tests/core/snapshots/graphql-conformance-018.md_0.snap index 67b166b416..dddc31c0c5 100644 --- a/tests/core/snapshots/graphql-conformance-018.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-018.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-018.md_client.snap b/tests/core/snapshots/graphql-conformance-018.md_client.snap index 21e04a64ac..9ce88f5fcc 100644 --- a/tests/core/snapshots/graphql-conformance-018.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-018.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-018.md_merged.snap b/tests/core/snapshots/graphql-conformance-018.md_merged.snap index a88d92fcbc..05ce85690b 100644 --- a/tests/core/snapshots/graphql-conformance-018.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-018.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-001.md_0.snap b/tests/core/snapshots/graphql-conformance-http-001.md_0.snap index 1e1d93fa3a..380ff38f7c 100644 --- a/tests/core/snapshots/graphql-conformance-http-001.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-001.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-001.md_1.snap b/tests/core/snapshots/graphql-conformance-http-001.md_1.snap index 275bc566d0..a3d7b06b20 100644 --- a/tests/core/snapshots/graphql-conformance-http-001.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-001.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-001.md_2.snap b/tests/core/snapshots/graphql-conformance-http-001.md_2.snap index ecc91653fd..cb1fc60cd3 100644 --- a/tests/core/snapshots/graphql-conformance-http-001.md_2.snap +++ b/tests/core/snapshots/graphql-conformance-http-001.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-001.md_3.snap b/tests/core/snapshots/graphql-conformance-http-001.md_3.snap index 2cc5607f01..61460074e4 100644 --- a/tests/core/snapshots/graphql-conformance-http-001.md_3.snap +++ b/tests/core/snapshots/graphql-conformance-http-001.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-001.md_4.snap b/tests/core/snapshots/graphql-conformance-http-001.md_4.snap index 13997f40e9..f2b4762c8a 100644 --- a/tests/core/snapshots/graphql-conformance-http-001.md_4.snap +++ b/tests/core/snapshots/graphql-conformance-http-001.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-001.md_client.snap b/tests/core/snapshots/graphql-conformance-http-001.md_client.snap index fe68975d19..2e759f3b7c 100644 --- a/tests/core/snapshots/graphql-conformance-http-001.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-001.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-http-001.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-001.md_merged.snap index 642ac573e6..e0ea921538 100644 --- a/tests/core/snapshots/graphql-conformance-http-001.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-001.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-002.md_0.snap b/tests/core/snapshots/graphql-conformance-http-002.md_0.snap index 6ba4226313..dae048aa31 100644 --- a/tests/core/snapshots/graphql-conformance-http-002.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-002.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-002.md_client.snap b/tests/core/snapshots/graphql-conformance-http-002.md_client.snap index 4b9d55b703..6c4a887912 100644 --- a/tests/core/snapshots/graphql-conformance-http-002.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-002.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type BirthDay { day: Int! diff --git a/tests/core/snapshots/graphql-conformance-http-002.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-002.md_merged.snap index 12edc9dfe2..cd6ca7f939 100644 --- a/tests/core/snapshots/graphql-conformance-http-002.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-002.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-003.md_0.snap b/tests/core/snapshots/graphql-conformance-http-003.md_0.snap index 68ff382be6..cd0b9d2b3f 100644 --- a/tests/core/snapshots/graphql-conformance-http-003.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-003.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-003.md_1.snap b/tests/core/snapshots/graphql-conformance-http-003.md_1.snap index bcbc9cde04..79646f219b 100644 --- a/tests/core/snapshots/graphql-conformance-http-003.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-003.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-003.md_client.snap b/tests/core/snapshots/graphql-conformance-http-003.md_client.snap index cb05e461f7..987a81bf82 100644 --- a/tests/core/snapshots/graphql-conformance-http-003.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-003.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-http-003.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-003.md_merged.snap index a26db3f74f..29b398f95e 100644 --- a/tests/core/snapshots/graphql-conformance-http-003.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-003.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-004.md_0.snap b/tests/core/snapshots/graphql-conformance-http-004.md_0.snap index 86d2140796..076954c112 100644 --- a/tests/core/snapshots/graphql-conformance-http-004.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-004.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-004.md_client.snap b/tests/core/snapshots/graphql-conformance-http-004.md_client.snap index cb05e461f7..987a81bf82 100644 --- a/tests/core/snapshots/graphql-conformance-http-004.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-004.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-http-004.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-004.md_merged.snap index a26db3f74f..29b398f95e 100644 --- a/tests/core/snapshots/graphql-conformance-http-004.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-004.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-005.md_0.snap b/tests/core/snapshots/graphql-conformance-http-005.md_0.snap index b00fb885e9..3a440cec24 100644 --- a/tests/core/snapshots/graphql-conformance-http-005.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-005.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-005.md_client.snap b/tests/core/snapshots/graphql-conformance-http-005.md_client.snap index 03f65ab5ff..da44cda0e3 100644 --- a/tests/core/snapshots/graphql-conformance-http-005.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-005.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-http-005.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-005.md_merged.snap index 7a07e413b8..bf3363b6cf 100644 --- a/tests/core/snapshots/graphql-conformance-http-005.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-005.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-006.md_0.snap b/tests/core/snapshots/graphql-conformance-http-006.md_0.snap index 8ea1eb6d5e..287e922a4a 100644 --- a/tests/core/snapshots/graphql-conformance-http-006.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-006.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-006.md_1.snap b/tests/core/snapshots/graphql-conformance-http-006.md_1.snap index 8ea1eb6d5e..287e922a4a 100644 --- a/tests/core/snapshots/graphql-conformance-http-006.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-006.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-006.md_2.snap b/tests/core/snapshots/graphql-conformance-http-006.md_2.snap index 8ea1eb6d5e..287e922a4a 100644 --- a/tests/core/snapshots/graphql-conformance-http-006.md_2.snap +++ b/tests/core/snapshots/graphql-conformance-http-006.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-006.md_client.snap b/tests/core/snapshots/graphql-conformance-http-006.md_client.snap index 99b6b22e90..15bea93292 100644 --- a/tests/core/snapshots/graphql-conformance-http-006.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-006.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-http-006.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-006.md_merged.snap index 334955ea82..50249b3404 100644 --- a/tests/core/snapshots/graphql-conformance-http-006.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-006.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-007.md_0.snap b/tests/core/snapshots/graphql-conformance-http-007.md_0.snap index c9ad2f3e2c..be3ac70615 100644 --- a/tests/core/snapshots/graphql-conformance-http-007.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-007.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-007.md_client.snap b/tests/core/snapshots/graphql-conformance-http-007.md_client.snap index 3eacfd8774..d660837a02 100644 --- a/tests/core/snapshots/graphql-conformance-http-007.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-007.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Counter { count: Int! diff --git a/tests/core/snapshots/graphql-conformance-http-007.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-007.md_merged.snap index 05758545a8..97b7085299 100644 --- a/tests/core/snapshots/graphql-conformance-http-007.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-007.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-008.md_0.snap b/tests/core/snapshots/graphql-conformance-http-008.md_0.snap index c9ad2f3e2c..be3ac70615 100644 --- a/tests/core/snapshots/graphql-conformance-http-008.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-008.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-008.md_client.snap b/tests/core/snapshots/graphql-conformance-http-008.md_client.snap index 3eacfd8774..d660837a02 100644 --- a/tests/core/snapshots/graphql-conformance-http-008.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-008.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Counter { count: Int! diff --git a/tests/core/snapshots/graphql-conformance-http-008.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-008.md_merged.snap index 12038fc2b5..bc27e56100 100644 --- a/tests/core/snapshots/graphql-conformance-http-008.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-008.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-010.md_0.snap b/tests/core/snapshots/graphql-conformance-http-010.md_0.snap index b0703e0d4e..3dc744ed82 100644 --- a/tests/core/snapshots/graphql-conformance-http-010.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-010.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-010.md_1.snap b/tests/core/snapshots/graphql-conformance-http-010.md_1.snap index b0703e0d4e..3dc744ed82 100644 --- a/tests/core/snapshots/graphql-conformance-http-010.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-010.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-010.md_client.snap b/tests/core/snapshots/graphql-conformance-http-010.md_client.snap index a8a2a67c6c..f375d83f86 100644 --- a/tests/core/snapshots/graphql-conformance-http-010.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-010.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Location { lat: Int! diff --git a/tests/core/snapshots/graphql-conformance-http-010.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-010.md_merged.snap index aff10d1696..c244a7639f 100644 --- a/tests/core/snapshots/graphql-conformance-http-010.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-010.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-012.md_0.snap b/tests/core/snapshots/graphql-conformance-http-012.md_0.snap index 4a41d6be01..79a8028efe 100644 --- a/tests/core/snapshots/graphql-conformance-http-012.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-012.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-012.md_1.snap b/tests/core/snapshots/graphql-conformance-http-012.md_1.snap index 4a41d6be01..79a8028efe 100644 --- a/tests/core/snapshots/graphql-conformance-http-012.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-012.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-012.md_client.snap b/tests/core/snapshots/graphql-conformance-http-012.md_client.snap index cece3220d6..3600d64328 100644 --- a/tests/core/snapshots/graphql-conformance-http-012.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-012.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Person { age: Int diff --git a/tests/core/snapshots/graphql-conformance-http-012.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-012.md_merged.snap index 3c19e41372..8507ade4e3 100644 --- a/tests/core/snapshots/graphql-conformance-http-012.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-012.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-013.md_0.snap b/tests/core/snapshots/graphql-conformance-http-013.md_0.snap index f48d074d00..f182201d7f 100644 --- a/tests/core/snapshots/graphql-conformance-http-013.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-013.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-013.md_client.snap b/tests/core/snapshots/graphql-conformance-http-013.md_client.snap index 6d42200537..a5ce7809f1 100644 --- a/tests/core/snapshots/graphql-conformance-http-013.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-013.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Date diff --git a/tests/core/snapshots/graphql-conformance-http-013.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-013.md_merged.snap index c4a4d68e66..52fec7f57c 100644 --- a/tests/core/snapshots/graphql-conformance-http-013.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-013.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-014.md_0.snap b/tests/core/snapshots/graphql-conformance-http-014.md_0.snap index e6efc64331..9f520416ce 100644 --- a/tests/core/snapshots/graphql-conformance-http-014.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-014.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-014.md_1.snap b/tests/core/snapshots/graphql-conformance-http-014.md_1.snap index 85143a1efb..5af023abeb 100644 --- a/tests/core/snapshots/graphql-conformance-http-014.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-014.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-014.md_client.snap b/tests/core/snapshots/graphql-conformance-http-014.md_client.snap index fe68975d19..2e759f3b7c 100644 --- a/tests/core/snapshots/graphql-conformance-http-014.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-014.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: ID!): User! diff --git a/tests/core/snapshots/graphql-conformance-http-014.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-014.md_merged.snap index 642ac573e6..e0ea921538 100644 --- a/tests/core/snapshots/graphql-conformance-http-014.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-014.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_0.snap b/tests/core/snapshots/graphql-conformance-http-015.md_0.snap index b4f7ff70a1..1b8596d04b 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_1.snap b/tests/core/snapshots/graphql-conformance-http-015.md_1.snap index 7217296fd3..df6d21c5ab 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_11.snap b/tests/core/snapshots/graphql-conformance-http-015.md_11.snap index a24ffcbc5d..aa1d127cfd 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_11.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_11.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_2.snap b/tests/core/snapshots/graphql-conformance-http-015.md_2.snap index cdb5df7fc9..cdf95c2973 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_2.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_3.snap b/tests/core/snapshots/graphql-conformance-http-015.md_3.snap index ace07bd203..0e28b7d401 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_3.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_4.snap b/tests/core/snapshots/graphql-conformance-http-015.md_4.snap index e586519b7b..82efcf907d 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_4.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_5.snap b/tests/core/snapshots/graphql-conformance-http-015.md_5.snap index d4492073ee..2491eed07b 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_5.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_6.snap b/tests/core/snapshots/graphql-conformance-http-015.md_6.snap index b8a9fc7dfd..bf2d89754c 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_6.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_7.snap b/tests/core/snapshots/graphql-conformance-http-015.md_7.snap index cef9e058e8..0ff0fb9040 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_7.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_8.snap b/tests/core/snapshots/graphql-conformance-http-015.md_8.snap index ada31c2959..da0549a44c 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_8.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_client.snap b/tests/core/snapshots/graphql-conformance-http-015.md_client.snap index 2b1b4a30a0..f276398c28 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input Foo { bar: String! = "BUZZ" diff --git a/tests/core/snapshots/graphql-conformance-http-015.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-015.md_merged.snap index 8acedfaee5..2df28536a7 100644 --- a/tests/core/snapshots/graphql-conformance-http-015.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-015.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-http-017.md_0.snap b/tests/core/snapshots/graphql-conformance-http-017.md_0.snap index a44c8d5570..8c79983c64 100644 --- a/tests/core/snapshots/graphql-conformance-http-017.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-http-017.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-017.md_1.snap b/tests/core/snapshots/graphql-conformance-http-017.md_1.snap index 6a663d21ee..3c3a210331 100644 --- a/tests/core/snapshots/graphql-conformance-http-017.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-http-017.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-http-017.md_client.snap b/tests/core/snapshots/graphql-conformance-http-017.md_client.snap index 39b667bf81..ac82707d17 100644 --- a/tests/core/snapshots/graphql-conformance-http-017.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-http-017.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- interface Animal { id: ID! diff --git a/tests/core/snapshots/graphql-conformance-http-017.md_merged.snap b/tests/core/snapshots/graphql-conformance-http-017.md_merged.snap index 850bd04690..b4fcab3970 100644 --- a/tests/core/snapshots/graphql-conformance-http-017.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-http-017.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_0.snap b/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_0.snap index 8d583dd624..bf0cca7203 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_client.snap b/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_client.snap index 740daf953e..45adf6a484 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Admin { name: String! diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_merged.snap b/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_merged.snap index 89a4a66c74..6caf38d5d7 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-fragment.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_0.snap b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_0.snap index 09daefec5d..47468f72e8 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_1.snap b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_1.snap index 02b07d6d88..5475524804 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_2.snap b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_2.snap index 5d8e545f31..2e959ac7dc 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_2.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_client.snap b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_client.snap index 341ff5b8c6..3906b2b188 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { addUsers(userNames: [[String!]!]!): Boolean diff --git a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_merged.snap b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_merged.snap index 0ca8a52479..d02fbe8f56 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists-http.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists-http.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-conformance-nested-lists.md_0.snap b/tests/core/snapshots/graphql-conformance-nested-lists.md_0.snap index 09daefec5d..47468f72e8 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists.md_0.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-nested-lists.md_1.snap b/tests/core/snapshots/graphql-conformance-nested-lists.md_1.snap index 02b07d6d88..5475524804 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists.md_1.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-nested-lists.md_2.snap b/tests/core/snapshots/graphql-conformance-nested-lists.md_2.snap index 5d8e545f31..2e959ac7dc 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists.md_2.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-conformance-nested-lists.md_client.snap b/tests/core/snapshots/graphql-conformance-nested-lists.md_client.snap index 341ff5b8c6..3906b2b188 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists.md_client.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { addUsers(userNames: [[String!]!]!): Boolean diff --git a/tests/core/snapshots/graphql-conformance-nested-lists.md_merged.snap b/tests/core/snapshots/graphql-conformance-nested-lists.md_merged.snap index b2e7447d0f..bf74d40343 100644 --- a/tests/core/snapshots/graphql-conformance-nested-lists.md_merged.snap +++ b/tests/core/snapshots/graphql-conformance-nested-lists.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/graphql-dataloader-batch-request.md_0.snap b/tests/core/snapshots/graphql-dataloader-batch-request.md_0.snap index b4420e10c7..cdcd20d61f 100644 --- a/tests/core/snapshots/graphql-dataloader-batch-request.md_0.snap +++ b/tests/core/snapshots/graphql-dataloader-batch-request.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap b/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap index 932036ff78..b1638efb60 100644 --- a/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap +++ b/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int diff --git a/tests/core/snapshots/graphql-dataloader-batch-request.md_merged.snap b/tests/core/snapshots/graphql-dataloader-batch-request.md_merged.snap index 4ec834a696..683dd6f9cc 100644 --- a/tests/core/snapshots/graphql-dataloader-batch-request.md_merged.snap +++ b/tests/core/snapshots/graphql-dataloader-batch-request.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: []}) { query: Query diff --git a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_0.snap b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_0.snap index b4420e10c7..cdcd20d61f 100644 --- a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_0.snap +++ b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap index 932036ff78..b1638efb60 100644 --- a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap +++ b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int diff --git a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_merged.snap b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_merged.snap index ab37e71fdc..d0044e3570 100644 --- a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_merged.snap +++ b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: []}) { query: Query diff --git a/tests/core/snapshots/graphql-datasource-errors.md_0.snap b/tests/core/snapshots/graphql-datasource-errors.md_0.snap index a14dce54cb..c98af289a0 100644 --- a/tests/core/snapshots/graphql-datasource-errors.md_0.snap +++ b/tests/core/snapshots/graphql-datasource-errors.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-errors.md_1.snap b/tests/core/snapshots/graphql-datasource-errors.md_1.snap index 02f11ae658..777d086016 100644 --- a/tests/core/snapshots/graphql-datasource-errors.md_1.snap +++ b/tests/core/snapshots/graphql-datasource-errors.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-errors.md_client.snap b/tests/core/snapshots/graphql-datasource-errors.md_client.snap index 5e9fd2fa39..455588a80b 100644 --- a/tests/core/snapshots/graphql-datasource-errors.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-errors.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int): User diff --git a/tests/core/snapshots/graphql-datasource-errors.md_merged.snap b/tests/core/snapshots/graphql-datasource-errors.md_merged.snap index 30aee8d777..52e9757626 100644 --- a/tests/core/snapshots/graphql-datasource-errors.md_merged.snap +++ b/tests/core/snapshots/graphql-datasource-errors.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/graphql-datasource-mutation.md_0.snap b/tests/core/snapshots/graphql-datasource-mutation.md_0.snap index 4a1861c0e1..1ccff3bfa7 100644 --- a/tests/core/snapshots/graphql-datasource-mutation.md_0.snap +++ b/tests/core/snapshots/graphql-datasource-mutation.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-mutation.md_client.snap b/tests/core/snapshots/graphql-datasource-mutation.md_client.snap index 817a9de9a6..a961e58f3e 100644 --- a/tests/core/snapshots/graphql-datasource-mutation.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-mutation.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Mutation { createUser(user: UserInput!): User diff --git a/tests/core/snapshots/graphql-datasource-mutation.md_merged.snap b/tests/core/snapshots/graphql-datasource-mutation.md_merged.snap index 3ceec60315..53de3b5a3e 100644 --- a/tests/core/snapshots/graphql-datasource-mutation.md_merged.snap +++ b/tests/core/snapshots/graphql-datasource-mutation.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/graphql-datasource-no-args.md_0.snap b/tests/core/snapshots/graphql-datasource-no-args.md_0.snap index d4d493733f..384b487606 100644 --- a/tests/core/snapshots/graphql-datasource-no-args.md_0.snap +++ b/tests/core/snapshots/graphql-datasource-no-args.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-no-args.md_client.snap b/tests/core/snapshots/graphql-datasource-no-args.md_client.snap index 72ffb65629..b5afe7917d 100644 --- a/tests/core/snapshots/graphql-datasource-no-args.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-no-args.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { users_list: [User] diff --git a/tests/core/snapshots/graphql-datasource-no-args.md_merged.snap b/tests/core/snapshots/graphql-datasource-no-args.md_merged.snap index 4c1e345f65..c083d5abbf 100644 --- a/tests/core/snapshots/graphql-datasource-no-args.md_merged.snap +++ b/tests/core/snapshots/graphql-datasource-no-args.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/graphql-datasource-query-directives.md_0.snap b/tests/core/snapshots/graphql-datasource-query-directives.md_0.snap index fde4f3bc74..14ca3ec70f 100644 --- a/tests/core/snapshots/graphql-datasource-query-directives.md_0.snap +++ b/tests/core/snapshots/graphql-datasource-query-directives.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-query-directives.md_1.snap b/tests/core/snapshots/graphql-datasource-query-directives.md_1.snap index 5948e3f20e..d8f1b2a0bb 100644 --- a/tests/core/snapshots/graphql-datasource-query-directives.md_1.snap +++ b/tests/core/snapshots/graphql-datasource-query-directives.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-query-directives.md_client.snap b/tests/core/snapshots/graphql-datasource-query-directives.md_client.snap index 52d67b233a..e7241293e9 100644 --- a/tests/core/snapshots/graphql-datasource-query-directives.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-query-directives.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/graphql-datasource-query-directives.md_merged.snap b/tests/core/snapshots/graphql-datasource-query-directives.md_merged.snap index 3e34144364..35abb7df65 100644 --- a/tests/core/snapshots/graphql-datasource-query-directives.md_merged.snap +++ b/tests/core/snapshots/graphql-datasource-query-directives.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_0.snap b/tests/core/snapshots/graphql-datasource-with-args.md_0.snap index 27bf57106e..16005a0f61 100644 --- a/tests/core/snapshots/graphql-datasource-with-args.md_0.snap +++ b/tests/core/snapshots/graphql-datasource-with-args.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_1.snap b/tests/core/snapshots/graphql-datasource-with-args.md_1.snap index ccb0082d47..f69edc0e63 100644 --- a/tests/core/snapshots/graphql-datasource-with-args.md_1.snap +++ b/tests/core/snapshots/graphql-datasource-with-args.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_client.snap b/tests/core/snapshots/graphql-datasource-with-args.md_client.snap index dd04e488ea..5d2e78269c 100644 --- a/tests/core/snapshots/graphql-datasource-with-args.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-with-args.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_merged.snap b/tests/core/snapshots/graphql-datasource-with-args.md_merged.snap index 84332a5847..76530d1086 100644 --- a/tests/core/snapshots/graphql-datasource-with-args.md_merged.snap +++ b/tests/core/snapshots/graphql-datasource-with-args.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/graphql-datasource-with-empty-enum.md_0.snap b/tests/core/snapshots/graphql-datasource-with-empty-enum.md_0.snap index b039c861f8..00deaf455b 100644 --- a/tests/core/snapshots/graphql-datasource-with-empty-enum.md_0.snap +++ b/tests/core/snapshots/graphql-datasource-with-empty-enum.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-with-empty-enum.md_client.snap b/tests/core/snapshots/graphql-datasource-with-empty-enum.md_client.snap index da73ff4865..0938cdab45 100644 --- a/tests/core/snapshots/graphql-datasource-with-empty-enum.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-with-empty-enum.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- enum EnumType { INFORMATION diff --git a/tests/core/snapshots/graphql-datasource-with-empty-enum.md_merged.snap b/tests/core/snapshots/graphql-datasource-with-empty-enum.md_merged.snap index b2e019ecfe..6715b2cbfd 100644 --- a/tests/core/snapshots/graphql-datasource-with-empty-enum.md_merged.snap +++ b/tests/core/snapshots/graphql-datasource-with-empty-enum.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_0.snap b/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_0.snap index 142ef173e9..65c1a4eee7 100644 --- a/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_0.snap +++ b/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_client.snap b/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_client.snap index 37c2b0f512..912a6e2b47 100644 --- a/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- enum EnumType { INFORMATION diff --git a/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_merged.snap b/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_merged.snap index 7de81f58c2..0a1b917e5f 100644 --- a/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_merged.snap +++ b/tests/core/snapshots/graphql-datasource-with-mandatory-enum.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/graphql-nested-datasource.md_0.snap b/tests/core/snapshots/graphql-nested-datasource.md_0.snap index ea545f284a..128394ef6e 100644 --- a/tests/core/snapshots/graphql-nested-datasource.md_0.snap +++ b/tests/core/snapshots/graphql-nested-datasource.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/graphql-nested-datasource.md_client.snap b/tests/core/snapshots/graphql-nested-datasource.md_client.snap index ecef94a855..a954801807 100644 --- a/tests/core/snapshots/graphql-nested-datasource.md_client.snap +++ b/tests/core/snapshots/graphql-nested-datasource.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type A { b: B diff --git a/tests/core/snapshots/graphql-nested-datasource.md_merged.snap b/tests/core/snapshots/graphql-nested-datasource.md_merged.snap index 1df65b0e41..188f91e42d 100644 --- a/tests/core/snapshots/graphql-nested-datasource.md_merged.snap +++ b/tests/core/snapshots/graphql-nested-datasource.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/grpc-batch.md_0.snap b/tests/core/snapshots/grpc-batch.md_0.snap index 7239944846..be635252b4 100644 --- a/tests/core/snapshots/grpc-batch.md_0.snap +++ b/tests/core/snapshots/grpc-batch.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-batch.md_client.snap b/tests/core/snapshots/grpc-batch.md_client.snap index 0e51757fea..56f7281504 100644 --- a/tests/core/snapshots/grpc-batch.md_client.snap +++ b/tests/core/snapshots/grpc-batch.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { body: String diff --git a/tests/core/snapshots/grpc-batch.md_merged.snap b/tests/core/snapshots/grpc-batch.md_merged.snap index eba7964e99..b58b47d536 100644 --- a/tests/core/snapshots/grpc-batch.md_merged.snap +++ b/tests/core/snapshots/grpc-batch.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) diff --git a/tests/core/snapshots/grpc-error.md_0.snap b/tests/core/snapshots/grpc-error.md_0.snap index cca7ca0d8c..22cf68df3e 100644 --- a/tests/core/snapshots/grpc-error.md_0.snap +++ b/tests/core/snapshots/grpc-error.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-error.md_client.snap b/tests/core/snapshots/grpc-error.md_client.snap index 0e51757fea..56f7281504 100644 --- a/tests/core/snapshots/grpc-error.md_client.snap +++ b/tests/core/snapshots/grpc-error.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { body: String diff --git a/tests/core/snapshots/grpc-error.md_merged.snap b/tests/core/snapshots/grpc-error.md_merged.snap index c5d81eb03d..ce7d6911d6 100644 --- a/tests/core/snapshots/grpc-error.md_merged.snap +++ b/tests/core/snapshots/grpc-error.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) diff --git a/tests/core/snapshots/grpc-json.md_0.snap b/tests/core/snapshots/grpc-json.md_0.snap index 889f672334..9a083f33cb 100644 --- a/tests/core/snapshots/grpc-json.md_0.snap +++ b/tests/core/snapshots/grpc-json.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-json.md_1.snap b/tests/core/snapshots/grpc-json.md_1.snap index 39d361b21d..8f3864560e 100644 --- a/tests/core/snapshots/grpc-json.md_1.snap +++ b/tests/core/snapshots/grpc-json.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-json.md_2.snap b/tests/core/snapshots/grpc-json.md_2.snap index f312fe8482..9fe5ee58d4 100644 --- a/tests/core/snapshots/grpc-json.md_2.snap +++ b/tests/core/snapshots/grpc-json.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-json.md_client.snap b/tests/core/snapshots/grpc-json.md_client.snap index 4103cad8e9..3877c6c6bc 100644 --- a/tests/core/snapshots/grpc-json.md_client.snap +++ b/tests/core/snapshots/grpc-json.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { body: String diff --git a/tests/core/snapshots/grpc-json.md_merged.snap b/tests/core/snapshots/grpc-json.md_merged.snap index 9400e1eee4..7c0e006055 100644 --- a/tests/core/snapshots/grpc-json.md_merged.snap +++ b/tests/core/snapshots/grpc-json.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/core/snapshots/grpc-map.md_0.snap b/tests/core/snapshots/grpc-map.md_0.snap index e4157fdb54..e9fad61007 100644 --- a/tests/core/snapshots/grpc-map.md_0.snap +++ b/tests/core/snapshots/grpc-map.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-map.md_client.snap b/tests/core/snapshots/grpc-map.md_client.snap index d4b17d5402..6e8eeee23a 100644 --- a/tests/core/snapshots/grpc-map.md_client.snap +++ b/tests/core/snapshots/grpc-map.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar JSON diff --git a/tests/core/snapshots/grpc-map.md_merged.snap b/tests/core/snapshots/grpc-map.md_merged.snap index a9522031c4..0e3bd11495 100644 --- a/tests/core/snapshots/grpc-map.md_merged.snap +++ b/tests/core/snapshots/grpc-map.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_0.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_0.snap index faaf53b6bd..7265041240 100644 --- a/tests/core/snapshots/grpc-proto-with-same-package.md_0.snap +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap index f768889b32..81b7f08b59 100644 --- a/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { bar: String diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap index 3cd137670d..fea294c4d1 100644 --- a/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream @link(src: "foo.proto", type: Protobuf) @link(src: "bar.proto", type: Protobuf) { query: Query diff --git a/tests/core/snapshots/grpc-reflection.md_0.snap b/tests/core/snapshots/grpc-reflection.md_0.snap index f4f2990d59..29091d9912 100644 --- a/tests/core/snapshots/grpc-reflection.md_0.snap +++ b/tests/core/snapshots/grpc-reflection.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-reflection.md_client.snap b/tests/core/snapshots/grpc-reflection.md_client.snap index 2a5f5b8c4c..775dcd201a 100644 --- a/tests/core/snapshots/grpc-reflection.md_client.snap +++ b/tests/core/snapshots/grpc-reflection.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { body: String diff --git a/tests/core/snapshots/grpc-reflection.md_merged.snap b/tests/core/snapshots/grpc-reflection.md_merged.snap index ec63b23f6f..45e6161a49 100644 --- a/tests/core/snapshots/grpc-reflection.md_merged.snap +++ b/tests/core/snapshots/grpc-reflection.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream(httpCache: 42) @link(src: "http://localhost:50051", type: Grpc) { query: Query diff --git a/tests/core/snapshots/grpc-simple.md_0.snap b/tests/core/snapshots/grpc-simple.md_0.snap index f4f2990d59..29091d9912 100644 --- a/tests/core/snapshots/grpc-simple.md_0.snap +++ b/tests/core/snapshots/grpc-simple.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-simple.md_client.snap b/tests/core/snapshots/grpc-simple.md_client.snap index 24a54d50fd..2fd977b45a 100644 --- a/tests/core/snapshots/grpc-simple.md_client.snap +++ b/tests/core/snapshots/grpc-simple.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Empty diff --git a/tests/core/snapshots/grpc-simple.md_merged.snap b/tests/core/snapshots/grpc-simple.md_merged.snap index db8c337675..4a7096d633 100644 --- a/tests/core/snapshots/grpc-simple.md_merged.snap +++ b/tests/core/snapshots/grpc-simple.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_0.snap b/tests/core/snapshots/grpc-url-from-upstream.md_0.snap index f4f2990d59..29091d9912 100644 --- a/tests/core/snapshots/grpc-url-from-upstream.md_0.snap +++ b/tests/core/snapshots/grpc-url-from-upstream.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_client.snap b/tests/core/snapshots/grpc-url-from-upstream.md_client.snap index 0e51757fea..56f7281504 100644 --- a/tests/core/snapshots/grpc-url-from-upstream.md_client.snap +++ b/tests/core/snapshots/grpc-url-from-upstream.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { body: String diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap b/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap index c5d81eb03d..ce7d6911d6 100644 --- a/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap +++ b/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) diff --git a/tests/core/snapshots/http-select.md_0.snap b/tests/core/snapshots/http-select.md_0.snap index 81a80739bd..c69ceb338c 100644 --- a/tests/core/snapshots/http-select.md_0.snap +++ b/tests/core/snapshots/http-select.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/http-select.md_client.snap b/tests/core/snapshots/http-select.md_client.snap index d8e1dae7c9..351326dd73 100644 --- a/tests/core/snapshots/http-select.md_client.snap +++ b/tests/core/snapshots/http-select.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Company { catchPhrase: String! diff --git a/tests/core/snapshots/http-select.md_merged.snap b/tests/core/snapshots/http-select.md_merged.snap index 49be827426..e4d0762b3d 100644 --- a/tests/core/snapshots/http-select.md_merged.snap +++ b/tests/core/snapshots/http-select.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/https.md_merged.snap b/tests/core/snapshots/https.md_merged.snap deleted file mode 100644 index 8868c6973d..0000000000 --- a/tests/core/snapshots/https.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server @upstream { - query: Query -} - -type Query { - firstUser: User @http(url: "http://jsonplaceholder.typicode.com/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/core/snapshots/inline-field.md_0.snap b/tests/core/snapshots/inline-field.md_0.snap index 9b27f8fefd..b65a725f76 100644 --- a/tests/core/snapshots/inline-field.md_0.snap +++ b/tests/core/snapshots/inline-field.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/inline-field.md_client.snap b/tests/core/snapshots/inline-field.md_client.snap index 63bde3baf7..ecbe57978f 100644 --- a/tests/core/snapshots/inline-field.md_client.snap +++ b/tests/core/snapshots/inline-field.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/inline-field.md_merged.snap b/tests/core/snapshots/inline-field.md_merged.snap index 3b5dd5f9b3..b7d85eff28 100644 --- a/tests/core/snapshots/inline-field.md_merged.snap +++ b/tests/core/snapshots/inline-field.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/inline-index-list.md_0.snap b/tests/core/snapshots/inline-index-list.md_0.snap index a5b7c188b6..5316822d92 100644 --- a/tests/core/snapshots/inline-index-list.md_0.snap +++ b/tests/core/snapshots/inline-index-list.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/inline-index-list.md_client.snap b/tests/core/snapshots/inline-index-list.md_client.snap index 24efe190ff..fab90bddd5 100644 --- a/tests/core/snapshots/inline-index-list.md_client.snap +++ b/tests/core/snapshots/inline-index-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { username: String diff --git a/tests/core/snapshots/inline-index-list.md_merged.snap b/tests/core/snapshots/inline-index-list.md_merged.snap index b321ecb476..f882d01595 100644 --- a/tests/core/snapshots/inline-index-list.md_merged.snap +++ b/tests/core/snapshots/inline-index-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/inline-many-list.md_client.snap b/tests/core/snapshots/inline-many-list.md_client.snap index 09e87d9d02..fd7b65c7ec 100644 --- a/tests/core/snapshots/inline-many-list.md_client.snap +++ b/tests/core/snapshots/inline-many-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { u: U diff --git a/tests/core/snapshots/inline-many-list.md_merged.snap b/tests/core/snapshots/inline-many-list.md_merged.snap index 9174c51993..abca133e5c 100644 --- a/tests/core/snapshots/inline-many-list.md_merged.snap +++ b/tests/core/snapshots/inline-many-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/inline-many.md_client.snap b/tests/core/snapshots/inline-many.md_client.snap index 7bc026e96f..fc68f625a2 100644 --- a/tests/core/snapshots/inline-many.md_client.snap +++ b/tests/core/snapshots/inline-many.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/inline-many.md_merged.snap b/tests/core/snapshots/inline-many.md_merged.snap index 0cdc230a82..ea4a72d0b9 100644 --- a/tests/core/snapshots/inline-many.md_merged.snap +++ b/tests/core/snapshots/inline-many.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/input-type-protected-error.md_error.snap b/tests/core/snapshots/input-type-protected-error.md_error.snap index e09e747a24..48a5bf75f6 100644 --- a/tests/core/snapshots/input-type-protected-error.md_error.snap +++ b/tests/core/snapshots/input-type-protected-error.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_0.snap b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_0.snap index 661accca7b..279fcf6e75 100644 --- a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_0.snap +++ b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_1.snap b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_1.snap index 537dca8d84..783e9db8ff 100644 --- a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_1.snap +++ b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_client.snap b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_client.snap index 6d42200537..a5ce7809f1 100644 --- a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_client.snap +++ b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Date diff --git a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_merged.snap b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_merged.snap index 2c671cbd93..9405de31b1 100644 --- a/tests/core/snapshots/introspection-query-with-disabled-introspection.md_merged.snap +++ b/tests/core/snapshots/introspection-query-with-disabled-introspection.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", introspection: false, port: 8001, queryValidation: false) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/io-cache.md_0.snap b/tests/core/snapshots/io-cache.md_0.snap index 78ec8aca42..cdbecf2289 100644 --- a/tests/core/snapshots/io-cache.md_0.snap +++ b/tests/core/snapshots/io-cache.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/io-cache.md_client.snap b/tests/core/snapshots/io-cache.md_client.snap index c0f0d1dae9..3781e69ea1 100644 --- a/tests/core/snapshots/io-cache.md_client.snap +++ b/tests/core/snapshots/io-cache.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String! diff --git a/tests/core/snapshots/io-cache.md_merged.snap b/tests/core/snapshots/io-cache.md_merged.snap index ceea8fa892..2061e7c7d8 100644 --- a/tests/core/snapshots/io-cache.md_merged.snap +++ b/tests/core/snapshots/io-cache.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream(httpCache: 42) { query: Query diff --git a/tests/core/snapshots/jit-enum-array.md_0.snap b/tests/core/snapshots/jit-enum-array.md_0.snap index 7758ba58c3..249f61486f 100644 --- a/tests/core/snapshots/jit-enum-array.md_0.snap +++ b/tests/core/snapshots/jit-enum-array.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/jit-enum-array.md_client.snap b/tests/core/snapshots/jit-enum-array.md_client.snap index 6248f5bfaa..7d6f81127e 100644 --- a/tests/core/snapshots/jit-enum-array.md_client.snap +++ b/tests/core/snapshots/jit-enum-array.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type DTA { departments: [Department] diff --git a/tests/core/snapshots/jit-enum-array.md_merged.snap b/tests/core/snapshots/jit-enum-array.md_merged.snap index b2f1e82971..7b5846a999 100644 --- a/tests/core/snapshots/jit-enum-array.md_merged.snap +++ b/tests/core/snapshots/jit-enum-array.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/js-directive.md_0.snap b/tests/core/snapshots/js-directive.md_0.snap index bba13ddb0e..77ab987809 100644 --- a/tests/core/snapshots/js-directive.md_0.snap +++ b/tests/core/snapshots/js-directive.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/js-directive.md_client.snap b/tests/core/snapshots/js-directive.md_client.snap index 8cf0b9181a..c604bcc5ab 100644 --- a/tests/core/snapshots/js-directive.md_client.snap +++ b/tests/core/snapshots/js-directive.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { hello: User! diff --git a/tests/core/snapshots/js-directive.md_merged.snap b/tests/core/snapshots/js-directive.md_merged.snap index 36a6ff5048..77a5c05e58 100644 --- a/tests/core/snapshots/js-directive.md_merged.snap +++ b/tests/core/snapshots/js-directive.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream @link(src: "test.js", type: Script) { query: Query diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_0.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_0.snap index 64e4c375c5..cdb871f288 100644 --- a/tests/core/snapshots/jsonplaceholder-call-post.md_0.snap +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap index e86a8ddb4b..5c6d56dee0 100644 --- a/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int! diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap index 827ad6ac0d..15677c3e90 100644 --- a/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream(batch: {delay: 100, headers: []}, httpCache: 42) { query: Query diff --git a/tests/core/snapshots/test-nested-link.md_client.snap b/tests/core/snapshots/merge-linked-config.md_client.snap similarity index 83% rename from tests/core/snapshots/test-nested-link.md_client.snap rename to tests/core/snapshots/merge-linked-config.md_client.snap index a1839b52b8..d46a44fd2d 100644 --- a/tests/core/snapshots/test-nested-link.md_client.snap +++ b/tests/core/snapshots/merge-linked-config.md_client.snap @@ -1,10 +1,10 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- -enum Foo { - BAR - BAZ +type Foo { + foo: String } type Post { diff --git a/tests/core/snapshots/test-nested-link.md_merged.snap b/tests/core/snapshots/merge-linked-config.md_merged.snap similarity index 68% rename from tests/core/snapshots/test-nested-link.md_merged.snap rename to tests/core/snapshots/merge-linked-config.md_merged.snap index 02fdc7e986..a0eed4f4f4 100644 --- a/tests/core/snapshots/test-nested-link.md_merged.snap +++ b/tests/core/snapshots/merge-linked-config.md_merged.snap @@ -1,19 +1,18 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema - @server - @upstream - @link(src: "graphql-with-link.graphql", type: Config) - @link(src: "link-enum.graphql", type: Config) - @link(src: "link-enum.graphql", type: Config) { + @server(port: 8000) + @upstream(batch: {delay: 10, headers: []}, httpCache: 10) + @link(src: "link-1.graphql", type: Config) + @link(src: "link-2.graphql", type: Config) { query: Query } -enum Foo { - BAR - BAZ +type Foo { + foo: String } type Post { diff --git a/tests/core/snapshots/modified-field.md_0.snap b/tests/core/snapshots/modified-field.md_0.snap index f932b05da0..6c4d359524 100644 --- a/tests/core/snapshots/modified-field.md_0.snap +++ b/tests/core/snapshots/modified-field.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/modified-field.md_client.snap b/tests/core/snapshots/modified-field.md_client.snap index 52961967eb..60c4b09bc1 100644 --- a/tests/core/snapshots/modified-field.md_client.snap +++ b/tests/core/snapshots/modified-field.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/modified-field.md_merged.snap b/tests/core/snapshots/modified-field.md_merged.snap index 43b1759025..28da51b4ce 100644 --- a/tests/core/snapshots/modified-field.md_merged.snap +++ b/tests/core/snapshots/modified-field.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/mutation-put.md_0.snap b/tests/core/snapshots/mutation-put.md_0.snap index df1c1b3a6d..5b81613cb4 100644 --- a/tests/core/snapshots/mutation-put.md_0.snap +++ b/tests/core/snapshots/mutation-put.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/mutation-put.md_client.snap b/tests/core/snapshots/mutation-put.md_client.snap index 68ec1619a5..2bda8392b3 100644 --- a/tests/core/snapshots/mutation-put.md_client.snap +++ b/tests/core/snapshots/mutation-put.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Mutation { insertPost(input: PostInput!): Post diff --git a/tests/core/snapshots/mutation-put.md_merged.snap b/tests/core/snapshots/mutation-put.md_merged.snap index 399f8de825..66deccd6c3 100644 --- a/tests/core/snapshots/mutation-put.md_merged.snap +++ b/tests/core/snapshots/mutation-put.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/mutation.md_0.snap b/tests/core/snapshots/mutation.md_0.snap index a0b72d835b..4f1b70831d 100644 --- a/tests/core/snapshots/mutation.md_0.snap +++ b/tests/core/snapshots/mutation.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/mutation.md_client.snap b/tests/core/snapshots/mutation.md_client.snap index 1cf97bc546..b2c6440371 100644 --- a/tests/core/snapshots/mutation.md_client.snap +++ b/tests/core/snapshots/mutation.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Mutation { insertPost(input: PostInput): Post diff --git a/tests/core/snapshots/mutation.md_merged.snap b/tests/core/snapshots/mutation.md_merged.snap index 81e5c4c893..3e22765196 100644 --- a/tests/core/snapshots/mutation.md_merged.snap +++ b/tests/core/snapshots/mutation.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/n-plus-one-list.md_0.snap b/tests/core/snapshots/n-plus-one-list.md_0.snap index f25f1dd6ba..eb4bd609f0 100644 --- a/tests/core/snapshots/n-plus-one-list.md_0.snap +++ b/tests/core/snapshots/n-plus-one-list.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/n-plus-one-list.md_client.snap b/tests/core/snapshots/n-plus-one-list.md_client.snap index 6d9f4383a0..aef1e632f0 100644 --- a/tests/core/snapshots/n-plus-one-list.md_client.snap +++ b/tests/core/snapshots/n-plus-one-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { foo: [Foo] diff --git a/tests/core/snapshots/n-plus-one-list.md_merged.snap b/tests/core/snapshots/n-plus-one-list.md_merged.snap index 3b11a2cea8..5d5377c758 100644 --- a/tests/core/snapshots/n-plus-one-list.md_merged.snap +++ b/tests/core/snapshots/n-plus-one-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 1000}) { query: Query diff --git a/tests/core/snapshots/n-plus-one.md_0.snap b/tests/core/snapshots/n-plus-one.md_0.snap index 4293f81a84..7b4115fd2f 100644 --- a/tests/core/snapshots/n-plus-one.md_0.snap +++ b/tests/core/snapshots/n-plus-one.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/n-plus-one.md_client.snap b/tests/core/snapshots/n-plus-one.md_client.snap index 6d9f4383a0..aef1e632f0 100644 --- a/tests/core/snapshots/n-plus-one.md_client.snap +++ b/tests/core/snapshots/n-plus-one.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { foo: [Foo] diff --git a/tests/core/snapshots/n-plus-one.md_merged.snap b/tests/core/snapshots/n-plus-one.md_merged.snap index 3b11a2cea8..5d5377c758 100644 --- a/tests/core/snapshots/n-plus-one.md_merged.snap +++ b/tests/core/snapshots/n-plus-one.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 1000}) { query: Query diff --git a/tests/core/snapshots/nested-objects.md_0.snap b/tests/core/snapshots/nested-objects.md_0.snap index 81e0aa2d2f..24800a1d03 100644 --- a/tests/core/snapshots/nested-objects.md_0.snap +++ b/tests/core/snapshots/nested-objects.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/nested-objects.md_client.snap b/tests/core/snapshots/nested-objects.md_client.snap index f429615b8a..649ef646bb 100644 --- a/tests/core/snapshots/nested-objects.md_client.snap +++ b/tests/core/snapshots/nested-objects.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Address { geo: Geo diff --git a/tests/core/snapshots/nested-objects.md_merged.snap b/tests/core/snapshots/nested-objects.md_merged.snap index 1d098fabf2..24d851ab08 100644 --- a/tests/core/snapshots/nested-objects.md_merged.snap +++ b/tests/core/snapshots/nested-objects.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/nested-recursive-types.md_0.snap b/tests/core/snapshots/nested-recursive-types.md_0.snap index 9117c7f5ee..4c93daf346 100644 --- a/tests/core/snapshots/nested-recursive-types.md_0.snap +++ b/tests/core/snapshots/nested-recursive-types.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/nested-recursive-types.md_client.snap b/tests/core/snapshots/nested-recursive-types.md_client.snap index 712e24e7b9..111ec6156c 100644 --- a/tests/core/snapshots/nested-recursive-types.md_client.snap +++ b/tests/core/snapshots/nested-recursive-types.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Connection { nested: NestedUser diff --git a/tests/core/snapshots/nested-recursive-types.md_merged.snap b/tests/core/snapshots/nested-recursive-types.md_merged.snap index e61ece34f7..2904c9f4c0 100644 --- a/tests/core/snapshots/nested-recursive-types.md_merged.snap +++ b/tests/core/snapshots/nested-recursive-types.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/nesting-level3.md_0.snap b/tests/core/snapshots/nesting-level3.md_0.snap index bf53033aef..e0aa837d9e 100644 --- a/tests/core/snapshots/nesting-level3.md_0.snap +++ b/tests/core/snapshots/nesting-level3.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/nesting-level3.md_client.snap b/tests/core/snapshots/nesting-level3.md_client.snap index b1c4dd47f4..ddb7f3704c 100644 --- a/tests/core/snapshots/nesting-level3.md_client.snap +++ b/tests/core/snapshots/nesting-level3.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/nesting-level3.md_merged.snap b/tests/core/snapshots/nesting-level3.md_merged.snap index fd3480ea1b..5d06891c89 100644 --- a/tests/core/snapshots/nesting-level3.md_merged.snap +++ b/tests/core/snapshots/nesting-level3.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/non-scalar-value-in-query.md_error.snap b/tests/core/snapshots/non-scalar-value-in-query.md_error.snap new file mode 100644 index 0000000000..af9fd14ede --- /dev/null +++ b/tests/core/snapshots/non-scalar-value-in-query.md_error.snap @@ -0,0 +1,61 @@ +--- +source: tests/core/spec.rs +expression: errors +snapshot_kind: text +--- +[ + { + "message": "too few parts in template", + "trace": [ + "Query", + "invalidArgument", + "@http", + "query" + ], + "description": null + }, + { + "message": "value 'Nested' is not of a scalar type", + "trace": [ + "Query", + "invalidArgumentType", + "@http", + "query", + "criteria" + ], + "description": null + }, + { + "message": "no argument 'criterias' found", + "trace": [ + "Query", + "unknownArgument", + "@http", + "query", + "criterias" + ], + "description": null + }, + { + "message": "Cannot find type Criteria in the config", + "trace": [ + "Query", + "unknownArgumentType", + "@http", + "query", + "criteria" + ], + "description": null + }, + { + "message": "field unknown_field not found", + "trace": [ + "Query", + "unknownField", + "@http", + "query", + "criteria" + ], + "description": null + } +] diff --git a/tests/core/snapshots/nullable-arg-query.md_0.snap b/tests/core/snapshots/nullable-arg-query.md_0.snap index 416637ca30..da0f1897b8 100644 --- a/tests/core/snapshots/nullable-arg-query.md_0.snap +++ b/tests/core/snapshots/nullable-arg-query.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/nullable-arg-query.md_1.snap b/tests/core/snapshots/nullable-arg-query.md_1.snap index fba365192d..7e64e79649 100644 --- a/tests/core/snapshots/nullable-arg-query.md_1.snap +++ b/tests/core/snapshots/nullable-arg-query.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/nullable-arg-query.md_client.snap b/tests/core/snapshots/nullable-arg-query.md_client.snap index 102efec113..16de7af77f 100644 --- a/tests/core/snapshots/nullable-arg-query.md_client.snap +++ b/tests/core/snapshots/nullable-arg-query.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { users(id: ID): [User] diff --git a/tests/core/snapshots/nullable-arg-query.md_merged.snap b/tests/core/snapshots/nullable-arg-query.md_merged.snap index 74427ecda9..49b909205c 100644 --- a/tests/core/snapshots/nullable-arg-query.md_merged.snap +++ b/tests/core/snapshots/nullable-arg-query.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/omit-index-list.md_0.snap b/tests/core/snapshots/omit-index-list.md_0.snap index a5b7c188b6..5316822d92 100644 --- a/tests/core/snapshots/omit-index-list.md_0.snap +++ b/tests/core/snapshots/omit-index-list.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/omit-index-list.md_client.snap b/tests/core/snapshots/omit-index-list.md_client.snap index 24efe190ff..fab90bddd5 100644 --- a/tests/core/snapshots/omit-index-list.md_client.snap +++ b/tests/core/snapshots/omit-index-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { username: String diff --git a/tests/core/snapshots/omit-index-list.md_merged.snap b/tests/core/snapshots/omit-index-list.md_merged.snap index b321ecb476..f882d01595 100644 --- a/tests/core/snapshots/omit-index-list.md_merged.snap +++ b/tests/core/snapshots/omit-index-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/omit-many.md_client.snap b/tests/core/snapshots/omit-many.md_client.snap index 87b249b134..395057b443 100644 --- a/tests/core/snapshots/omit-many.md_client.snap +++ b/tests/core/snapshots/omit-many.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/omit-many.md_merged.snap b/tests/core/snapshots/omit-many.md_merged.snap index f583e86cff..a74b2b4107 100644 --- a/tests/core/snapshots/omit-many.md_merged.snap +++ b/tests/core/snapshots/omit-many.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/omit-resolved-by-parent.md_0.snap b/tests/core/snapshots/omit-resolved-by-parent.md_0.snap index 33ee8d1664..2376824b33 100644 --- a/tests/core/snapshots/omit-resolved-by-parent.md_0.snap +++ b/tests/core/snapshots/omit-resolved-by-parent.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/omit-resolved-by-parent.md_client.snap b/tests/core/snapshots/omit-resolved-by-parent.md_client.snap index 63bde3baf7..ecbe57978f 100644 --- a/tests/core/snapshots/omit-resolved-by-parent.md_client.snap +++ b/tests/core/snapshots/omit-resolved-by-parent.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/omit-resolved-by-parent.md_merged.snap b/tests/core/snapshots/omit-resolved-by-parent.md_merged.snap index f823d4c745..199f9cf9ec 100644 --- a/tests/core/snapshots/omit-resolved-by-parent.md_merged.snap +++ b/tests/core/snapshots/omit-resolved-by-parent.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-static-value.md_0.snap b/tests/core/snapshots/on-response-body-grpc.md_0.snap similarity index 64% rename from tests/core/snapshots/test-static-value.md_0.snap rename to tests/core/snapshots/on-response-body-grpc.md_0.snap index a085a7c561..6e2afff99b 100644 --- a/tests/core/snapshots/test-static-value.md_0.snap +++ b/tests/core/snapshots/on-response-body-grpc.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, @@ -9,8 +10,9 @@ expression: response }, "body": { "data": { - "firstUser": { - "name": "Leanne Graham" + "newsById": { + "id": 2, + "title": "Note 2 - Changed by JS" } } } diff --git a/tests/core/snapshots/test-static-value.md_client.snap b/tests/core/snapshots/on-response-body-grpc.md_client.snap similarity index 52% rename from tests/core/snapshots/test-static-value.md_client.snap rename to tests/core/snapshots/on-response-body-grpc.md_client.snap index 2215e476ec..f88c5a4194 100644 --- a/tests/core/snapshots/test-static-value.md_client.snap +++ b/tests/core/snapshots/on-response-body-grpc.md_client.snap @@ -1,14 +1,17 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- -type Query { - firstUser: User +type News { + body: String + id: Int + postImage: String + title: String } -type User { - id: Int - name: String +type Query { + newsById: News! } schema { diff --git a/tests/core/snapshots/on-response-body-grpc.md_merged.snap b/tests/core/snapshots/on-response-body-grpc.md_merged.snap new file mode 100644 index 0000000000..3d4a34a30f --- /dev/null +++ b/tests/core/snapshots/on-response-body-grpc.md_merged.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: formatter +snapshot_kind: text +--- +schema + @server(port: 8000) + @upstream + @link(src: "test.js", type: Script) + @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type Query { + newsById: News! + @grpc( + url: "http://localhost:50051" + body: {id: 2} + method: "news.NewsService.GetNews" + onResponseBody: "onResponse" + ) +} diff --git a/tests/core/snapshots/predefined-scalar.md_error.snap b/tests/core/snapshots/predefined-scalar.md_error.snap index f453e7bfcb..afdbf5cdf9 100644 --- a/tests/core/snapshots/predefined-scalar.md_error.snap +++ b/tests/core/snapshots/predefined-scalar.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/recursive-types-json.md_0.snap b/tests/core/snapshots/recursive-types-json.md_0.snap deleted file mode 100644 index f92af42448..0000000000 --- a/tests/core/snapshots/recursive-types-json.md_0.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: tests/core/spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "User1", - "id": 1, - "connections": [ - { - "type": "friend", - "user": { - "name": "User2", - "id": 2, - "connections": [ - { - "user": { - "name": "User3", - "id": 3 - } - }, - { - "user": { - "name": "User4", - "id": 4 - } - } - ] - } - } - ] - } - } - } -} diff --git a/tests/core/snapshots/recursive-types-json.md_1.snap b/tests/core/snapshots/recursive-types-json.md_1.snap deleted file mode 100644 index cb47da11fe..0000000000 --- a/tests/core/snapshots/recursive-types-json.md_1.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/core/spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "createUser": { - "name": "NewUser", - "id": 111, - "connections": [ - { - "type": "friend", - "user": { - "name": "User1", - "id": 1 - } - } - ] - } - } - } -} diff --git a/tests/core/snapshots/recursive-types-json.md_client.snap b/tests/core/snapshots/recursive-types-json.md_client.snap deleted file mode 100644 index d88545ef2e..0000000000 --- a/tests/core/snapshots/recursive-types-json.md_client.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatted ---- -type Connection { - type: String - user: User -} - -input ConnectionInput { - type: String - user: UserInput -} - -type Mutation { - createUser(user: UserInput): User -} - -type Query { - user: User -} - -type User { - connections: [Connection] - id: Int! - name: String! -} - -input UserInput { - connections: [ConnectionInput] - id: Int! - name: String! -} - -schema { - query: Query - mutation: Mutation -} diff --git a/tests/core/snapshots/recursive-types-json.md_merged.snap b/tests/core/snapshots/recursive-types-json.md_merged.snap deleted file mode 100644 index 7722b453d6..0000000000 --- a/tests/core/snapshots/recursive-types-json.md_merged.snap +++ /dev/null @@ -1,39 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server @upstream(httpCache: 42) { - query: Query - mutation: Mutation -} - -input ConnectionInput { - type: String - user: UserInput -} - -input UserInput { - connections: [ConnectionInput] @http(url: "http://jsonplaceholder.typicode.com/connections/{{.value.id}}") - id: Int! - name: String! -} - -type Connection { - type: String - user: User -} - -type Mutation { - createUser(user: UserInput): User - @http(url: "http://jsonplaceholder.typicode.com/user", body: "{{.args.user}}", method: "POST") -} - -type Query { - user: User @http(url: "http://jsonplaceholder.typicode.com/users/1") -} - -type User { - connections: [Connection] @http(url: "http://jsonplaceholder.typicode.com/connections/{{.value.id}}") - id: Int! - name: String! -} diff --git a/tests/core/snapshots/recursive-types-no-resolver.md_error.snap b/tests/core/snapshots/recursive-types-no-resolver.md_error.snap index 5592955499..aeba93ca93 100644 --- a/tests/core/snapshots/recursive-types-no-resolver.md_error.snap +++ b/tests/core/snapshots/recursive-types-no-resolver.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/recursive-types.md_0.snap b/tests/core/snapshots/recursive-types.md_0.snap index f92af42448..85ec074b88 100644 --- a/tests/core/snapshots/recursive-types.md_0.snap +++ b/tests/core/snapshots/recursive-types.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/recursive-types.md_1.snap b/tests/core/snapshots/recursive-types.md_1.snap index cb47da11fe..51070481ff 100644 --- a/tests/core/snapshots/recursive-types.md_1.snap +++ b/tests/core/snapshots/recursive-types.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/recursive-types.md_client.snap b/tests/core/snapshots/recursive-types.md_client.snap index b8b9e5d3c5..f783902dcf 100644 --- a/tests/core/snapshots/recursive-types.md_client.snap +++ b/tests/core/snapshots/recursive-types.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Connection { type: String diff --git a/tests/core/snapshots/recursive-types.md_merged.snap b/tests/core/snapshots/recursive-types.md_merged.snap index 02f7869077..90280f57c1 100644 --- a/tests/core/snapshots/recursive-types.md_merged.snap +++ b/tests/core/snapshots/recursive-types.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/ref-other-nested.md_0.snap b/tests/core/snapshots/ref-other-nested.md_0.snap index 98cad028b7..0f3f3926a9 100644 --- a/tests/core/snapshots/ref-other-nested.md_0.snap +++ b/tests/core/snapshots/ref-other-nested.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/ref-other-nested.md_client.snap b/tests/core/snapshots/ref-other-nested.md_client.snap index 19ae040d8e..3ffedd54a6 100644 --- a/tests/core/snapshots/ref-other-nested.md_client.snap +++ b/tests/core/snapshots/ref-other-nested.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { firstUser: User1 diff --git a/tests/core/snapshots/ref-other-nested.md_merged.snap b/tests/core/snapshots/ref-other-nested.md_merged.snap index 37acaf29d1..c3edd81b2a 100644 --- a/tests/core/snapshots/ref-other-nested.md_merged.snap +++ b/tests/core/snapshots/ref-other-nested.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/ref-other.md_0.snap b/tests/core/snapshots/ref-other.md_0.snap index 73bdac00d5..af89c7a115 100644 --- a/tests/core/snapshots/ref-other.md_0.snap +++ b/tests/core/snapshots/ref-other.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/ref-other.md_client.snap b/tests/core/snapshots/ref-other.md_client.snap index 68645d3a5d..a09023ec12 100644 --- a/tests/core/snapshots/ref-other.md_client.snap +++ b/tests/core/snapshots/ref-other.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { firstUser: User1 diff --git a/tests/core/snapshots/ref-other.md_merged.snap b/tests/core/snapshots/ref-other.md_merged.snap index 3b8283aac8..78690ebe85 100644 --- a/tests/core/snapshots/ref-other.md_merged.snap +++ b/tests/core/snapshots/ref-other.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/related-fields-recursive.md_client.snap b/tests/core/snapshots/related-fields-recursive.md_client.snap index 0d98a90b7b..0fa6594727 100644 --- a/tests/core/snapshots/related-fields-recursive.md_client.snap +++ b/tests/core/snapshots/related-fields-recursive.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type NodeA { name: String diff --git a/tests/core/snapshots/related-fields-recursive.md_merged.snap b/tests/core/snapshots/related-fields-recursive.md_merged.snap index 6b50ea16eb..42aea91f01 100644 --- a/tests/core/snapshots/related-fields-recursive.md_merged.snap +++ b/tests/core/snapshots/related-fields-recursive.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "0.0.0.0", port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/rename-field.md_0.snap b/tests/core/snapshots/rename-field.md_0.snap index 2db7000d43..fc437e146b 100644 --- a/tests/core/snapshots/rename-field.md_0.snap +++ b/tests/core/snapshots/rename-field.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/rename-field.md_1.snap b/tests/core/snapshots/rename-field.md_1.snap index 76cb55bf18..c1ce8de765 100644 --- a/tests/core/snapshots/rename-field.md_1.snap +++ b/tests/core/snapshots/rename-field.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/rename-field.md_client.snap b/tests/core/snapshots/rename-field.md_client.snap index 9dba1fc45e..3da1034de2 100644 --- a/tests/core/snapshots/rename-field.md_client.snap +++ b/tests/core/snapshots/rename-field.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user1: User diff --git a/tests/core/snapshots/rename-field.md_merged.snap b/tests/core/snapshots/rename-field.md_merged.snap index 053ccccd19..cbb865262c 100644 --- a/tests/core/snapshots/rename-field.md_merged.snap +++ b/tests/core/snapshots/rename-field.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/request-to-upstream-batching.md_0.snap b/tests/core/snapshots/request-to-upstream-batching.md_0.snap index 910fe79ff4..a36c0d78ee 100644 --- a/tests/core/snapshots/request-to-upstream-batching.md_0.snap +++ b/tests/core/snapshots/request-to-upstream-batching.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/request-to-upstream-batching.md_client.snap b/tests/core/snapshots/request-to-upstream-batching.md_client.snap index cbcfe5da06..1b9d4f5438 100644 --- a/tests/core/snapshots/request-to-upstream-batching.md_client.snap +++ b/tests/core/snapshots/request-to-upstream-batching.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/request-to-upstream-batching.md_merged.snap b/tests/core/snapshots/request-to-upstream-batching.md_merged.snap index 935f6d2017..0a9c1d0551 100644 --- a/tests/core/snapshots/request-to-upstream-batching.md_merged.snap +++ b/tests/core/snapshots/request-to-upstream-batching.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(batchRequests: true) @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { query: Query diff --git a/tests/core/snapshots/resolve-with-headers.md_0.snap b/tests/core/snapshots/resolve-with-headers.md_0.snap index 918dbaba7a..7c7b0fefcf 100644 --- a/tests/core/snapshots/resolve-with-headers.md_0.snap +++ b/tests/core/snapshots/resolve-with-headers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/resolve-with-headers.md_client.snap b/tests/core/snapshots/resolve-with-headers.md_client.snap index 39d5b00ad3..663b6e0dbf 100644 --- a/tests/core/snapshots/resolve-with-headers.md_client.snap +++ b/tests/core/snapshots/resolve-with-headers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String! diff --git a/tests/core/snapshots/resolve-with-headers.md_merged.snap b/tests/core/snapshots/resolve-with-headers.md_merged.snap index 07a5cb1763..361f24f57b 100644 --- a/tests/core/snapshots/resolve-with-headers.md_merged.snap +++ b/tests/core/snapshots/resolve-with-headers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["authorization"]) { query: Query diff --git a/tests/core/snapshots/resolve-with-vars.md_0.snap b/tests/core/snapshots/resolve-with-vars.md_0.snap index 47bfa75fff..623f147669 100644 --- a/tests/core/snapshots/resolve-with-vars.md_0.snap +++ b/tests/core/snapshots/resolve-with-vars.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/resolve-with-vars.md_client.snap b/tests/core/snapshots/resolve-with-vars.md_client.snap index b72bcbad50..e899abf464 100644 --- a/tests/core/snapshots/resolve-with-vars.md_client.snap +++ b/tests/core/snapshots/resolve-with-vars.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: [User] diff --git a/tests/core/snapshots/resolve-with-vars.md_merged.snap b/tests/core/snapshots/resolve-with-vars.md_merged.snap index d0113a3f37..61fe670e22 100644 --- a/tests/core/snapshots/resolve-with-vars.md_merged.snap +++ b/tests/core/snapshots/resolve-with-vars.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(vars: [{key: "id", value: "1"}]) @upstream { query: Query diff --git a/tests/core/snapshots/resolved-by-parent.md_0.snap b/tests/core/snapshots/resolved-by-parent.md_0.snap index 33ee8d1664..2376824b33 100644 --- a/tests/core/snapshots/resolved-by-parent.md_0.snap +++ b/tests/core/snapshots/resolved-by-parent.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/resolved-by-parent.md_client.snap b/tests/core/snapshots/resolved-by-parent.md_client.snap index 63bde3baf7..ecbe57978f 100644 --- a/tests/core/snapshots/resolved-by-parent.md_client.snap +++ b/tests/core/snapshots/resolved-by-parent.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/resolved-by-parent.md_merged.snap b/tests/core/snapshots/resolved-by-parent.md_merged.snap index f823d4c745..199f9cf9ec 100644 --- a/tests/core/snapshots/resolved-by-parent.md_merged.snap +++ b/tests/core/snapshots/resolved-by-parent.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/rest-api-error.md_0.snap b/tests/core/snapshots/rest-api-error.md_0.snap index 71f1df3c32..b1d703c40f 100644 --- a/tests/core/snapshots/rest-api-error.md_0.snap +++ b/tests/core/snapshots/rest-api-error.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 500, diff --git a/tests/core/snapshots/rest-api-error.md_client.snap b/tests/core/snapshots/rest-api-error.md_client.snap index f0cf6e9796..627d54d3cb 100644 --- a/tests/core/snapshots/rest-api-error.md_client.snap +++ b/tests/core/snapshots/rest-api-error.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/rest-api-error.md_merged.snap b/tests/core/snapshots/rest-api-error.md_merged.snap index ceed6b8faf..2453ce5576 100644 --- a/tests/core/snapshots/rest-api-error.md_merged.snap +++ b/tests/core/snapshots/rest-api-error.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream @link(src: "operation-user.graphql", type: Operation) { query: Query diff --git a/tests/core/snapshots/rest-api-post.md_0.snap b/tests/core/snapshots/rest-api-post.md_0.snap index cc6597baac..ca4925cbd3 100644 --- a/tests/core/snapshots/rest-api-post.md_0.snap +++ b/tests/core/snapshots/rest-api-post.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/rest-api-post.md_client.snap b/tests/core/snapshots/rest-api-post.md_client.snap index f0cf6e9796..627d54d3cb 100644 --- a/tests/core/snapshots/rest-api-post.md_client.snap +++ b/tests/core/snapshots/rest-api-post.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/rest-api-post.md_merged.snap b/tests/core/snapshots/rest-api-post.md_merged.snap index ceed6b8faf..2453ce5576 100644 --- a/tests/core/snapshots/rest-api-post.md_merged.snap +++ b/tests/core/snapshots/rest-api-post.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream @link(src: "operation-user.graphql", type: Operation) { query: Query diff --git a/tests/core/snapshots/rest-api.md_0.snap b/tests/core/snapshots/rest-api.md_0.snap index cc6597baac..ca4925cbd3 100644 --- a/tests/core/snapshots/rest-api.md_0.snap +++ b/tests/core/snapshots/rest-api.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/rest-api.md_client.snap b/tests/core/snapshots/rest-api.md_client.snap index f0cf6e9796..627d54d3cb 100644 --- a/tests/core/snapshots/rest-api.md_client.snap +++ b/tests/core/snapshots/rest-api.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/rest-api.md_merged.snap b/tests/core/snapshots/rest-api.md_merged.snap index ceed6b8faf..2453ce5576 100644 --- a/tests/core/snapshots/rest-api.md_merged.snap +++ b/tests/core/snapshots/rest-api.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream @link(src: "operation-user.graphql", type: Operation) { query: Query diff --git a/tests/core/snapshots/routes-param-on-server-directive.md_0.snap b/tests/core/snapshots/routes-param-on-server-directive.md_0.snap index f683c854d5..1519280e70 100644 --- a/tests/core/snapshots/routes-param-on-server-directive.md_0.snap +++ b/tests/core/snapshots/routes-param-on-server-directive.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/routes-param-on-server-directive.md_1.snap b/tests/core/snapshots/routes-param-on-server-directive.md_1.snap index b5a72701af..06283acff3 100644 --- a/tests/core/snapshots/routes-param-on-server-directive.md_1.snap +++ b/tests/core/snapshots/routes-param-on-server-directive.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/routes-param-on-server-directive.md_client.snap b/tests/core/snapshots/routes-param-on-server-directive.md_client.snap index c06f0e4862..c09f5c8dbf 100644 --- a/tests/core/snapshots/routes-param-on-server-directive.md_client.snap +++ b/tests/core/snapshots/routes-param-on-server-directive.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { users: [User] diff --git a/tests/core/snapshots/routes-param-on-server-directive.md_merged.snap b/tests/core/snapshots/routes-param-on-server-directive.md_merged.snap index 96f8185f8a..810e4fc388 100644 --- a/tests/core/snapshots/routes-param-on-server-directive.md_merged.snap +++ b/tests/core/snapshots/routes-param-on-server-directive.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000, routes: {status: "/health", graphQL: "/tailcall-gql"}) @upstream { query: Query diff --git a/tests/core/snapshots/showcase.md_0.snap b/tests/core/snapshots/showcase.md_0.snap index 13a20b3310..47aa236a6f 100644 --- a/tests/core/snapshots/showcase.md_0.snap +++ b/tests/core/snapshots/showcase.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/showcase.md_1.snap b/tests/core/snapshots/showcase.md_1.snap index 6dfc7e9df6..5ed5cfd68f 100644 --- a/tests/core/snapshots/showcase.md_1.snap +++ b/tests/core/snapshots/showcase.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/showcase.md_2.snap b/tests/core/snapshots/showcase.md_2.snap index fe3dc5a3b5..df024399e3 100644 --- a/tests/core/snapshots/showcase.md_2.snap +++ b/tests/core/snapshots/showcase.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/showcase.md_3.snap b/tests/core/snapshots/showcase.md_3.snap index b178f82042..f92922fe3f 100644 --- a/tests/core/snapshots/showcase.md_3.snap +++ b/tests/core/snapshots/showcase.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/showcase.md_4.snap b/tests/core/snapshots/showcase.md_4.snap index 543411ada6..af8f49fd0a 100644 --- a/tests/core/snapshots/showcase.md_4.snap +++ b/tests/core/snapshots/showcase.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/showcase.md_client.snap b/tests/core/snapshots/showcase.md_client.snap index cf0792fa59..69b16c7027 100644 --- a/tests/core/snapshots/showcase.md_client.snap +++ b/tests/core/snapshots/showcase.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { not_user: User diff --git a/tests/core/snapshots/showcase.md_merged.snap b/tests/core/snapshots/showcase.md_merged.snap index b43ac5ec33..f4494af99b 100644 --- a/tests/core/snapshots/showcase.md_merged.snap +++ b/tests/core/snapshots/showcase.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(showcase: true) @upstream { query: Query diff --git a/tests/core/snapshots/simple-graphql.md_0.snap b/tests/core/snapshots/simple-graphql.md_0.snap index 13a20b3310..47aa236a6f 100644 --- a/tests/core/snapshots/simple-graphql.md_0.snap +++ b/tests/core/snapshots/simple-graphql.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/simple-graphql.md_1.snap b/tests/core/snapshots/simple-graphql.md_1.snap index 543411ada6..af8f49fd0a 100644 --- a/tests/core/snapshots/simple-graphql.md_1.snap +++ b/tests/core/snapshots/simple-graphql.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/simple-graphql.md_client.snap b/tests/core/snapshots/simple-graphql.md_client.snap index 52d67b233a..e7241293e9 100644 --- a/tests/core/snapshots/simple-graphql.md_client.snap +++ b/tests/core/snapshots/simple-graphql.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/simple-graphql.md_merged.snap b/tests/core/snapshots/simple-graphql.md_merged.snap index 9a8bef2a99..e498e56248 100644 --- a/tests/core/snapshots/simple-graphql.md_merged.snap +++ b/tests/core/snapshots/simple-graphql.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/simple-query.md_0.snap b/tests/core/snapshots/simple-query.md_0.snap index d24c105fb6..7f26ed092c 100644 --- a/tests/core/snapshots/simple-query.md_0.snap +++ b/tests/core/snapshots/simple-query.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/simple-query.md_client.snap b/tests/core/snapshots/simple-query.md_client.snap index 2215e476ec..50ede85f7f 100644 --- a/tests/core/snapshots/simple-query.md_client.snap +++ b/tests/core/snapshots/simple-query.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { firstUser: User diff --git a/tests/core/snapshots/simple-query.md_merged.snap b/tests/core/snapshots/simple-query.md_merged.snap index 8868c6973d..8be9e9164e 100644 --- a/tests/core/snapshots/simple-query.md_merged.snap +++ b/tests/core/snapshots/simple-query.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-add-field-error.md_error.snap b/tests/core/snapshots/test-add-field-error.md_error.snap index 7a9527f963..16cb3ca063 100644 --- a/tests/core/snapshots/test-add-field-error.md_error.snap +++ b/tests/core/snapshots/test-add-field-error.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-add-field-list.md_client.snap b/tests/core/snapshots/test-add-field-list.md_client.snap index fc75dbc1c8..519fda6b2d 100644 --- a/tests/core/snapshots/test-add-field-list.md_client.snap +++ b/tests/core/snapshots/test-add-field-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type A { b: B diff --git a/tests/core/snapshots/test-add-field-list.md_merged.snap b/tests/core/snapshots/test-add-field-list.md_merged.snap index 50190e214b..c7c321da44 100644 --- a/tests/core/snapshots/test-add-field-list.md_merged.snap +++ b/tests/core/snapshots/test-add-field-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-add-field.md_client.snap b/tests/core/snapshots/test-add-field.md_client.snap index 9671af581c..d343e08c44 100644 --- a/tests/core/snapshots/test-add-field.md_client.snap +++ b/tests/core/snapshots/test-add-field.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type A { b: B diff --git a/tests/core/snapshots/test-add-field.md_merged.snap b/tests/core/snapshots/test-add-field.md_merged.snap index 8cae36924b..11af3abefd 100644 --- a/tests/core/snapshots/test-add-field.md_merged.snap +++ b/tests/core/snapshots/test-add-field.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap b/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap index aef4222523..04c53c1b6b 100644 --- a/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap +++ b/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- enum Foo { BAR diff --git a/tests/core/snapshots/test-add-link-to-empty-config.md_merged.snap b/tests/core/snapshots/test-add-link-to-empty-config.md_merged.snap index 958855f115..0ef42d8708 100644 --- a/tests/core/snapshots/test-add-link-to-empty-config.md_merged.snap +++ b/tests/core/snapshots/test-add-link-to-empty-config.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream @link(src: "link-expr.graphql", type: Config) @link(src: "link-enum.graphql", type: Config) { query: Query diff --git a/tests/core/snapshots/test-alias-on-enum.md_0.snap b/tests/core/snapshots/test-alias-on-enum.md_0.snap index 3865a02a82..e66e9dcb08 100644 --- a/tests/core/snapshots/test-alias-on-enum.md_0.snap +++ b/tests/core/snapshots/test-alias-on-enum.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-alias-on-enum.md_client.snap b/tests/core/snapshots/test-alias-on-enum.md_client.snap index ba148eb921..b6d627b091 100644 --- a/tests/core/snapshots/test-alias-on-enum.md_client.snap +++ b/tests/core/snapshots/test-alias-on-enum.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type DTA { departments: [Department] diff --git a/tests/core/snapshots/test-alias-on-enum.md_merged.snap b/tests/core/snapshots/test-alias-on-enum.md_merged.snap index d03a191f48..1bd78119ae 100644 --- a/tests/core/snapshots/test-alias-on-enum.md_merged.snap +++ b/tests/core/snapshots/test-alias-on-enum.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(batchRequests: true) @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { query: Query diff --git a/tests/core/snapshots/test-all-blueprint-errors.md_error.snap b/tests/core/snapshots/test-all-blueprint-errors.md_error.snap index 54f6633036..b81b8e69cc 100644 --- a/tests/core/snapshots/test-all-blueprint-errors.md_error.snap +++ b/tests/core/snapshots/test-all-blueprint-errors.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-batch-operator-post.md_error.snap b/tests/core/snapshots/test-batch-operator-post.md_error.snap index 3ac6e3e721..f6e83511b3 100644 --- a/tests/core/snapshots/test-batch-operator-post.md_error.snap +++ b/tests/core/snapshots/test-batch-operator-post.md_error.snap @@ -1,10 +1,11 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { - "message": "GroupBy is only supported for GET requests", + "message": "batchKey requires either body or query parameters", "trace": [ "Query", "user", diff --git a/tests/core/snapshots/test-batching-group-by.md_client.snap b/tests/core/snapshots/test-batching-group-by.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/test-batching-group-by.md_client.snap +++ b/tests/core/snapshots/test-batching-group-by.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/test-batching-group-by.md_merged.snap b/tests/core/snapshots/test-batching-group-by.md_merged.snap index fea8f0aafc..b9155f38bb 100644 --- a/tests/core/snapshots/test-batching-group-by.md_merged.snap +++ b/tests/core/snapshots/test-batching-group-by.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 4000) @upstream(batch: {delay: 1, headers: [], maxSize: 1000}) { query: Query diff --git a/tests/core/snapshots/test-cache.md_client.snap b/tests/core/snapshots/test-cache.md_client.snap index 52d67b233a..e7241293e9 100644 --- a/tests/core/snapshots/test-cache.md_client.snap +++ b/tests/core/snapshots/test-cache.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/test-cache.md_merged.snap b/tests/core/snapshots/test-cache.md_merged.snap index 60b95dc3a6..4d3a1e4f9d 100644 --- a/tests/core/snapshots/test-cache.md_merged.snap +++ b/tests/core/snapshots/test-cache.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-call-operator-errors.md_error.snap b/tests/core/snapshots/test-call-operator-errors.md_error.snap index 7c64620082..02f952f0e3 100644 --- a/tests/core/snapshots/test-call-operator-errors.md_error.snap +++ b/tests/core/snapshots/test-call-operator-errors.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-conflict-allowed-headers.md_merged.snap b/tests/core/snapshots/test-conflict-allowed-headers.md_merged.snap deleted file mode 100644 index d3aa18973c..0000000000 --- a/tests/core/snapshots/test-conflict-allowed-headers.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server @upstream(allowedHeaders: ["a", "b", "c", "d"]) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/core/snapshots/test-conflict-vars.md_merged.snap b/tests/core/snapshots/test-conflict-vars.md_merged.snap deleted file mode 100644 index 5dfdeaaabb..0000000000 --- a/tests/core/snapshots/test-conflict-vars.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server(vars: [{key: "a", value: "b"}, {key: "c", value: "d"}, {key: "p", value: "q"}]) @upstream { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/core/snapshots/test-custom-scalar.md_client.snap b/tests/core/snapshots/test-custom-scalar.md_client.snap index 2f96842cca..e9a26b07d1 100644 --- a/tests/core/snapshots/test-custom-scalar.md_client.snap +++ b/tests/core/snapshots/test-custom-scalar.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Json diff --git a/tests/core/snapshots/test-custom-scalar.md_merged.snap b/tests/core/snapshots/test-custom-scalar.md_merged.snap index 2fa5fda505..57b604fd2d 100644 --- a/tests/core/snapshots/test-custom-scalar.md_merged.snap +++ b/tests/core/snapshots/test-custom-scalar.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-custom-types.md_client.snap b/tests/core/snapshots/test-custom-types.md_client.snap index 13bc848be8..e74271a6ff 100644 --- a/tests/core/snapshots/test-custom-types.md_client.snap +++ b/tests/core/snapshots/test-custom-types.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Mut { insertPost(input: PostInput): Post diff --git a/tests/core/snapshots/test-custom-types.md_merged.snap b/tests/core/snapshots/test-custom-types.md_merged.snap index 85914edbb4..ffecbfc28b 100644 --- a/tests/core/snapshots/test-custom-types.md_merged.snap +++ b/tests/core/snapshots/test-custom-types.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Que diff --git a/tests/core/snapshots/test-dbl-usage-many.md_client.snap b/tests/core/snapshots/test-dbl-usage-many.md_client.snap index 79f3866ae5..aa7b23f2e0 100644 --- a/tests/core/snapshots/test-dbl-usage-many.md_client.snap +++ b/tests/core/snapshots/test-dbl-usage-many.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: ID! diff --git a/tests/core/snapshots/test-dbl-usage-many.md_merged.snap b/tests/core/snapshots/test-dbl-usage-many.md_merged.snap index e688d2e90a..10f595a49d 100644 --- a/tests/core/snapshots/test-dbl-usage-many.md_merged.snap +++ b/tests/core/snapshots/test-dbl-usage-many.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-dedupe.md_0.snap b/tests/core/snapshots/test-dedupe.md_0.snap index 888b1eb108..0f96bf766c 100644 --- a/tests/core/snapshots/test-dedupe.md_0.snap +++ b/tests/core/snapshots/test-dedupe.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-dedupe.md_client.snap b/tests/core/snapshots/test-dedupe.md_client.snap index fd9e443470..30cf05313b 100644 --- a/tests/core/snapshots/test-dedupe.md_client.snap +++ b/tests/core/snapshots/test-dedupe.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/test-dedupe.md_merged.snap b/tests/core/snapshots/test-dedupe.md_merged.snap index ee9bcdee4d..236a2c900b 100644 --- a/tests/core/snapshots/test-dedupe.md_merged.snap +++ b/tests/core/snapshots/test-dedupe.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream(batch: {delay: 1, headers: []}) { query: Query diff --git a/tests/core/snapshots/test-description-many.md_client.snap b/tests/core/snapshots/test-description-many.md_client.snap index 273deb1aa2..272d53b9b3 100644 --- a/tests/core/snapshots/test-description-many.md_client.snap +++ b/tests/core/snapshots/test-description-many.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { """ diff --git a/tests/core/snapshots/test-description-many.md_merged.snap b/tests/core/snapshots/test-description-many.md_merged.snap index d20caf5b81..7b2691b392 100644 --- a/tests/core/snapshots/test-description-many.md_merged.snap +++ b/tests/core/snapshots/test-description-many.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-directives-undef-null-fields.md_error.snap b/tests/core/snapshots/test-directives-undef-null-fields.md_error.snap index adb506ebde..75fc301b09 100644 --- a/tests/core/snapshots/test-directives-undef-null-fields.md_error.snap +++ b/tests/core/snapshots/test-directives-undef-null-fields.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-discriminator-invalid.md_error.snap b/tests/core/snapshots/test-discriminator-invalid.md_error.snap index 2857f6554e..66782ec928 100644 --- a/tests/core/snapshots/test-discriminator-invalid.md_error.snap +++ b/tests/core/snapshots/test-discriminator-invalid.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-duplicated-link.md_error.snap b/tests/core/snapshots/test-duplicated-link.md_error.snap index 3f990dc863..d586ef2efb 100644 --- a/tests/core/snapshots/test-duplicated-link.md_error.snap +++ b/tests/core/snapshots/test-duplicated-link.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-empty-link.md_error.snap b/tests/core/snapshots/test-empty-link.md_error.snap index 6ee4deb1d6..a8d7985844 100644 --- a/tests/core/snapshots/test-empty-link.md_error.snap +++ b/tests/core/snapshots/test-empty-link.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-enable-jit.md_0.snap b/tests/core/snapshots/test-enable-jit.md_0.snap index bac993905e..1e57805967 100644 --- a/tests/core/snapshots/test-enable-jit.md_0.snap +++ b/tests/core/snapshots/test-enable-jit.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enable-jit.md_client.snap b/tests/core/snapshots/test-enable-jit.md_client.snap index f9f9daa9fa..0e8912877b 100644 --- a/tests/core/snapshots/test-enable-jit.md_client.snap +++ b/tests/core/snapshots/test-enable-jit.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int! diff --git a/tests/core/snapshots/test-enable-jit.md_merged.snap b/tests/core/snapshots/test-enable-jit.md_merged.snap index c79d7ac501..3d61f7941a 100644 --- a/tests/core/snapshots/test-enable-jit.md_merged.snap +++ b/tests/core/snapshots/test-enable-jit.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(enableJIT: true, hostname: "0.0.0.0", port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-enum-aliases.md_0.snap b/tests/core/snapshots/test-enum-aliases.md_0.snap index 63a4be352d..e608a998d2 100644 --- a/tests/core/snapshots/test-enum-aliases.md_0.snap +++ b/tests/core/snapshots/test-enum-aliases.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum-aliases.md_client.snap b/tests/core/snapshots/test-enum-aliases.md_client.snap index 61835c8112..81e90b81d1 100644 --- a/tests/core/snapshots/test-enum-aliases.md_client.snap +++ b/tests/core/snapshots/test-enum-aliases.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- enum Foo { BAR diff --git a/tests/core/snapshots/test-enum-aliases.md_merged.snap b/tests/core/snapshots/test-enum-aliases.md_merged.snap index 5034710372..91e46e9261 100644 --- a/tests/core/snapshots/test-enum-aliases.md_merged.snap +++ b/tests/core/snapshots/test-enum-aliases.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-enum-as-argument.md_0.snap b/tests/core/snapshots/test-enum-as-argument.md_0.snap index 65b72721d6..5b23dbc6b7 100644 --- a/tests/core/snapshots/test-enum-as-argument.md_0.snap +++ b/tests/core/snapshots/test-enum-as-argument.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum-as-argument.md_client.snap b/tests/core/snapshots/test-enum-as-argument.md_client.snap index bbeebabcdc..8e8f362180 100644 --- a/tests/core/snapshots/test-enum-as-argument.md_client.snap +++ b/tests/core/snapshots/test-enum-as-argument.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!, test: Test): User diff --git a/tests/core/snapshots/test-enum-as-argument.md_merged.snap b/tests/core/snapshots/test-enum-as-argument.md_merged.snap index 827f9e3471..f7b74c6ca2 100644 --- a/tests/core/snapshots/test-enum-as-argument.md_merged.snap +++ b/tests/core/snapshots/test-enum-as-argument.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-enum-default.md_0.snap b/tests/core/snapshots/test-enum-default.md_0.snap index 84d79bf621..9ae2ce124c 100644 --- a/tests/core/snapshots/test-enum-default.md_0.snap +++ b/tests/core/snapshots/test-enum-default.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum-default.md_client.snap b/tests/core/snapshots/test-enum-default.md_client.snap index 83d4755a05..6d9d8a6553 100644 --- a/tests/core/snapshots/test-enum-default.md_client.snap +++ b/tests/core/snapshots/test-enum-default.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { foo: Status diff --git a/tests/core/snapshots/test-enum-default.md_merged.snap b/tests/core/snapshots/test-enum-default.md_merged.snap index b85ad2e9e1..20c33a1ae6 100644 --- a/tests/core/snapshots/test-enum-default.md_merged.snap +++ b/tests/core/snapshots/test-enum-default.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8080) diff --git a/tests/core/snapshots/test-enum-description.md_0.snap b/tests/core/snapshots/test-enum-description.md_0.snap index 63a4be352d..e608a998d2 100644 --- a/tests/core/snapshots/test-enum-description.md_0.snap +++ b/tests/core/snapshots/test-enum-description.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum-description.md_1.snap b/tests/core/snapshots/test-enum-description.md_1.snap index 444b7bb300..cbbe92cfe0 100644 --- a/tests/core/snapshots/test-enum-description.md_1.snap +++ b/tests/core/snapshots/test-enum-description.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum-description.md_2.snap b/tests/core/snapshots/test-enum-description.md_2.snap index c19c038cf7..7ce161510f 100644 --- a/tests/core/snapshots/test-enum-description.md_2.snap +++ b/tests/core/snapshots/test-enum-description.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum-description.md_client.snap b/tests/core/snapshots/test-enum-description.md_client.snap index e9c648fde9..5ba6833a38 100644 --- a/tests/core/snapshots/test-enum-description.md_client.snap +++ b/tests/core/snapshots/test-enum-description.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- """ Description of enum Foo diff --git a/tests/core/snapshots/test-enum-description.md_merged.snap b/tests/core/snapshots/test-enum-description.md_merged.snap index 7adb432c3e..f8ce409f4d 100644 --- a/tests/core/snapshots/test-enum-description.md_merged.snap +++ b/tests/core/snapshots/test-enum-description.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-enum-empty.md_error.snap b/tests/core/snapshots/test-enum-empty.md_error.snap index 1d843257e5..fa0959164e 100644 --- a/tests/core/snapshots/test-enum-empty.md_error.snap +++ b/tests/core/snapshots/test-enum-empty.md_error.snap @@ -1,10 +1,11 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { - "message": "No variants found for enum", + "message": " --> 9:11\n |\n9 | enum Foo {}\n | ^---\n |\n = expected enum_value_definition", "trace": [], "description": null } diff --git a/tests/core/snapshots/test-enum-merge.md_merged.snap b/tests/core/snapshots/test-enum-merge.md_merged.snap index b89d9c3e49..fc8d316853 100644 --- a/tests/core/snapshots/test-enum-merge.md_merged.snap +++ b/tests/core/snapshots/test-enum-merge.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-enum.md_0.snap b/tests/core/snapshots/test-enum.md_0.snap index 63a4be352d..e608a998d2 100644 --- a/tests/core/snapshots/test-enum.md_0.snap +++ b/tests/core/snapshots/test-enum.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum.md_1.snap b/tests/core/snapshots/test-enum.md_1.snap index 444b7bb300..cbbe92cfe0 100644 --- a/tests/core/snapshots/test-enum.md_1.snap +++ b/tests/core/snapshots/test-enum.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum.md_2.snap b/tests/core/snapshots/test-enum.md_2.snap index c19c038cf7..7ce161510f 100644 --- a/tests/core/snapshots/test-enum.md_2.snap +++ b/tests/core/snapshots/test-enum.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-enum.md_client.snap b/tests/core/snapshots/test-enum.md_client.snap index e9da37a23f..92f7a70fc5 100644 --- a/tests/core/snapshots/test-enum.md_client.snap +++ b/tests/core/snapshots/test-enum.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- enum Foo { BAR diff --git a/tests/core/snapshots/test-enum.md_merged.snap b/tests/core/snapshots/test-enum.md_merged.snap index 437f2b1be7..dbd1544547 100644 --- a/tests/core/snapshots/test-enum.md_merged.snap +++ b/tests/core/snapshots/test-enum.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-eval-partial.md_client.snap b/tests/core/snapshots/test-eval-partial.md_client.snap new file mode 100644 index 0000000000..d3b1311d6c --- /dev/null +++ b/tests/core/snapshots/test-eval-partial.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: formatted +snapshot_kind: text +--- +type Post { + foo: String + id: Int! + user: User + userId: Int! +} + +type Query { + post(id: Int!): [Post] +} + +type User { + id: Int! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-eval-partial.md_merged.snap b/tests/core/snapshots/test-eval-partial.md_merged.snap new file mode 100644 index 0000000000..1ee42b866e --- /dev/null +++ b/tests/core/snapshots/test-eval-partial.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: formatter +snapshot_kind: text +--- +schema @server(port: 8080) @upstream(batch: {delay: 100, headers: []}, httpCache: 42) { + query: Query +} + +type Post { + foo: String @http(url: "http://jsonplaceholder.typicode.com/posts/foo") + id: Int! + user: User @http(url: "http://jsonplaceholder.typicode.com/users/{{.value.userId}}") + userId: Int! +} + +type Query { + post(id: Int!): [Post] @http(url: "http://jsonplaceholder.typicode.com/posts/{{.args.id}}") +} + +type User { + id: Int! +} diff --git a/tests/core/snapshots/test-expr-error.md_error.snap b/tests/core/snapshots/test-expr-error.md_error.snap index cb7db5f40f..924fdbd2d7 100644 --- a/tests/core/snapshots/test-expr-error.md_error.snap +++ b/tests/core/snapshots/test-expr-error.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-expr-scalar-as-string.md_0.snap b/tests/core/snapshots/test-expr-scalar-as-string.md_0.snap index c7349486ac..6794274d5b 100644 --- a/tests/core/snapshots/test-expr-scalar-as-string.md_0.snap +++ b/tests/core/snapshots/test-expr-scalar-as-string.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap b/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap index 88402b4e2f..9b6dcea2db 100644 --- a/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap +++ b/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Entry { arr: String diff --git a/tests/core/snapshots/test-expr-scalar-as-string.md_merged.snap b/tests/core/snapshots/test-expr-scalar-as-string.md_merged.snap index 07a3608830..27657666e1 100644 --- a/tests/core/snapshots/test-expr-scalar-as-string.md_merged.snap +++ b/tests/core/snapshots/test-expr-scalar-as-string.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-expr-with-add-field.md_error.snap b/tests/core/snapshots/test-expr-with-add-field.md_error.snap index 0d8830eac9..2841835094 100644 --- a/tests/core/snapshots/test-expr-with-add-field.md_error.snap +++ b/tests/core/snapshots/test-expr-with-add-field.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-expr-with-inline.md_error.snap b/tests/core/snapshots/test-expr-with-inline.md_error.snap index 0d8830eac9..2841835094 100644 --- a/tests/core/snapshots/test-expr-with-inline.md_error.snap +++ b/tests/core/snapshots/test-expr-with-inline.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-expr-with-mustache.md_0.snap b/tests/core/snapshots/test-expr-with-mustache.md_0.snap index 0f772f2f1c..677819b1de 100644 --- a/tests/core/snapshots/test-expr-with-mustache.md_0.snap +++ b/tests/core/snapshots/test-expr-with-mustache.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-expr-with-mustache.md_client.snap b/tests/core/snapshots/test-expr-with-mustache.md_client.snap index 31ed790efb..cbfed108e0 100644 --- a/tests/core/snapshots/test-expr-with-mustache.md_client.snap +++ b/tests/core/snapshots/test-expr-with-mustache.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type A { a: Int diff --git a/tests/core/snapshots/test-expr-with-mustache.md_merged.snap b/tests/core/snapshots/test-expr-with-mustache.md_merged.snap index ca0e137c7d..b59bb7f1e2 100644 --- a/tests/core/snapshots/test-expr-with-mustache.md_merged.snap +++ b/tests/core/snapshots/test-expr-with-mustache.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-expr.md_client.snap b/tests/core/snapshots/test-expr.md_client.snap index cf7d4e49b2..cf3e72143e 100644 --- a/tests/core/snapshots/test-expr.md_client.snap +++ b/tests/core/snapshots/test-expr.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { hello: String diff --git a/tests/core/snapshots/test-expr.md_merged.snap b/tests/core/snapshots/test-expr.md_merged.snap index b51be71509..3ddfdaa657 100644 --- a/tests/core/snapshots/test-expr.md_merged.snap +++ b/tests/core/snapshots/test-expr.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-field-already-implemented-from-Interface.md_error.snap b/tests/core/snapshots/test-field-already-implemented-from-Interface.md_error.snap index e0af5a9a50..33c08f2890 100644 --- a/tests/core/snapshots/test-field-already-implemented-from-Interface.md_error.snap +++ b/tests/core/snapshots/test-field-already-implemented-from-Interface.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-graphql-with-add-field.md_error.snap b/tests/core/snapshots/test-graphql-with-add-field.md_error.snap index af649e47b8..813a35ddc9 100644 --- a/tests/core/snapshots/test-graphql-with-add-field.md_error.snap +++ b/tests/core/snapshots/test-graphql-with-add-field.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-graphqlsource-no-base-url.md_error.snap b/tests/core/snapshots/test-graphqlsource-no-base-url.md_error.snap index a1a4d2f8d8..8591d0c51f 100644 --- a/tests/core/snapshots/test-graphqlsource-no-base-url.md_error.snap +++ b/tests/core/snapshots/test-graphqlsource-no-base-url.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-graphqlsource.md_client.snap b/tests/core/snapshots/test-graphqlsource.md_client.snap index ab17028638..aa2ad928c4 100644 --- a/tests/core/snapshots/test-graphqlsource.md_client.snap +++ b/tests/core/snapshots/test-graphqlsource.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int! diff --git a/tests/core/snapshots/test-graphqlsource.md_merged.snap b/tests/core/snapshots/test-graphqlsource.md_merged.snap index b150aba580..a66230f9ca 100644 --- a/tests/core/snapshots/test-graphqlsource.md_merged.snap +++ b/tests/core/snapshots/test-graphqlsource.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-groupby-without-batching.md_error.snap b/tests/core/snapshots/test-groupby-without-batching.md_error.snap index b566d7c077..c73e3917c7 100644 --- a/tests/core/snapshots/test-groupby-without-batching.md_error.snap +++ b/tests/core/snapshots/test-groupby-without-batching.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-group-by.md_error.snap b/tests/core/snapshots/test-grpc-group-by.md_error.snap index a4356bd249..9c3d6068ca 100644 --- a/tests/core/snapshots/test-grpc-group-by.md_error.snap +++ b/tests/core/snapshots/test-grpc-group-by.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-invalid-method-format.md_error.snap b/tests/core/snapshots/test-grpc-invalid-method-format.md_error.snap index c2ca8b345f..bca0481047 100644 --- a/tests/core/snapshots/test-grpc-invalid-method-format.md_error.snap +++ b/tests/core/snapshots/test-grpc-invalid-method-format.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-invalid-proto-id.md_error.snap b/tests/core/snapshots/test-grpc-invalid-proto-id.md_error.snap index 36ee7add79..2a0cea068a 100644 --- a/tests/core/snapshots/test-grpc-invalid-proto-id.md_error.snap +++ b/tests/core/snapshots/test-grpc-invalid-proto-id.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-missing-fields.md_error.snap b/tests/core/snapshots/test-grpc-missing-fields.md_error.snap index cdde712544..060f1f371b 100644 --- a/tests/core/snapshots/test-grpc-missing-fields.md_error.snap +++ b/tests/core/snapshots/test-grpc-missing-fields.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-nested-data.md_error.snap b/tests/core/snapshots/test-grpc-nested-data.md_error.snap index 7ae4b0af3a..dcef34981d 100644 --- a/tests/core/snapshots/test-grpc-nested-data.md_error.snap +++ b/tests/core/snapshots/test-grpc-nested-data.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-nested-optional.md_error.snap b/tests/core/snapshots/test-grpc-nested-optional.md_error.snap index 1af2a9fb24..9f8b718472 100644 --- a/tests/core/snapshots/test-grpc-nested-optional.md_error.snap +++ b/tests/core/snapshots/test-grpc-nested-optional.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-optional.md_error.snap b/tests/core/snapshots/test-grpc-optional.md_error.snap index 1af2a9fb24..9f8b718472 100644 --- a/tests/core/snapshots/test-grpc-optional.md_error.snap +++ b/tests/core/snapshots/test-grpc-optional.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-proto-path.md_error.snap b/tests/core/snapshots/test-grpc-proto-path.md_error.snap index 34febb43e4..fe707bb313 100644 --- a/tests/core/snapshots/test-grpc-proto-path.md_error.snap +++ b/tests/core/snapshots/test-grpc-proto-path.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-service-method.md_error.snap b/tests/core/snapshots/test-grpc-service-method.md_error.snap index 95599fc658..a6fc982b8b 100644 --- a/tests/core/snapshots/test-grpc-service-method.md_error.snap +++ b/tests/core/snapshots/test-grpc-service-method.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc-service.md_error.snap b/tests/core/snapshots/test-grpc-service.md_error.snap index 269001ba60..5e0acb95cf 100644 --- a/tests/core/snapshots/test-grpc-service.md_error.snap +++ b/tests/core/snapshots/test-grpc-service.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-grpc.md_client.snap b/tests/core/snapshots/test-grpc.md_client.snap index c2a0078373..3960d84a5b 100644 --- a/tests/core/snapshots/test-grpc.md_client.snap +++ b/tests/core/snapshots/test-grpc.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { body: String diff --git a/tests/core/snapshots/test-grpc.md_merged.snap b/tests/core/snapshots/test-grpc.md_merged.snap index c28e68f243..41d30bb609 100644 --- a/tests/core/snapshots/test-grpc.md_merged.snap +++ b/tests/core/snapshots/test-grpc.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) diff --git a/tests/core/snapshots/test-hostname-faliure.md_error.snap b/tests/core/snapshots/test-hostname-faliure.md_error.snap index 2c6ac4d613..7aa9bcbb6d 100644 --- a/tests/core/snapshots/test-hostname-faliure.md_error.snap +++ b/tests/core/snapshots/test-hostname-faliure.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-http-baseurl.md_client.snap b/tests/core/snapshots/test-http-baseurl.md_client.snap index 72c16c7198..f5da839686 100644 --- a/tests/core/snapshots/test-http-baseurl.md_client.snap +++ b/tests/core/snapshots/test-http-baseurl.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { bar: String diff --git a/tests/core/snapshots/test-http-baseurl.md_merged.snap b/tests/core/snapshots/test-http-baseurl.md_merged.snap index 392fb06d80..cc47be3bf5 100644 --- a/tests/core/snapshots/test-http-baseurl.md_merged.snap +++ b/tests/core/snapshots/test-http-baseurl.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-http-batchKey.md_0.snap b/tests/core/snapshots/test-http-batchKey.md_0.snap index acc6d89665..f1e3f17d0a 100644 --- a/tests/core/snapshots/test-http-batchKey.md_0.snap +++ b/tests/core/snapshots/test-http-batchKey.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-http-batchKey.md_client.snap b/tests/core/snapshots/test-http-batchKey.md_client.snap index ba473f8b6c..bdea45701b 100644 --- a/tests/core/snapshots/test-http-batchKey.md_client.snap +++ b/tests/core/snapshots/test-http-batchKey.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { barName: String! diff --git a/tests/core/snapshots/test-http-batchKey.md_merged.snap b/tests/core/snapshots/test-http-batchKey.md_merged.snap index 9758dc57e8..db32d6cc8b 100644 --- a/tests/core/snapshots/test-http-batchKey.md_merged.snap +++ b/tests/core/snapshots/test-http-batchKey.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream(batch: {delay: 10, headers: [], maxSize: 1000}) { query: Query diff --git a/tests/core/snapshots/test-http-headers.md_client.snap b/tests/core/snapshots/test-http-headers.md_client.snap index 893ac9057a..83535d83b5 100644 --- a/tests/core/snapshots/test-http-headers.md_client.snap +++ b/tests/core/snapshots/test-http-headers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { foo: String diff --git a/tests/core/snapshots/test-http-headers.md_merged.snap b/tests/core/snapshots/test-http-headers.md_merged.snap index b092d6ce5e..c37ce5693a 100644 --- a/tests/core/snapshots/test-http-headers.md_merged.snap +++ b/tests/core/snapshots/test-http-headers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-http-tmpl.md_client.snap b/tests/core/snapshots/test-http-tmpl.md_client.snap index 8fb16284cc..176c973622 100644 --- a/tests/core/snapshots/test-http-tmpl.md_client.snap +++ b/tests/core/snapshots/test-http-tmpl.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int diff --git a/tests/core/snapshots/test-http-tmpl.md_merged.snap b/tests/core/snapshots/test-http-tmpl.md_merged.snap index a6e50217a9..433090ad72 100644 --- a/tests/core/snapshots/test-http-tmpl.md_merged.snap +++ b/tests/core/snapshots/test-http-tmpl.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-http-with-add-field.md_error.snap b/tests/core/snapshots/test-http-with-add-field.md_error.snap index f1751bc827..160c4d809a 100644 --- a/tests/core/snapshots/test-http-with-add-field.md_error.snap +++ b/tests/core/snapshots/test-http-with-add-field.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-http-with-mustache-expr.md_0.snap b/tests/core/snapshots/test-http-with-mustache-expr.md_0.snap index 1f4ae40457..51fbfa64ff 100644 --- a/tests/core/snapshots/test-http-with-mustache-expr.md_0.snap +++ b/tests/core/snapshots/test-http-with-mustache-expr.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap b/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap index 9524d6fce7..6e04035337 100644 --- a/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap +++ b/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type A { a: Int diff --git a/tests/core/snapshots/test-http-with-mustache-expr.md_merged.snap b/tests/core/snapshots/test-http-with-mustache-expr.md_merged.snap index e5edab4670..1d8d5bf889 100644 --- a/tests/core/snapshots/test-http-with-mustache-expr.md_merged.snap +++ b/tests/core/snapshots/test-http-with-mustache-expr.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-http.md_client.snap b/tests/core/snapshots/test-http.md_client.snap index 71177707fd..07c7621583 100644 --- a/tests/core/snapshots/test-http.md_client.snap +++ b/tests/core/snapshots/test-http.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { foo: [User] diff --git a/tests/core/snapshots/test-http.md_merged.snap b/tests/core/snapshots/test-http.md_merged.snap index f8f0de135b..cd22df357e 100644 --- a/tests/core/snapshots/test-http.md_merged.snap +++ b/tests/core/snapshots/test-http.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-inline-error.md_error.snap b/tests/core/snapshots/test-inline-error.md_error.snap index 7a9527f963..16cb3ca063 100644 --- a/tests/core/snapshots/test-inline-error.md_error.snap +++ b/tests/core/snapshots/test-inline-error.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-inline-list.md_client.snap b/tests/core/snapshots/test-inline-list.md_client.snap index b1001b9d44..826d7855e9 100644 --- a/tests/core/snapshots/test-inline-list.md_client.snap +++ b/tests/core/snapshots/test-inline-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type B { c: String diff --git a/tests/core/snapshots/test-inline-list.md_merged.snap b/tests/core/snapshots/test-inline-list.md_merged.snap index 1d80e282fe..91c70844e4 100644 --- a/tests/core/snapshots/test-inline-list.md_merged.snap +++ b/tests/core/snapshots/test-inline-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-inline.md_client.snap b/tests/core/snapshots/test-inline.md_client.snap index b1001b9d44..826d7855e9 100644 --- a/tests/core/snapshots/test-inline.md_client.snap +++ b/tests/core/snapshots/test-inline.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type B { c: String diff --git a/tests/core/snapshots/test-inline.md_merged.snap b/tests/core/snapshots/test-inline.md_merged.snap index 277d53aae3..4109c5111c 100644 --- a/tests/core/snapshots/test-inline.md_merged.snap +++ b/tests/core/snapshots/test-inline.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-input-documentation.md_client.snap b/tests/core/snapshots/test-input-documentation.md_client.snap index 4c1ac2ef1d..7bb10c7e1d 100644 --- a/tests/core/snapshots/test-input-documentation.md_client.snap +++ b/tests/core/snapshots/test-input-documentation.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- """ Test input documentation diff --git a/tests/core/snapshots/test-input-documentation.md_merged.snap b/tests/core/snapshots/test-input-documentation.md_merged.snap index e43065e953..8fcbe93e49 100644 --- a/tests/core/snapshots/test-input-documentation.md_merged.snap +++ b/tests/core/snapshots/test-input-documentation.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-input-out.md_0.snap b/tests/core/snapshots/test-input-out.md_0.snap index 2ff2759825..81054dd298 100644 --- a/tests/core/snapshots/test-input-out.md_0.snap +++ b/tests/core/snapshots/test-input-out.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-input-out.md_client.snap b/tests/core/snapshots/test-input-out.md_client.snap index 0ebb9fa91a..207ce4b424 100644 --- a/tests/core/snapshots/test-input-out.md_client.snap +++ b/tests/core/snapshots/test-input-out.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input Filter { a: Int diff --git a/tests/core/snapshots/test-input-out.md_merged.snap b/tests/core/snapshots/test-input-out.md_merged.snap index 7e4b4b24ad..12b686f37a 100644 --- a/tests/core/snapshots/test-input-out.md_merged.snap +++ b/tests/core/snapshots/test-input-out.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-input-with-arg-out.md_0.snap b/tests/core/snapshots/test-input-with-arg-out.md_0.snap index 15a8438551..1054ae3c79 100644 --- a/tests/core/snapshots/test-input-with-arg-out.md_0.snap +++ b/tests/core/snapshots/test-input-with-arg-out.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-input-with-arg-out.md_client.snap b/tests/core/snapshots/test-input-with-arg-out.md_client.snap index 58bdb48805..d5e21fd05f 100644 --- a/tests/core/snapshots/test-input-with-arg-out.md_client.snap +++ b/tests/core/snapshots/test-input-with-arg-out.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input IntFilter { i: Int diff --git a/tests/core/snapshots/test-input-with-arg-out.md_merged.snap b/tests/core/snapshots/test-input-with-arg-out.md_merged.snap index c542bcf4b2..25c6801da3 100644 --- a/tests/core/snapshots/test-input-with-arg-out.md_merged.snap +++ b/tests/core/snapshots/test-input-with-arg-out.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-interface-from-json.md_client.snap b/tests/core/snapshots/test-interface-from-json.md_client.snap deleted file mode 100644 index ed99fa7b6d..0000000000 --- a/tests/core/snapshots/test-interface-from-json.md_client.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatted ---- -type B implements IA { - a: String - b: String -} - -interface IA { - a: String -} - -type Query { - bar: B -} - -schema { - query: Query -} diff --git a/tests/core/snapshots/test-interface-from-json.md_merged.snap b/tests/core/snapshots/test-interface-from-json.md_merged.snap deleted file mode 100644 index 862f3e1cf3..0000000000 --- a/tests/core/snapshots/test-interface-from-json.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server @upstream { - query: Query -} - -interface IA { - a: String -} - -type B implements IA { - a: String - b: String -} - -type Query { - bar: B @http(url: "http://jsonplaceholder.typicode.com/posts") -} diff --git a/tests/core/snapshots/test-interface-result.md_client.snap b/tests/core/snapshots/test-interface-result.md_client.snap index 6d3262740c..c82d287eed 100644 --- a/tests/core/snapshots/test-interface-result.md_client.snap +++ b/tests/core/snapshots/test-interface-result.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type B implements IA { a: String diff --git a/tests/core/snapshots/test-interface-result.md_merged.snap b/tests/core/snapshots/test-interface-result.md_merged.snap index 98bcdf6616..9596ef2ad4 100644 --- a/tests/core/snapshots/test-interface-result.md_merged.snap +++ b/tests/core/snapshots/test-interface-result.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-interface.md_client.snap b/tests/core/snapshots/test-interface.md_client.snap index ed99fa7b6d..90711e7bb4 100644 --- a/tests/core/snapshots/test-interface.md_client.snap +++ b/tests/core/snapshots/test-interface.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type B implements IA { a: String diff --git a/tests/core/snapshots/test-interface.md_merged.snap b/tests/core/snapshots/test-interface.md_merged.snap index a501bc8b26..5ffda913b3 100644 --- a/tests/core/snapshots/test-interface.md_merged.snap +++ b/tests/core/snapshots/test-interface.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-invalid-add-field.md_error.snap b/tests/core/snapshots/test-invalid-add-field.md_error.snap index 89c8031f06..79f7d431a0 100644 --- a/tests/core/snapshots/test-invalid-add-field.md_error.snap +++ b/tests/core/snapshots/test-invalid-add-field.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-invalid-query-in-http.md_error.snap b/tests/core/snapshots/test-invalid-query-in-http.md_error.snap index 7d4320c23c..6c5920d4bd 100644 --- a/tests/core/snapshots/test-invalid-query-in-http.md_error.snap +++ b/tests/core/snapshots/test-invalid-query-in-http.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-invalid-server.md_error.snap b/tests/core/snapshots/test-invalid-server.md_error.snap index 07613bc3f8..e2df00654c 100644 --- a/tests/core/snapshots/test-invalid-server.md_error.snap +++ b/tests/core/snapshots/test-invalid-server.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-js-multi-onRequest-handlers.md_0.snap b/tests/core/snapshots/test-js-multi-onRequest-handlers.md_0.snap index a2a02837c3..70f7bba26d 100644 --- a/tests/core/snapshots/test-js-multi-onRequest-handlers.md_0.snap +++ b/tests/core/snapshots/test-js-multi-onRequest-handlers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-js-multi-onRequest-handlers.md_client.snap b/tests/core/snapshots/test-js-multi-onRequest-handlers.md_client.snap index 72c16c7198..f5da839686 100644 --- a/tests/core/snapshots/test-js-multi-onRequest-handlers.md_client.snap +++ b/tests/core/snapshots/test-js-multi-onRequest-handlers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { bar: String diff --git a/tests/core/snapshots/test-js-multi-onRequest-handlers.md_merged.snap b/tests/core/snapshots/test-js-multi-onRequest-handlers.md_merged.snap index 1a8a1467d8..d517ca727e 100644 --- a/tests/core/snapshots/test-js-multi-onRequest-handlers.md_merged.snap +++ b/tests/core/snapshots/test-js-multi-onRequest-handlers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(onRequest: "foo") @link(src: "test1.js", type: Script) { query: Query diff --git a/tests/core/snapshots/test-js-multiple-scripts.md_error.snap b/tests/core/snapshots/test-js-multiple-scripts.md_error.snap index 8dd40ad345..e31620f228 100644 --- a/tests/core/snapshots/test-js-multiple-scripts.md_error.snap +++ b/tests/core/snapshots/test-js-multiple-scripts.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-js-request-response-2.md_0.snap b/tests/core/snapshots/test-js-request-response-2.md_0.snap index e06b77077f..ea36cdcf19 100644 --- a/tests/core/snapshots/test-js-request-response-2.md_0.snap +++ b/tests/core/snapshots/test-js-request-response-2.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-js-request-response-2.md_client.snap b/tests/core/snapshots/test-js-request-response-2.md_client.snap index 25a6202924..66463bf273 100644 --- a/tests/core/snapshots/test-js-request-response-2.md_client.snap +++ b/tests/core/snapshots/test-js-request-response-2.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { hello: String diff --git a/tests/core/snapshots/test-js-request-response-2.md_merged.snap b/tests/core/snapshots/test-js-request-response-2.md_merged.snap index adc0aea1a2..3dc3fa9b99 100644 --- a/tests/core/snapshots/test-js-request-response-2.md_merged.snap +++ b/tests/core/snapshots/test-js-request-response-2.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(onRequest: "onRequest") @link(src: "test.js", type: Script) { query: Query diff --git a/tests/core/snapshots/test-js-request-response.md_0.snap b/tests/core/snapshots/test-js-request-response.md_0.snap index e5cf278cca..86dae90e60 100644 --- a/tests/core/snapshots/test-js-request-response.md_0.snap +++ b/tests/core/snapshots/test-js-request-response.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-js-request-response.md_client.snap b/tests/core/snapshots/test-js-request-response.md_client.snap index 25a6202924..66463bf273 100644 --- a/tests/core/snapshots/test-js-request-response.md_client.snap +++ b/tests/core/snapshots/test-js-request-response.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { hello: String diff --git a/tests/core/snapshots/test-js-request-response.md_merged.snap b/tests/core/snapshots/test-js-request-response.md_merged.snap index adc0aea1a2..3dc3fa9b99 100644 --- a/tests/core/snapshots/test-js-request-response.md_merged.snap +++ b/tests/core/snapshots/test-js-request-response.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(onRequest: "onRequest") @link(src: "test.js", type: Script) { query: Query diff --git a/tests/core/snapshots/test-lack-resolver.md_error.snap b/tests/core/snapshots/test-lack-resolver.md_error.snap index e3e60e1cbf..b7cb19e404 100644 --- a/tests/core/snapshots/test-lack-resolver.md_error.snap +++ b/tests/core/snapshots/test-lack-resolver.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-link-support.md_client.snap b/tests/core/snapshots/test-link-support.md_client.snap index 4fae1e7ef2..a36079729b 100644 --- a/tests/core/snapshots/test-link-support.md_client.snap +++ b/tests/core/snapshots/test-link-support.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type News { id: Int diff --git a/tests/core/snapshots/test-link-support.md_merged.snap b/tests/core/snapshots/test-link-support.md_merged.snap index 77a0d25bd1..b634ff91a3 100644 --- a/tests/core/snapshots/test-link-support.md_merged.snap +++ b/tests/core/snapshots/test-link-support.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) diff --git a/tests/core/snapshots/test-list-args.md_0.snap b/tests/core/snapshots/test-list-args.md_0.snap index 1bc9bbe17b..25f5659c92 100644 --- a/tests/core/snapshots/test-list-args.md_0.snap +++ b/tests/core/snapshots/test-list-args.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-list-args.md_client.snap b/tests/core/snapshots/test-list-args.md_client.snap index a8cfceb734..efb907356d 100644 --- a/tests/core/snapshots/test-list-args.md_client.snap +++ b/tests/core/snapshots/test-list-args.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { f1(q: [Int!]!): T1 diff --git a/tests/core/snapshots/test-list-args.md_merged.snap b/tests/core/snapshots/test-list-args.md_merged.snap index fc12f058d8..251187ef8d 100644 --- a/tests/core/snapshots/test-list-args.md_merged.snap +++ b/tests/core/snapshots/test-list-args.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(queryValidation: true) @upstream { query: Query diff --git a/tests/core/snapshots/test-merge-batch.md_merged.snap b/tests/core/snapshots/test-merge-batch.md_merged.snap deleted file mode 100644 index 9fbe79d5e4..0000000000 --- a/tests/core/snapshots/test-merge-batch.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server @upstream(batch: {delay: 5, headers: ["a", "b", "c"], maxSize: 100}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/core/snapshots/test-merge-input.md_merged.snap b/tests/core/snapshots/test-merge-input.md_merged.snap index 6e4b03023c..38d084b008 100644 --- a/tests/core/snapshots/test-merge-input.md_merged.snap +++ b/tests/core/snapshots/test-merge-input.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-merge-invalid.md_error.snap b/tests/core/snapshots/test-merge-invalid.md_error.snap index e51fab4b42..d56b499085 100644 --- a/tests/core/snapshots/test-merge-invalid.md_error.snap +++ b/tests/core/snapshots/test-merge-invalid.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-merge-nested.md_merged.snap b/tests/core/snapshots/test-merge-nested.md_merged.snap index 53cfa26fe5..a280778f39 100644 --- a/tests/core/snapshots/test-merge-nested.md_merged.snap +++ b/tests/core/snapshots/test-merge-nested.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-merge-query.md_merged.snap b/tests/core/snapshots/test-merge-query.md_merged.snap deleted file mode 100644 index 6f9a054135..0000000000 --- a/tests/core/snapshots/test-merge-query.md_merged.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server(port: 8000) @upstream(proxy: {url: "http://localhost:3000"}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") - hi: String @expr(body: "world") -} diff --git a/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap b/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap index 20622b2fcc..41407d991a 100644 --- a/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap +++ b/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Foo { bar: String diff --git a/tests/core/snapshots/test-merge-right-with-link-config.md_merged.snap b/tests/core/snapshots/test-merge-right-with-link-config.md_merged.snap index a6b105f6d0..43a8b80655 100644 --- a/tests/core/snapshots/test-merge-right-with-link-config.md_merged.snap +++ b/tests/core/snapshots/test-merge-right-with-link-config.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["Authorization"]) @link(src: "stripe-types.graphql", type: Config) { query: Query diff --git a/tests/core/snapshots/test-merge-server-sdl.md_client.snap b/tests/core/snapshots/test-merge-server-sdl.md_client.snap index 71177707fd..07c7621583 100644 --- a/tests/core/snapshots/test-merge-server-sdl.md_client.snap +++ b/tests/core/snapshots/test-merge-server-sdl.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { foo: [User] diff --git a/tests/core/snapshots/test-merge-server-sdl.md_merged.snap b/tests/core/snapshots/test-merge-server-sdl.md_merged.snap index f8f0de135b..cd22df357e 100644 --- a/tests/core/snapshots/test-merge-server-sdl.md_merged.snap +++ b/tests/core/snapshots/test-merge-server-sdl.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-merge-union.md_merged.snap b/tests/core/snapshots/test-merge-union.md_merged.snap index 5e2242004a..0cbf042e85 100644 --- a/tests/core/snapshots/test-merge-union.md_merged.snap +++ b/tests/core/snapshots/test-merge-union.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-missing-argument-on-all-resolvers.md_error.snap b/tests/core/snapshots/test-missing-argument-on-all-resolvers.md_error.snap index bd0885307f..7fbc1235a2 100644 --- a/tests/core/snapshots/test-missing-argument-on-all-resolvers.md_error.snap +++ b/tests/core/snapshots/test-missing-argument-on-all-resolvers.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-missing-mutation-resolver.md_error.snap b/tests/core/snapshots/test-missing-mutation-resolver.md_error.snap index dd5c76b19e..741434bdea 100644 --- a/tests/core/snapshots/test-missing-mutation-resolver.md_error.snap +++ b/tests/core/snapshots/test-missing-mutation-resolver.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-missing-query-resolver.md_error.snap b/tests/core/snapshots/test-missing-query-resolver.md_error.snap index f1ee6ca5be..3cdb1249d7 100644 --- a/tests/core/snapshots/test-missing-query-resolver.md_error.snap +++ b/tests/core/snapshots/test-missing-query-resolver.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-missing-root-types.md_error.snap b/tests/core/snapshots/test-missing-root-types.md_error.snap index 60b7f03d34..3b3130afb2 100644 --- a/tests/core/snapshots/test-missing-root-types.md_error.snap +++ b/tests/core/snapshots/test-missing-root-types.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-missing-schema-query.md_error.snap b/tests/core/snapshots/test-missing-schema-query.md_error.snap index 1ef6c7ae5c..3a503a338a 100644 --- a/tests/core/snapshots/test-missing-schema-query.md_error.snap +++ b/tests/core/snapshots/test-missing-schema-query.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-modify.md_client.snap b/tests/core/snapshots/test-modify.md_client.snap index ef63ab86b3..459ef85407 100644 --- a/tests/core/snapshots/test-modify.md_client.snap +++ b/tests/core/snapshots/test-modify.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input Foo { bar: String diff --git a/tests/core/snapshots/test-modify.md_merged.snap b/tests/core/snapshots/test-modify.md_merged.snap index 0d1e56bd20..67ea796b33 100644 --- a/tests/core/snapshots/test-modify.md_merged.snap +++ b/tests/core/snapshots/test-modify.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-multi-interface.md_client.snap b/tests/core/snapshots/test-multi-interface.md_client.snap index 3164ef9e7e..9a2b8c8708 100644 --- a/tests/core/snapshots/test-multi-interface.md_client.snap +++ b/tests/core/snapshots/test-multi-interface.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type B implements IA & IB { a: String diff --git a/tests/core/snapshots/test-multi-interface.md_merged.snap b/tests/core/snapshots/test-multi-interface.md_merged.snap index f02eeafe4b..583c0a5edb 100644 --- a/tests/core/snapshots/test-multi-interface.md_merged.snap +++ b/tests/core/snapshots/test-multi-interface.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-multiple-config-types.md_0.snap b/tests/core/snapshots/test-multiple-config-types.md_0.snap index 1966d10828..b5887500b9 100644 --- a/tests/core/snapshots/test-multiple-config-types.md_0.snap +++ b/tests/core/snapshots/test-multiple-config-types.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-multiple-config-types.md_client.snap b/tests/core/snapshots/test-multiple-config-types.md_client.snap index b4fa7fb1e0..d91e778255 100644 --- a/tests/core/snapshots/test-multiple-config-types.md_client.snap +++ b/tests/core/snapshots/test-multiple-config-types.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input Input { id: Int diff --git a/tests/core/snapshots/test-multiple-config-types.md_merged.snap b/tests/core/snapshots/test-multiple-config-types.md_merged.snap index cec9ceca15..e05036c91a 100644 --- a/tests/core/snapshots/test-multiple-config-types.md_merged.snap +++ b/tests/core/snapshots/test-multiple-config-types.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream @link(id: "types", src: "types.graphql", type: Config) { query: Query diff --git a/tests/core/snapshots/test-nested-input.md_client.snap b/tests/core/snapshots/test-nested-input.md_client.snap index 4987f728f2..90ba2ad5af 100644 --- a/tests/core/snapshots/test-nested-input.md_client.snap +++ b/tests/core/snapshots/test-nested-input.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input A { b: B diff --git a/tests/core/snapshots/test-nested-input.md_merged.snap b/tests/core/snapshots/test-nested-input.md_merged.snap index bc99ec2f52..f1af17927d 100644 --- a/tests/core/snapshots/test-nested-input.md_merged.snap +++ b/tests/core/snapshots/test-nested-input.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-nested-value.md_client.snap b/tests/core/snapshots/test-nested-value.md_client.snap index 57bd37c184..147260b871 100644 --- a/tests/core/snapshots/test-nested-value.md_client.snap +++ b/tests/core/snapshots/test-nested-value.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int diff --git a/tests/core/snapshots/test-nested-value.md_merged.snap b/tests/core/snapshots/test-nested-value.md_merged.snap index dba926a18b..f81545e195 100644 --- a/tests/core/snapshots/test-nested-value.md_merged.snap +++ b/tests/core/snapshots/test-nested-value.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-no-base-url.md_error.snap b/tests/core/snapshots/test-no-base-url.md_error.snap index 7cd87d8050..9de0d45b83 100644 --- a/tests/core/snapshots/test-no-base-url.md_error.snap +++ b/tests/core/snapshots/test-no-base-url.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-null-in-array.md_0.snap b/tests/core/snapshots/test-null-in-array.md_0.snap index 4d68912c6b..ba0d171785 100644 --- a/tests/core/snapshots/test-null-in-array.md_0.snap +++ b/tests/core/snapshots/test-null-in-array.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-null-in-array.md_client.snap b/tests/core/snapshots/test-null-in-array.md_client.snap index 4ca0f268e9..b3915fc9d1 100644 --- a/tests/core/snapshots/test-null-in-array.md_client.snap +++ b/tests/core/snapshots/test-null-in-array.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Company { id: ID diff --git a/tests/core/snapshots/test-null-in-array.md_merged.snap b/tests/core/snapshots/test-null-in-array.md_merged.snap index e79c3bf609..09c71a8e3f 100644 --- a/tests/core/snapshots/test-null-in-array.md_merged.snap +++ b/tests/core/snapshots/test-null-in-array.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-null-in-object.md_0.snap b/tests/core/snapshots/test-null-in-object.md_0.snap index 4d68912c6b..ba0d171785 100644 --- a/tests/core/snapshots/test-null-in-object.md_0.snap +++ b/tests/core/snapshots/test-null-in-object.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-null-in-object.md_client.snap b/tests/core/snapshots/test-null-in-object.md_client.snap index beb3b12a9a..a5415245d9 100644 --- a/tests/core/snapshots/test-null-in-object.md_client.snap +++ b/tests/core/snapshots/test-null-in-object.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Company { id: ID diff --git a/tests/core/snapshots/test-null-in-object.md_merged.snap b/tests/core/snapshots/test-null-in-object.md_merged.snap index 71358c0856..fca5bf4c96 100644 --- a/tests/core/snapshots/test-null-in-object.md_merged.snap +++ b/tests/core/snapshots/test-null-in-object.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-omit-list.md_client.snap b/tests/core/snapshots/test-omit-list.md_client.snap index b1001b9d44..826d7855e9 100644 --- a/tests/core/snapshots/test-omit-list.md_client.snap +++ b/tests/core/snapshots/test-omit-list.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type B { c: String diff --git a/tests/core/snapshots/test-omit-list.md_merged.snap b/tests/core/snapshots/test-omit-list.md_merged.snap index 45b11d9668..1064d17850 100644 --- a/tests/core/snapshots/test-omit-list.md_merged.snap +++ b/tests/core/snapshots/test-omit-list.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-omit.md_client.snap b/tests/core/snapshots/test-omit.md_client.snap index b1001b9d44..826d7855e9 100644 --- a/tests/core/snapshots/test-omit.md_client.snap +++ b/tests/core/snapshots/test-omit.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type B { c: String diff --git a/tests/core/snapshots/test-omit.md_merged.snap b/tests/core/snapshots/test-omit.md_merged.snap index 3d585c67a6..f6a93ab9fc 100644 --- a/tests/core/snapshots/test-omit.md_merged.snap +++ b/tests/core/snapshots/test-omit.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/https.md_0.snap b/tests/core/snapshots/test-on-response-body.md_0.snap similarity index 67% rename from tests/core/snapshots/https.md_0.snap rename to tests/core/snapshots/test-on-response-body.md_0.snap index a085a7c561..bb2c739c1d 100644 --- a/tests/core/snapshots/https.md_0.snap +++ b/tests/core/snapshots/test-on-response-body.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, @@ -9,8 +10,8 @@ expression: response }, "body": { "data": { - "firstUser": { - "name": "Leanne Graham" + "hello": { + "name": "Leanne Graham - Changed by JS" } } } diff --git a/tests/core/snapshots/https.md_client.snap b/tests/core/snapshots/test-on-response-body.md_client.snap similarity index 64% rename from tests/core/snapshots/https.md_client.snap rename to tests/core/snapshots/test-on-response-body.md_client.snap index 2215e476ec..c604bcc5ab 100644 --- a/tests/core/snapshots/https.md_client.snap +++ b/tests/core/snapshots/test-on-response-body.md_client.snap @@ -1,14 +1,15 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { - firstUser: User + hello: User! } type User { - id: Int - name: String + id: Int! + name: String! } schema { diff --git a/tests/core/snapshots/test-on-response-body.md_merged.snap b/tests/core/snapshots/test-on-response-body.md_merged.snap new file mode 100644 index 0000000000..8e6a03e6db --- /dev/null +++ b/tests/core/snapshots/test-on-response-body.md_merged.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: formatter +snapshot_kind: text +--- +schema @server @upstream @link(src: "test.js", type: Script) { + query: Query +} + +type Query { + hello: User! @http(url: "https://jsonplaceholder.typicode.com/users/1", onResponseBody: "onResponse") +} + +type User { + id: Int! + name: String! +} diff --git a/tests/core/snapshots/test-optional-key-skip-empty.md_0.snap b/tests/core/snapshots/test-optional-key-skip-empty.md_0.snap index fd8b8ab5a3..434222e7d2 100644 --- a/tests/core/snapshots/test-optional-key-skip-empty.md_0.snap +++ b/tests/core/snapshots/test-optional-key-skip-empty.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-optional-key-skip-empty.md_client.snap b/tests/core/snapshots/test-optional-key-skip-empty.md_client.snap index b6e374918e..e727f179cf 100644 --- a/tests/core/snapshots/test-optional-key-skip-empty.md_client.snap +++ b/tests/core/snapshots/test-optional-key-skip-empty.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { id: Int diff --git a/tests/core/snapshots/test-optional-key-skip-empty.md_merged.snap b/tests/core/snapshots/test-optional-key-skip-empty.md_merged.snap index 33fe93e046..8cef87639a 100644 --- a/tests/core/snapshots/test-optional-key-skip-empty.md_merged.snap +++ b/tests/core/snapshots/test-optional-key-skip-empty.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-params-as-body.md_0.snap b/tests/core/snapshots/test-params-as-body.md_0.snap index 79e85dfc9a..ad3d30f02e 100644 --- a/tests/core/snapshots/test-params-as-body.md_0.snap +++ b/tests/core/snapshots/test-params-as-body.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-params-as-body.md_client.snap b/tests/core/snapshots/test-params-as-body.md_client.snap index 28e6b0d379..c35936ada4 100644 --- a/tests/core/snapshots/test-params-as-body.md_client.snap +++ b/tests/core/snapshots/test-params-as-body.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { firstUser(id: Int, name: String): User diff --git a/tests/core/snapshots/test-params-as-body.md_merged.snap b/tests/core/snapshots/test-params-as-body.md_merged.snap index 3dbe617929..72da37e0d5 100644 --- a/tests/core/snapshots/test-params-as-body.md_merged.snap +++ b/tests/core/snapshots/test-params-as-body.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-query-documentation.md_client.snap b/tests/core/snapshots/test-query-documentation.md_client.snap index 3de62904ae..f2ecbe533f 100644 --- a/tests/core/snapshots/test-query-documentation.md_client.snap +++ b/tests/core/snapshots/test-query-documentation.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { """ diff --git a/tests/core/snapshots/test-query-documentation.md_merged.snap b/tests/core/snapshots/test-query-documentation.md_merged.snap index fcbdb7fae6..3ff8b266ed 100644 --- a/tests/core/snapshots/test-query-documentation.md_merged.snap +++ b/tests/core/snapshots/test-query-documentation.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-query.md_client.snap b/tests/core/snapshots/test-query.md_client.snap index 893ac9057a..83535d83b5 100644 --- a/tests/core/snapshots/test-query.md_client.snap +++ b/tests/core/snapshots/test-query.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { foo: String diff --git a/tests/core/snapshots/test-query.md_merged.snap b/tests/core/snapshots/test-query.md_merged.snap index 93e8e8a71a..964f29c16d 100644 --- a/tests/core/snapshots/test-query.md_merged.snap +++ b/tests/core/snapshots/test-query.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-ref-other.md_client.snap b/tests/core/snapshots/test-ref-other.md_client.snap index 13bd3067b7..209fd5f468 100644 --- a/tests/core/snapshots/test-ref-other.md_client.snap +++ b/tests/core/snapshots/test-ref-other.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type InPost { get: [Post] diff --git a/tests/core/snapshots/test-ref-other.md_merged.snap b/tests/core/snapshots/test-ref-other.md_merged.snap index 48e7f7cc1d..b68ace1656 100644 --- a/tests/core/snapshots/test-ref-other.md_merged.snap +++ b/tests/core/snapshots/test-ref-other.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-required-fields.md_0.snap b/tests/core/snapshots/test-required-fields.md_0.snap index c526e94e7a..66f46413fc 100644 --- a/tests/core/snapshots/test-required-fields.md_0.snap +++ b/tests/core/snapshots/test-required-fields.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_1.snap b/tests/core/snapshots/test-required-fields.md_1.snap index 93309c9793..5c382678e4 100644 --- a/tests/core/snapshots/test-required-fields.md_1.snap +++ b/tests/core/snapshots/test-required-fields.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_10.snap b/tests/core/snapshots/test-required-fields.md_10.snap index 1621f25fbc..7bf48c41d7 100644 --- a/tests/core/snapshots/test-required-fields.md_10.snap +++ b/tests/core/snapshots/test-required-fields.md_10.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_11.snap b/tests/core/snapshots/test-required-fields.md_11.snap index 7cb54826dc..07c1522b94 100644 --- a/tests/core/snapshots/test-required-fields.md_11.snap +++ b/tests/core/snapshots/test-required-fields.md_11.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_12.snap b/tests/core/snapshots/test-required-fields.md_12.snap index b5d4689146..5277a57a05 100644 --- a/tests/core/snapshots/test-required-fields.md_12.snap +++ b/tests/core/snapshots/test-required-fields.md_12.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_13.snap b/tests/core/snapshots/test-required-fields.md_13.snap index 5a2e8949c7..70f6d7932e 100644 --- a/tests/core/snapshots/test-required-fields.md_13.snap +++ b/tests/core/snapshots/test-required-fields.md_13.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_14.snap b/tests/core/snapshots/test-required-fields.md_14.snap index c5e590a3a4..82929e42af 100644 --- a/tests/core/snapshots/test-required-fields.md_14.snap +++ b/tests/core/snapshots/test-required-fields.md_14.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_15.snap b/tests/core/snapshots/test-required-fields.md_15.snap index e96d3c87a0..6299179dff 100644 --- a/tests/core/snapshots/test-required-fields.md_15.snap +++ b/tests/core/snapshots/test-required-fields.md_15.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_16.snap b/tests/core/snapshots/test-required-fields.md_16.snap index f04b340dcd..50a8fe5e9e 100644 --- a/tests/core/snapshots/test-required-fields.md_16.snap +++ b/tests/core/snapshots/test-required-fields.md_16.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_17.snap b/tests/core/snapshots/test-required-fields.md_17.snap index cabdc83aea..55402b20cd 100644 --- a/tests/core/snapshots/test-required-fields.md_17.snap +++ b/tests/core/snapshots/test-required-fields.md_17.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_18.snap b/tests/core/snapshots/test-required-fields.md_18.snap index f3832a962b..97be6ba2f7 100644 --- a/tests/core/snapshots/test-required-fields.md_18.snap +++ b/tests/core/snapshots/test-required-fields.md_18.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_19.snap b/tests/core/snapshots/test-required-fields.md_19.snap index 52b8480df5..7776228c50 100644 --- a/tests/core/snapshots/test-required-fields.md_19.snap +++ b/tests/core/snapshots/test-required-fields.md_19.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_2.snap b/tests/core/snapshots/test-required-fields.md_2.snap index 7f404ec366..2e5bd877f2 100644 --- a/tests/core/snapshots/test-required-fields.md_2.snap +++ b/tests/core/snapshots/test-required-fields.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_20.snap b/tests/core/snapshots/test-required-fields.md_20.snap index 8ec7714e13..d1560ac02d 100644 --- a/tests/core/snapshots/test-required-fields.md_20.snap +++ b/tests/core/snapshots/test-required-fields.md_20.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_21.snap b/tests/core/snapshots/test-required-fields.md_21.snap index 0a7dffb745..c4f767a268 100644 --- a/tests/core/snapshots/test-required-fields.md_21.snap +++ b/tests/core/snapshots/test-required-fields.md_21.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_3.snap b/tests/core/snapshots/test-required-fields.md_3.snap index 635314f4a5..0dde3714c7 100644 --- a/tests/core/snapshots/test-required-fields.md_3.snap +++ b/tests/core/snapshots/test-required-fields.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_4.snap b/tests/core/snapshots/test-required-fields.md_4.snap index 39634a5fb0..aa4bbd0c4a 100644 --- a/tests/core/snapshots/test-required-fields.md_4.snap +++ b/tests/core/snapshots/test-required-fields.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_5.snap b/tests/core/snapshots/test-required-fields.md_5.snap index 9ecc8ec71f..1a7f69912b 100644 --- a/tests/core/snapshots/test-required-fields.md_5.snap +++ b/tests/core/snapshots/test-required-fields.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_6.snap b/tests/core/snapshots/test-required-fields.md_6.snap index 2355e1e2bb..3ee0fb8fc0 100644 --- a/tests/core/snapshots/test-required-fields.md_6.snap +++ b/tests/core/snapshots/test-required-fields.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_7.snap b/tests/core/snapshots/test-required-fields.md_7.snap index 79647f46ac..12de839d46 100644 --- a/tests/core/snapshots/test-required-fields.md_7.snap +++ b/tests/core/snapshots/test-required-fields.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_8.snap b/tests/core/snapshots/test-required-fields.md_8.snap index d0b7ef5c84..98716d3c5a 100644 --- a/tests/core/snapshots/test-required-fields.md_8.snap +++ b/tests/core/snapshots/test-required-fields.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_9.snap b/tests/core/snapshots/test-required-fields.md_9.snap index 046718d6d8..0074311326 100644 --- a/tests/core/snapshots/test-required-fields.md_9.snap +++ b/tests/core/snapshots/test-required-fields.md_9.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-required-fields.md_client.snap b/tests/core/snapshots/test-required-fields.md_client.snap index da516ad64a..f4c7890a3c 100644 --- a/tests/core/snapshots/test-required-fields.md_client.snap +++ b/tests/core/snapshots/test-required-fields.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Foo { bar: String! diff --git a/tests/core/snapshots/test-required-fields.md_merged.snap b/tests/core/snapshots/test-required-fields.md_merged.snap index 8bbe4199e1..32c7a45a63 100644 --- a/tests/core/snapshots/test-required-fields.md_merged.snap +++ b/tests/core/snapshots/test-required-fields.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(enableJIT: true) @upstream { query: Query diff --git a/tests/core/snapshots/test-response-header-merge.md_merged.snap b/tests/core/snapshots/test-response-header-merge.md_merged.snap deleted file mode 100644 index 11630662de..0000000000 --- a/tests/core/snapshots/test-response-header-merge.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server(headers: {custom: [{key: "a", value: "a"}, {key: "a", value: "b"}]}) @upstream { - query: Query -} - -type Query { - user: User @expr(body: {name: "John"}) -} - -type User { - age: Int - name: String -} diff --git a/tests/core/snapshots/test-response-header-value.md_error.snap b/tests/core/snapshots/test-response-header-value.md_error.snap index d319669132..c5275556d7 100644 --- a/tests/core/snapshots/test-response-header-value.md_error.snap +++ b/tests/core/snapshots/test-response-header-value.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-response-headers-multi.md_error.snap b/tests/core/snapshots/test-response-headers-multi.md_error.snap index e7de957c9f..1b3b2c86d8 100644 --- a/tests/core/snapshots/test-response-headers-multi.md_error.snap +++ b/tests/core/snapshots/test-response-headers-multi.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-response-headers-name.md_error.snap b/tests/core/snapshots/test-response-headers-name.md_error.snap index a611958fd3..6bdfd0e23c 100644 --- a/tests/core/snapshots/test-response-headers-name.md_error.snap +++ b/tests/core/snapshots/test-response-headers-name.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-scalars-builtin.md_0.snap b/tests/core/snapshots/test-scalars-builtin.md_0.snap index 62bb903e82..1658c38be8 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_0.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_1.snap b/tests/core/snapshots/test-scalars-builtin.md_1.snap index b514a1c322..11401376dc 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_1.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_2.snap b/tests/core/snapshots/test-scalars-builtin.md_2.snap index 4a94435126..a15ede8ca6 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_2.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_3.snap b/tests/core/snapshots/test-scalars-builtin.md_3.snap index 58ded18820..50bae97d95 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_3.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_4.snap b/tests/core/snapshots/test-scalars-builtin.md_4.snap index b42dfec930..b0b345d96f 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_4.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_5.snap b/tests/core/snapshots/test-scalars-builtin.md_5.snap index f118c465e4..fbba4c9e6e 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_5.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_6.snap b/tests/core/snapshots/test-scalars-builtin.md_6.snap index 75d3e68ca6..cde138dd2f 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_6.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_7.snap b/tests/core/snapshots/test-scalars-builtin.md_7.snap index 5dcfe0cd33..d6228e88e9 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_7.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_8.snap b/tests/core/snapshots/test-scalars-builtin.md_8.snap index ca92d7d6a2..a0b8bbd508 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_8.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_9.snap b/tests/core/snapshots/test-scalars-builtin.md_9.snap index 060ab67009..4a205aec18 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_9.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_9.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-builtin.md_client.snap b/tests/core/snapshots/test-scalars-builtin.md_client.snap index 89aecbaf7d..dfd0868801 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_client.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { bool(x: Boolean!): Boolean! diff --git a/tests/core/snapshots/test-scalars-builtin.md_merged.snap b/tests/core/snapshots/test-scalars-builtin.md_merged.snap index f6158dcce3..f279807bdd 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_merged.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "localhost", port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-scalars-integers.md_0.snap b/tests/core/snapshots/test-scalars-integers.md_0.snap index 2a25ec8e33..1d6f999e83 100644 --- a/tests/core/snapshots/test-scalars-integers.md_0.snap +++ b/tests/core/snapshots/test-scalars-integers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_1.snap b/tests/core/snapshots/test-scalars-integers.md_1.snap index 6def729548..76ca444a0e 100644 --- a/tests/core/snapshots/test-scalars-integers.md_1.snap +++ b/tests/core/snapshots/test-scalars-integers.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_10.snap b/tests/core/snapshots/test-scalars-integers.md_10.snap index 182fa51189..81338cb469 100644 --- a/tests/core/snapshots/test-scalars-integers.md_10.snap +++ b/tests/core/snapshots/test-scalars-integers.md_10.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_11.snap b/tests/core/snapshots/test-scalars-integers.md_11.snap index 43cb390a6f..5dbf29fd5f 100644 --- a/tests/core/snapshots/test-scalars-integers.md_11.snap +++ b/tests/core/snapshots/test-scalars-integers.md_11.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_12.snap b/tests/core/snapshots/test-scalars-integers.md_12.snap index c17790102d..2d890fc7b7 100644 --- a/tests/core/snapshots/test-scalars-integers.md_12.snap +++ b/tests/core/snapshots/test-scalars-integers.md_12.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_13.snap b/tests/core/snapshots/test-scalars-integers.md_13.snap index 5ec8943cfd..57d30d3336 100644 --- a/tests/core/snapshots/test-scalars-integers.md_13.snap +++ b/tests/core/snapshots/test-scalars-integers.md_13.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_14.snap b/tests/core/snapshots/test-scalars-integers.md_14.snap index 4cb6dda6c3..7c0699f375 100644 --- a/tests/core/snapshots/test-scalars-integers.md_14.snap +++ b/tests/core/snapshots/test-scalars-integers.md_14.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_15.snap b/tests/core/snapshots/test-scalars-integers.md_15.snap index 3fcc674209..fbfe1907a9 100644 --- a/tests/core/snapshots/test-scalars-integers.md_15.snap +++ b/tests/core/snapshots/test-scalars-integers.md_15.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_16.snap b/tests/core/snapshots/test-scalars-integers.md_16.snap index eff516b2e0..e61443ed9e 100644 --- a/tests/core/snapshots/test-scalars-integers.md_16.snap +++ b/tests/core/snapshots/test-scalars-integers.md_16.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_17.snap b/tests/core/snapshots/test-scalars-integers.md_17.snap index 9f1436b96b..f4fba8d411 100644 --- a/tests/core/snapshots/test-scalars-integers.md_17.snap +++ b/tests/core/snapshots/test-scalars-integers.md_17.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_18.snap b/tests/core/snapshots/test-scalars-integers.md_18.snap index d8d6497ac2..ce2e27d1e2 100644 --- a/tests/core/snapshots/test-scalars-integers.md_18.snap +++ b/tests/core/snapshots/test-scalars-integers.md_18.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_19.snap b/tests/core/snapshots/test-scalars-integers.md_19.snap index 4f8df4c842..84dc4e57ed 100644 --- a/tests/core/snapshots/test-scalars-integers.md_19.snap +++ b/tests/core/snapshots/test-scalars-integers.md_19.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_2.snap b/tests/core/snapshots/test-scalars-integers.md_2.snap index 555aa36411..d22c1dc60c 100644 --- a/tests/core/snapshots/test-scalars-integers.md_2.snap +++ b/tests/core/snapshots/test-scalars-integers.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_3.snap b/tests/core/snapshots/test-scalars-integers.md_3.snap index 5ec8943cfd..57d30d3336 100644 --- a/tests/core/snapshots/test-scalars-integers.md_3.snap +++ b/tests/core/snapshots/test-scalars-integers.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_4.snap b/tests/core/snapshots/test-scalars-integers.md_4.snap index 4cb6dda6c3..7c0699f375 100644 --- a/tests/core/snapshots/test-scalars-integers.md_4.snap +++ b/tests/core/snapshots/test-scalars-integers.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_5.snap b/tests/core/snapshots/test-scalars-integers.md_5.snap index 14eea1b242..3867575fb2 100644 --- a/tests/core/snapshots/test-scalars-integers.md_5.snap +++ b/tests/core/snapshots/test-scalars-integers.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_6.snap b/tests/core/snapshots/test-scalars-integers.md_6.snap index 97668132c8..278d433d8a 100644 --- a/tests/core/snapshots/test-scalars-integers.md_6.snap +++ b/tests/core/snapshots/test-scalars-integers.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_7.snap b/tests/core/snapshots/test-scalars-integers.md_7.snap index 6b11162cea..caeda97cea 100644 --- a/tests/core/snapshots/test-scalars-integers.md_7.snap +++ b/tests/core/snapshots/test-scalars-integers.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_8.snap b/tests/core/snapshots/test-scalars-integers.md_8.snap index d8d6497ac2..ce2e27d1e2 100644 --- a/tests/core/snapshots/test-scalars-integers.md_8.snap +++ b/tests/core/snapshots/test-scalars-integers.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_9.snap b/tests/core/snapshots/test-scalars-integers.md_9.snap index 4cb6dda6c3..7c0699f375 100644 --- a/tests/core/snapshots/test-scalars-integers.md_9.snap +++ b/tests/core/snapshots/test-scalars-integers.md_9.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-integers.md_client.snap b/tests/core/snapshots/test-scalars-integers.md_client.snap index fa0535a2d2..a3ebf9ad2b 100644 --- a/tests/core/snapshots/test-scalars-integers.md_client.snap +++ b/tests/core/snapshots/test-scalars-integers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Int128 diff --git a/tests/core/snapshots/test-scalars-integers.md_merged.snap b/tests/core/snapshots/test-scalars-integers.md_merged.snap index fbaa2637f8..76f051652f 100644 --- a/tests/core/snapshots/test-scalars-integers.md_merged.snap +++ b/tests/core/snapshots/test-scalars-integers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "localhost", port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-scalars-validation.md_0.snap b/tests/core/snapshots/test-scalars-validation.md_0.snap index beb99f57f6..d38b516c96 100644 --- a/tests/core/snapshots/test-scalars-validation.md_0.snap +++ b/tests/core/snapshots/test-scalars-validation.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-validation.md_1.snap b/tests/core/snapshots/test-scalars-validation.md_1.snap index 46968e50a8..e7e2a6cfac 100644 --- a/tests/core/snapshots/test-scalars-validation.md_1.snap +++ b/tests/core/snapshots/test-scalars-validation.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars-validation.md_client.snap b/tests/core/snapshots/test-scalars-validation.md_client.snap index 61d4a75ca6..6393b85ced 100644 --- a/tests/core/snapshots/test-scalars-validation.md_client.snap +++ b/tests/core/snapshots/test-scalars-validation.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar Email diff --git a/tests/core/snapshots/test-scalars-validation.md_merged.snap b/tests/core/snapshots/test-scalars-validation.md_merged.snap index 9705a3c67b..e03035e098 100644 --- a/tests/core/snapshots/test-scalars-validation.md_merged.snap +++ b/tests/core/snapshots/test-scalars-validation.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "localhost", port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-scalars.md_0.snap b/tests/core/snapshots/test-scalars.md_0.snap index 3eab7453aa..4f57095d00 100644 --- a/tests/core/snapshots/test-scalars.md_0.snap +++ b/tests/core/snapshots/test-scalars.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_1.snap b/tests/core/snapshots/test-scalars.md_1.snap index 500fc09ad1..df4bf26985 100644 --- a/tests/core/snapshots/test-scalars.md_1.snap +++ b/tests/core/snapshots/test-scalars.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_10.snap b/tests/core/snapshots/test-scalars.md_10.snap index 4ab684e59e..25c87102c3 100644 --- a/tests/core/snapshots/test-scalars.md_10.snap +++ b/tests/core/snapshots/test-scalars.md_10.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_11.snap b/tests/core/snapshots/test-scalars.md_11.snap index 22b5ad0dd1..842a7dec7c 100644 --- a/tests/core/snapshots/test-scalars.md_11.snap +++ b/tests/core/snapshots/test-scalars.md_11.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_2.snap b/tests/core/snapshots/test-scalars.md_2.snap index 4f94abe2af..bc4476ab14 100644 --- a/tests/core/snapshots/test-scalars.md_2.snap +++ b/tests/core/snapshots/test-scalars.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_3.snap b/tests/core/snapshots/test-scalars.md_3.snap index e40c6e03cc..08646cea17 100644 --- a/tests/core/snapshots/test-scalars.md_3.snap +++ b/tests/core/snapshots/test-scalars.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_4.snap b/tests/core/snapshots/test-scalars.md_4.snap index 307ade083b..6130c2b004 100644 --- a/tests/core/snapshots/test-scalars.md_4.snap +++ b/tests/core/snapshots/test-scalars.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_5.snap b/tests/core/snapshots/test-scalars.md_5.snap index c8930b71ec..7ec99229ad 100644 --- a/tests/core/snapshots/test-scalars.md_5.snap +++ b/tests/core/snapshots/test-scalars.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_6.snap b/tests/core/snapshots/test-scalars.md_6.snap index f05fab41e1..32d3b73adb 100644 --- a/tests/core/snapshots/test-scalars.md_6.snap +++ b/tests/core/snapshots/test-scalars.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_7.snap b/tests/core/snapshots/test-scalars.md_7.snap index 8b0ea58a37..9a35ae7c6c 100644 --- a/tests/core/snapshots/test-scalars.md_7.snap +++ b/tests/core/snapshots/test-scalars.md_7.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_8.snap b/tests/core/snapshots/test-scalars.md_8.snap index 8b0ea58a37..9a35ae7c6c 100644 --- a/tests/core/snapshots/test-scalars.md_8.snap +++ b/tests/core/snapshots/test-scalars.md_8.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_9.snap b/tests/core/snapshots/test-scalars.md_9.snap index 31a1a3502f..7b20a78331 100644 --- a/tests/core/snapshots/test-scalars.md_9.snap +++ b/tests/core/snapshots/test-scalars.md_9.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-scalars.md_client.snap b/tests/core/snapshots/test-scalars.md_client.snap index 5df81ae1f3..fedae7aed9 100644 --- a/tests/core/snapshots/test-scalars.md_client.snap +++ b/tests/core/snapshots/test-scalars.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- scalar AnyScalar diff --git a/tests/core/snapshots/test-scalars.md_merged.snap b/tests/core/snapshots/test-scalars.md_merged.snap index d9a41eb6d3..5059882fea 100644 --- a/tests/core/snapshots/test-scalars.md_merged.snap +++ b/tests/core/snapshots/test-scalars.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(hostname: "localhost", port: 8000) @upstream { query: Query diff --git a/tests/core/snapshots/test-server-base-types.md_merged.snap b/tests/core/snapshots/test-server-base-types.md_merged.snap deleted file mode 100644 index 28376478fc..0000000000 --- a/tests/core/snapshots/test-server-base-types.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server(port: 8000) @upstream(proxy: {url: "http://localhost:3000"}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/core/snapshots/test-server-vars.md_client.snap b/tests/core/snapshots/test-server-vars.md_client.snap index 893ac9057a..83535d83b5 100644 --- a/tests/core/snapshots/test-server-vars.md_client.snap +++ b/tests/core/snapshots/test-server-vars.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { foo: String diff --git a/tests/core/snapshots/test-server-vars.md_merged.snap b/tests/core/snapshots/test-server-vars.md_merged.snap index c321e56517..9e747b7c71 100644 --- a/tests/core/snapshots/test-server-vars.md_merged.snap +++ b/tests/core/snapshots/test-server-vars.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(vars: [{key: "foo", value: "bar"}]) @upstream { query: Query diff --git a/tests/core/snapshots/test-set-cookie-headers.md_0.snap b/tests/core/snapshots/test-set-cookie-headers.md_0.snap index 3353c44cf4..f1a5e1581c 100644 --- a/tests/core/snapshots/test-set-cookie-headers.md_0.snap +++ b/tests/core/snapshots/test-set-cookie-headers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-set-cookie-headers.md_client.snap b/tests/core/snapshots/test-set-cookie-headers.md_client.snap index dc89262eb4..ac0a7f491c 100644 --- a/tests/core/snapshots/test-set-cookie-headers.md_client.snap +++ b/tests/core/snapshots/test-set-cookie-headers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/test-set-cookie-headers.md_merged.snap b/tests/core/snapshots/test-set-cookie-headers.md_merged.snap index 963ab3bb14..4fc810e0d0 100644 --- a/tests/core/snapshots/test-set-cookie-headers.md_merged.snap +++ b/tests/core/snapshots/test-set-cookie-headers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(headers: {setCookies: true}, hostname: "0.0.0.0", port: 8080) @upstream { query: Query diff --git a/tests/core/snapshots/test-static-value.md_merged.snap b/tests/core/snapshots/test-static-value.md_merged.snap deleted file mode 100644 index 8868c6973d..0000000000 --- a/tests/core/snapshots/test-static-value.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/core/spec.rs -expression: formatter ---- -schema @server @upstream { - query: Query -} - -type Query { - firstUser: User @http(url: "http://jsonplaceholder.typicode.com/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/core/snapshots/test-undefined-query.md_error.snap b/tests/core/snapshots/test-undefined-query.md_error.snap index bb7fe8faa3..69cef16c0f 100644 --- a/tests/core/snapshots/test-undefined-query.md_error.snap +++ b/tests/core/snapshots/test-undefined-query.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/test-union-ambiguous.md_0.snap b/tests/core/snapshots/test-union-ambiguous.md_0.snap index 2f186f034f..710beddaca 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_0.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-ambiguous.md_1.snap b/tests/core/snapshots/test-union-ambiguous.md_1.snap index d26243da59..f5825ffb6b 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_1.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-ambiguous.md_2.snap b/tests/core/snapshots/test-union-ambiguous.md_2.snap index 96120f5e5f..41ca716873 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_2.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-ambiguous.md_3.snap b/tests/core/snapshots/test-union-ambiguous.md_3.snap index 7f53a81beb..be70b71b95 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_3.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-ambiguous.md_4.snap b/tests/core/snapshots/test-union-ambiguous.md_4.snap index bf451fd1dc..db9007ce09 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_4.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-ambiguous.md_5.snap b/tests/core/snapshots/test-union-ambiguous.md_5.snap index 1adef3514b..98aa4f61a2 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_5.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-ambiguous.md_6.snap b/tests/core/snapshots/test-union-ambiguous.md_6.snap index ae8c321583..b2efb013e7 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_6.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_6.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-ambiguous.md_client.snap b/tests/core/snapshots/test-union-ambiguous.md_client.snap index 1ec9ab05a5..827ce1ac1a 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_client.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { bar: String diff --git a/tests/core/snapshots/test-union-ambiguous.md_merged.snap b/tests/core/snapshots/test-union-ambiguous.md_merged.snap index 0aeaeec408..585c8182bc 100644 --- a/tests/core/snapshots/test-union-ambiguous.md_merged.snap +++ b/tests/core/snapshots/test-union-ambiguous.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-union-fieldtype.md_0.snap b/tests/core/snapshots/test-union-fieldtype.md_0.snap index 2f186f034f..710beddaca 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_0.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-fieldtype.md_1.snap b/tests/core/snapshots/test-union-fieldtype.md_1.snap index d26243da59..f5825ffb6b 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_1.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-fieldtype.md_2.snap b/tests/core/snapshots/test-union-fieldtype.md_2.snap index 96120f5e5f..41ca716873 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_2.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-fieldtype.md_3.snap b/tests/core/snapshots/test-union-fieldtype.md_3.snap index 7f53a81beb..be70b71b95 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_3.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-fieldtype.md_4.snap b/tests/core/snapshots/test-union-fieldtype.md_4.snap index 138061d6dd..a131323177 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_4.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-fieldtype.md_5.snap b/tests/core/snapshots/test-union-fieldtype.md_5.snap index 442efd36fc..bd2b798622 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_5.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-fieldtype.md_client.snap b/tests/core/snapshots/test-union-fieldtype.md_client.snap index 894a0c5eee..086bd9d6fb 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_client.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { bar: String! diff --git a/tests/core/snapshots/test-union-fieldtype.md_merged.snap b/tests/core/snapshots/test-union-fieldtype.md_merged.snap index b1a3657093..13628d0617 100644 --- a/tests/core/snapshots/test-union-fieldtype.md_merged.snap +++ b/tests/core/snapshots/test-union-fieldtype.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-union-optional.md_0.snap b/tests/core/snapshots/test-union-optional.md_0.snap index 2e683d4faf..e9bba47086 100644 --- a/tests/core/snapshots/test-union-optional.md_0.snap +++ b/tests/core/snapshots/test-union-optional.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-optional.md_1.snap b/tests/core/snapshots/test-union-optional.md_1.snap index 691cf26ad3..fc3126df12 100644 --- a/tests/core/snapshots/test-union-optional.md_1.snap +++ b/tests/core/snapshots/test-union-optional.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union-optional.md_client.snap b/tests/core/snapshots/test-union-optional.md_client.snap index f6f6d021a8..665dd49c84 100644 --- a/tests/core/snapshots/test-union-optional.md_client.snap +++ b/tests/core/snapshots/test-union-optional.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- union Node = Page | User diff --git a/tests/core/snapshots/test-union-optional.md_merged.snap b/tests/core/snapshots/test-union-optional.md_merged.snap index 534140806b..308b79562d 100644 --- a/tests/core/snapshots/test-union-optional.md_merged.snap +++ b/tests/core/snapshots/test-union-optional.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-union.md_0.snap b/tests/core/snapshots/test-union.md_0.snap index 2f186f034f..710beddaca 100644 --- a/tests/core/snapshots/test-union.md_0.snap +++ b/tests/core/snapshots/test-union.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union.md_1.snap b/tests/core/snapshots/test-union.md_1.snap index d26243da59..f5825ffb6b 100644 --- a/tests/core/snapshots/test-union.md_1.snap +++ b/tests/core/snapshots/test-union.md_1.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union.md_2.snap b/tests/core/snapshots/test-union.md_2.snap index 96120f5e5f..41ca716873 100644 --- a/tests/core/snapshots/test-union.md_2.snap +++ b/tests/core/snapshots/test-union.md_2.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union.md_3.snap b/tests/core/snapshots/test-union.md_3.snap index 7f53a81beb..be70b71b95 100644 --- a/tests/core/snapshots/test-union.md_3.snap +++ b/tests/core/snapshots/test-union.md_3.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union.md_4.snap b/tests/core/snapshots/test-union.md_4.snap index dea0eb5c4c..655cbbd941 100644 --- a/tests/core/snapshots/test-union.md_4.snap +++ b/tests/core/snapshots/test-union.md_4.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union.md_5.snap b/tests/core/snapshots/test-union.md_5.snap index 442efd36fc..bd2b798622 100644 --- a/tests/core/snapshots/test-union.md_5.snap +++ b/tests/core/snapshots/test-union.md_5.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-union.md_client.snap b/tests/core/snapshots/test-union.md_client.snap index 894a0c5eee..086bd9d6fb 100644 --- a/tests/core/snapshots/test-union.md_client.snap +++ b/tests/core/snapshots/test-union.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Bar { bar: String! diff --git a/tests/core/snapshots/test-union.md_merged.snap b/tests/core/snapshots/test-union.md_merged.snap index b1a3657093..13628d0617 100644 --- a/tests/core/snapshots/test-union.md_merged.snap +++ b/tests/core/snapshots/test-union.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/test-upstream-headers.md_0.snap b/tests/core/snapshots/test-upstream-headers.md_0.snap index db824d6b4b..6895d518ad 100644 --- a/tests/core/snapshots/test-upstream-headers.md_0.snap +++ b/tests/core/snapshots/test-upstream-headers.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/test-upstream-headers.md_client.snap b/tests/core/snapshots/test-upstream-headers.md_client.snap index cd159a474a..f66fd5e3ba 100644 --- a/tests/core/snapshots/test-upstream-headers.md_client.snap +++ b/tests/core/snapshots/test-upstream-headers.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { id: Int diff --git a/tests/core/snapshots/test-upstream-headers.md_merged.snap b/tests/core/snapshots/test-upstream-headers.md_merged.snap index 5f295cf41b..9e2217c6c9 100644 --- a/tests/core/snapshots/test-upstream-headers.md_merged.snap +++ b/tests/core/snapshots/test-upstream-headers.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(allowedHeaders: ["X-bar", "x-foo"]) { query: Query diff --git a/tests/core/snapshots/test-upstream.md_client.snap b/tests/core/snapshots/test-upstream.md_client.snap index cf7d4e49b2..cf3e72143e 100644 --- a/tests/core/snapshots/test-upstream.md_client.snap +++ b/tests/core/snapshots/test-upstream.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { hello: String diff --git a/tests/core/snapshots/test-upstream.md_merged.snap b/tests/core/snapshots/test-upstream.md_merged.snap index 7ff7dd576d..608b9a2957 100644 --- a/tests/core/snapshots/test-upstream.md_merged.snap +++ b/tests/core/snapshots/test-upstream.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(proxy: {url: "http://localhost:8085"}) { query: Query diff --git a/tests/core/snapshots/undeclared-type-no-base-url.md_error.snap b/tests/core/snapshots/undeclared-type-no-base-url.md_error.snap index fe591d2f33..15cac99abc 100644 --- a/tests/core/snapshots/undeclared-type-no-base-url.md_error.snap +++ b/tests/core/snapshots/undeclared-type-no-base-url.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/undeclared-type.md_error.snap b/tests/core/snapshots/undeclared-type.md_error.snap index fe591d2f33..15cac99abc 100644 --- a/tests/core/snapshots/undeclared-type.md_error.snap +++ b/tests/core/snapshots/undeclared-type.md_error.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: errors +snapshot_kind: text --- [ { diff --git a/tests/core/snapshots/union-nested-resolver.md_0.snap b/tests/core/snapshots/union-nested-resolver.md_0.snap index d5a48537ba..936998aad7 100644 --- a/tests/core/snapshots/union-nested-resolver.md_0.snap +++ b/tests/core/snapshots/union-nested-resolver.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/union-nested-resolver.md_client.snap b/tests/core/snapshots/union-nested-resolver.md_client.snap index 3a8e8b76c7..f28c7d6e04 100644 --- a/tests/core/snapshots/union-nested-resolver.md_client.snap +++ b/tests/core/snapshots/union-nested-resolver.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Buzz { spam: Spam diff --git a/tests/core/snapshots/union-nested-resolver.md_merged.snap b/tests/core/snapshots/union-nested-resolver.md_merged.snap index 0ad71b5a67..cad916ee6e 100644 --- a/tests/core/snapshots/union-nested-resolver.md_merged.snap +++ b/tests/core/snapshots/union-nested-resolver.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server(port: 8030) @upstream { query: Query diff --git a/tests/core/snapshots/upstream-batching.md_0.snap b/tests/core/snapshots/upstream-batching.md_0.snap index e8bca1fdcc..fe63cd4831 100644 --- a/tests/core/snapshots/upstream-batching.md_0.snap +++ b/tests/core/snapshots/upstream-batching.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/upstream-batching.md_client.snap b/tests/core/snapshots/upstream-batching.md_client.snap index 5e9fd2fa39..455588a80b 100644 --- a/tests/core/snapshots/upstream-batching.md_client.snap +++ b/tests/core/snapshots/upstream-batching.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int): User diff --git a/tests/core/snapshots/upstream-batching.md_merged.snap b/tests/core/snapshots/upstream-batching.md_merged.snap index dba73d283f..ddd433b3ba 100644 --- a/tests/core/snapshots/upstream-batching.md_merged.snap +++ b/tests/core/snapshots/upstream-batching.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { query: Query diff --git a/tests/core/snapshots/upstream-fail-request.md_0.snap b/tests/core/snapshots/upstream-fail-request.md_0.snap index 95fd0e3582..e7241f883d 100644 --- a/tests/core/snapshots/upstream-fail-request.md_0.snap +++ b/tests/core/snapshots/upstream-fail-request.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/upstream-fail-request.md_client.snap b/tests/core/snapshots/upstream-fail-request.md_client.snap index 52d67b233a..e7241293e9 100644 --- a/tests/core/snapshots/upstream-fail-request.md_client.snap +++ b/tests/core/snapshots/upstream-fail-request.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user: User diff --git a/tests/core/snapshots/upstream-fail-request.md_merged.snap b/tests/core/snapshots/upstream-fail-request.md_merged.snap index 9a8bef2a99..e498e56248 100644 --- a/tests/core/snapshots/upstream-fail-request.md_merged.snap +++ b/tests/core/snapshots/upstream-fail-request.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/with-args-url.md_0.snap b/tests/core/snapshots/with-args-url.md_0.snap index 13a20b3310..47aa236a6f 100644 --- a/tests/core/snapshots/with-args-url.md_0.snap +++ b/tests/core/snapshots/with-args-url.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/with-args-url.md_client.snap b/tests/core/snapshots/with-args-url.md_client.snap index cbcfe5da06..1b9d4f5438 100644 --- a/tests/core/snapshots/with-args-url.md_client.snap +++ b/tests/core/snapshots/with-args-url.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): User diff --git a/tests/core/snapshots/with-args-url.md_merged.snap b/tests/core/snapshots/with-args-url.md_merged.snap index 69c4cb9235..30e485dda8 100644 --- a/tests/core/snapshots/with-args-url.md_merged.snap +++ b/tests/core/snapshots/with-args-url.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/with-args.md_0.snap b/tests/core/snapshots/with-args.md_0.snap index 47bfa75fff..623f147669 100644 --- a/tests/core/snapshots/with-args.md_0.snap +++ b/tests/core/snapshots/with-args.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/with-args.md_client.snap b/tests/core/snapshots/with-args.md_client.snap index d830867cea..3418dec58d 100644 --- a/tests/core/snapshots/with-args.md_client.snap +++ b/tests/core/snapshots/with-args.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { user(id: Int!): [User] diff --git a/tests/core/snapshots/with-args.md_merged.snap b/tests/core/snapshots/with-args.md_merged.snap index 990055f2aa..77916cb59c 100644 --- a/tests/core/snapshots/with-args.md_merged.snap +++ b/tests/core/snapshots/with-args.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/with-nesting.md_0.snap b/tests/core/snapshots/with-nesting.md_0.snap index 29d1a1dfea..5253f6d607 100644 --- a/tests/core/snapshots/with-nesting.md_0.snap +++ b/tests/core/snapshots/with-nesting.md_0.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: response +snapshot_kind: text --- { "status": 200, diff --git a/tests/core/snapshots/with-nesting.md_client.snap b/tests/core/snapshots/with-nesting.md_client.snap index 30e275ebb1..e04087119d 100644 --- a/tests/core/snapshots/with-nesting.md_client.snap +++ b/tests/core/snapshots/with-nesting.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Post { body: String diff --git a/tests/core/snapshots/with-nesting.md_merged.snap b/tests/core/snapshots/with-nesting.md_merged.snap index 2c33d69af6..83bc1735ae 100644 --- a/tests/core/snapshots/with-nesting.md_merged.snap +++ b/tests/core/snapshots/with-nesting.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query diff --git a/tests/core/snapshots/yaml-nested-unions.md_client.snap b/tests/core/snapshots/yaml-nested-unions.md_client.snap index 47713e49b8..61c4959581 100644 --- a/tests/core/snapshots/yaml-nested-unions.md_client.snap +++ b/tests/core/snapshots/yaml-nested-unions.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { testVar0(u: T1Input!): U diff --git a/tests/core/snapshots/yaml-nested-unions.md_merged.snap b/tests/core/snapshots/yaml-nested-unions.md_merged.snap index e9ebca71ad..ae67c46c85 100644 --- a/tests/core/snapshots/yaml-nested-unions.md_merged.snap +++ b/tests/core/snapshots/yaml-nested-unions.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query @@ -34,11 +35,11 @@ union U1 = T1 | T2 | T3 union U2 = T3 | T4 type Query { - testVar0(u: T1Input!): U @http(url: "http://localhost/users/{{args.u}}") - testVar1(u: T2Input!): U @http(url: "http://localhost/users/{{args.u}}") - testVar2(u: T3Input!): U @http(url: "http://localhost/users/{{args.u}}") - testVar3(u: T4Input!): U @http(url: "http://localhost/users/{{args.u}}") - testVar4(u: T5Input!): U @http(url: "http://localhost/users/{{args.u}}") + testVar0(u: T1Input!): U @http(url: "http://localhost/users/{{.args.u}}") + testVar1(u: T2Input!): U @http(url: "http://localhost/users/{{.args.u}}") + testVar2(u: T3Input!): U @http(url: "http://localhost/users/{{.args.u}}") + testVar3(u: T4Input!): U @http(url: "http://localhost/users/{{.args.u}}") + testVar4(u: T5Input!): U @http(url: "http://localhost/users/{{.args.u}}") } type T1 { diff --git a/tests/core/snapshots/yaml-union-in-type.md_client.snap b/tests/core/snapshots/yaml-union-in-type.md_client.snap index 8060a57361..c50fb35781 100644 --- a/tests/core/snapshots/yaml-union-in-type.md_client.snap +++ b/tests/core/snapshots/yaml-union-in-type.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- input NNU__nu0 { new: Boolean diff --git a/tests/core/snapshots/yaml-union-in-type.md_merged.snap b/tests/core/snapshots/yaml-union-in-type.md_merged.snap index 6d07e24486..4b809f3fa5 100644 --- a/tests/core/snapshots/yaml-union-in-type.md_merged.snap +++ b/tests/core/snapshots/yaml-union-in-type.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query @@ -66,15 +67,15 @@ type NU { } type Query { - testVar0Var0(nu: NU__u0!, nnu: NNU__nu0): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar0Var1(nu: NU__u0!, nnu: NNU__nu1): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar0Var2(nu: NU__u0!, nnu: NNU__nu2): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar1Var0(nu: NU__u1!, nnu: NNU__nu0): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar1Var1(nu: NU__u1!, nnu: NNU__nu1): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar1Var2(nu: NU__u1!, nnu: NNU__nu2): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar2Var0(nu: NU__u2!, nnu: NNU__nu0): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar2Var1(nu: NU__u2!, nnu: NNU__nu1): U @http(url: "http://localhost/users/{{args.nu.u}}") - testVar2Var2(nu: NU__u2!, nnu: NNU__nu2): U @http(url: "http://localhost/users/{{args.nu.u}}") + testVar0Var0(nu: NU__u0!, nnu: NNU__nu0): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar0Var1(nu: NU__u0!, nnu: NNU__nu1): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar0Var2(nu: NU__u0!, nnu: NNU__nu2): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar1Var0(nu: NU__u1!, nnu: NNU__nu0): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar1Var1(nu: NU__u1!, nnu: NNU__nu1): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar1Var2(nu: NU__u1!, nnu: NNU__nu2): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar2Var0(nu: NU__u2!, nnu: NNU__nu0): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar2Var1(nu: NU__u2!, nnu: NNU__nu1): U @http(url: "http://localhost/users/{{.args.nu.u}}") + testVar2Var2(nu: NU__u2!, nnu: NNU__nu2): U @http(url: "http://localhost/users/{{.args.nu.u}}") } type T1 { diff --git a/tests/core/snapshots/yaml-union.md_client.snap b/tests/core/snapshots/yaml-union.md_client.snap index c680e386b0..0da7231ecc 100644 --- a/tests/core/snapshots/yaml-union.md_client.snap +++ b/tests/core/snapshots/yaml-union.md_client.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatted +snapshot_kind: text --- type Query { testVar0(u: T1Input!): U diff --git a/tests/core/snapshots/yaml-union.md_merged.snap b/tests/core/snapshots/yaml-union.md_merged.snap index b2288bc17a..3ddfd33fe8 100644 --- a/tests/core/snapshots/yaml-union.md_merged.snap +++ b/tests/core/snapshots/yaml-union.md_merged.snap @@ -1,6 +1,7 @@ --- source: tests/core/spec.rs expression: formatter +snapshot_kind: text --- schema @server @upstream { query: Query @@ -30,9 +31,9 @@ type NU { } type Query { - testVar0(u: T1Input!): U @http(url: "http://localhost/users/{{args.u}}/") - testVar1(u: T2Input!): U @http(url: "http://localhost/users/{{args.u}}/") - testVar2(u: T3Input!): U @http(url: "http://localhost/users/{{args.u}}/") + testVar0(u: T1Input!): U @http(url: "http://localhost/users/{{.args.u}}/") + testVar1(u: T2Input!): U @http(url: "http://localhost/users/{{.args.u}}/") + testVar2(u: T3Input!): U @http(url: "http://localhost/users/{{.args.u}}/") } type T1 { diff --git a/tests/core/spec.rs b/tests/core/spec.rs index 2866aefa4c..56a569da2b 100644 --- a/tests/core/spec.rs +++ b/tests/core/spec.rs @@ -16,10 +16,12 @@ use tailcall::core::async_graphql_hyper::{GraphQLBatchRequest, GraphQLRequest}; use tailcall::core::blueprint::{Blueprint, BlueprintError}; use tailcall::core::config::reader::ConfigReader; use tailcall::core::config::transformer::Required; -use tailcall::core::config::{Config, ConfigModule, Source}; +use tailcall::core::config::{Config, ConfigModule, ConfigReaderContext, Source}; use tailcall::core::http::handle_request; +use tailcall::core::mustache::PathStringEval; use tailcall::core::print_schema::print_schema; use tailcall::core::variance::Invariant; +use tailcall::core::Mustache; use tailcall_prettier::Parser; use tailcall_valid::{Cause, Valid, ValidationError, Validator}; @@ -87,7 +89,7 @@ async fn is_sdl_error(spec: &ExecutionSpec, config_module: Valid) { // TODO: we should probably figure out a way to do this for every test // but GraphQL identity checking is very hard, since a lot depends on the code // style the re-serializing check gives us some of the advantages of the @@ -97,7 +99,9 @@ async fn check_identity(spec: &ExecutionSpec) { if spec.check_identity { for (source, content) in spec.server.iter() { if matches!(source, Source::GraphQL) { - let config = Config::from_source(source.to_owned(), content).unwrap(); + let mustache = Mustache::parse(content); + let content = PathStringEval::new().eval_partial(&mustache, reader_ctx); + let config = Config::from_source(source.to_owned(), &content).unwrap(); let actual = config.to_sdl(); // \r is added automatically in windows, it's safe to replace it with \n @@ -190,11 +194,18 @@ async fn test_spec(spec: ExecutionSpec) { let mut runtime = runtime::create_runtime(mock_http_client.clone(), spec.env.clone(), None); runtime.file = Arc::new(File::new(spec.clone())); + + let runtime_clone = runtime.clone(); + let reader_ctx = ConfigReaderContext::new(&runtime_clone); + let reader = ConfigReader::init(runtime); // Resolve all configs let config_modules = join_all(spec.server.iter().map(|(source, content)| async { - let config = Config::from_source(source.to_owned(), content)?; + let mustache = Mustache::parse(content); + let content = PathStringEval::new().eval_partial(&mustache, &reader_ctx); + + let config = Config::from_source(source.to_owned(), &content)?; reader.resolve(config, spec.path.parent()).await })) @@ -209,10 +220,12 @@ async fn test_spec(spec: ExecutionSpec) { })) }) .and_then(|cfgs| { - cfgs.into_iter() - .fold(Valid::succeed(ConfigModule::default()), |acc, c| { - acc.and_then(|acc| acc.unify(c.clone())) - }) + let mut cfgs = cfgs.into_iter(); + let config_module = cfgs.next().expect("At least one config should be defined"); + + cfgs.fold(Valid::succeed(config_module.clone()), |acc, c| { + acc.and_then(|acc| acc.unify(c.clone())) + }) }) // Apply required transformers to the configuration .and_then(|cfg| cfg.transform(Required)); @@ -237,7 +250,7 @@ async fn test_spec(spec: ExecutionSpec) { .collect::, _>>() .unwrap(); - check_identity(&spec).await; + check_identity(&spec, &reader_ctx).await; // client: Check if client spec matches snapshot if config_modules.len() == 1 { diff --git a/tests/execution/batching-disabled.md b/tests/execution/batching-disabled.md index d95145be48..5783980497 100644 --- a/tests/execution/batching-disabled.md +++ b/tests/execution/batching-disabled.md @@ -1,66 +1,18 @@ # Batching disabled -```json @config -{ - "server": {}, - "upstream": { - "httpCache": 42, - "batch": { - "maxSize": 100, - "delay": 0, - "headers": [] - } - }, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "user": { - "type": { - "name": "User" - }, - "args": { - "id": { - "type": { - "name": "Int", - "required": true - } - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/{{.args.id}}" - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - }, - "username": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server @upstream(httpCache: 42, batch: {maxSize: 100, delay: 0, headers: []}) { + query: Query +} + +type Query { + user(id: Int!): User @http(url: "http://jsonplaceholder.typicode.com/users/{{.args.id}}") +} + +type User { + id: Int + name: String + username: String } ``` diff --git a/tests/execution/batching-validation.md b/tests/execution/batching-validation.md new file mode 100644 index 0000000000..208107efc9 --- /dev/null +++ b/tests/execution/batching-validation.md @@ -0,0 +1,47 @@ +--- +error: true +--- + +# batching validation + +```graphql @config +schema @upstream(httpCache: 42, batch: {delay: 1}) { + query: Query +} + +type User { + id: Int + name: String +} + +type Post { + id: Int + title: String + body: String +} + +type Query { + user(id: Int!): User + @http( + url: "http://jsonplaceholder.typicode.com/users" + method: POST + body: {uId: "{{.args.id}}", userId: "{{.args.id}}"} + batchKey: ["id"] + ) + posts: [Post] @http(url: "http://jsonplaceholder.typicode.com/posts", batchKey: ["id"]) + userWithId(id: Int!): User + @http( + url: "http://jsonplaceholder.typicode.com/users" + method: POST + body: {uId: "uId", userId: "userId"} + batchKey: ["id"] + ) + userWithIdTest(id: Int!): User + @http( + url: "http://jsonplaceholder.typicode.com/users" + method: PUT + body: {uId: "uId", userId: "userId"} + batchKey: ["id"] + ) +} +``` diff --git a/tests/execution/batching.md b/tests/execution/batching.md index 648266d6bc..34eb5b6f0d 100644 --- a/tests/execution/batching.md +++ b/tests/execution/batching.md @@ -1,47 +1,17 @@ # Sending a batched graphql request -```json @config -{ - "server": { - "batchRequests": true - }, - "upstream": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "user": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/1" - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server(batchRequests: true) @upstream { + query: Query +} + +type Query { + user: User @http(url: "http://jsonplaceholder.typicode.com/users/1") +} + +type User { + id: Int + name: String } ``` diff --git a/tests/execution/body-batching-cases.md b/tests/execution/body-batching-cases.md new file mode 100644 index 0000000000..a8e124a49a --- /dev/null +++ b/tests/execution/body-batching-cases.md @@ -0,0 +1,154 @@ +# Batching default + +```graphql @config +schema @server(port: 8000) @upstream(httpCache: 42, batch: {delay: 1}) { + query: Query +} + +type Query { + user: User @http(url: "http://jsonplaceholder.typicode.com/users/1") + users: [User] @http(url: "http://jsonplaceholder.typicode.com/users") + posts: [Post] @http(url: "http://jsonplaceholder.typicode.com/posts") + foo: [Foo] @http(url: "http://jsonplaceholder.typicode.com/foo") +} + +type Foo { + a: Int + b: Int + bar: Bar + @http(url: "http://jsonplaceholder.typicode.com/bar", method: POST, body: {id: "{{.value.a}}"}, batchKey: ["a"]) +} + +type Bar { + a: Int + b: Int +} + +type User { + id: Int! + name: String! + email: String! + post: Post + @http( + url: "http://jsonplaceholder.typicode.com/posts" + method: POST + body: {userId: "{{.value.id}}", title: "title", body: "body"} + batchKey: ["userId"] + ) +} + +type Post { + id: Int! + userId: Int! + title: String! + body: String! + user: User + @http( + url: "http://jsonplaceholder.typicode.com/users" + method: POST + body: {key: "id", value: "{{.value.userId}}"} + batchKey: ["id"] + ) +} +``` + +```yml @mock +- request: + method: GET + url: http://jsonplaceholder.typicode.com/users + response: + status: 200 + body: + - id: 1 + name: user-1 + email: user-1@gmail.com + - id: 2 + name: user-2 + email: user-2@gmail.com +- request: + method: POST + url: http://jsonplaceholder.typicode.com/posts + body: [{"userId": "1", "title": "title", "body": "body"}, {"userId": "2", "title": "title", "body": "body"}] + response: + status: 200 + body: + - id: 1 + userId: 1 + title: user-1 + body: user-1@gmail.com + - id: 2 + userId: 2 + title: user-2 + body: user-2@gmail.com + +- request: + method: GET + url: http://jsonplaceholder.typicode.com/posts + response: + status: 200 + body: + - id: 1 + userId: 1 + title: user-1 + body: user-1@gmail.com + - id: 2 + userId: 2 + title: user-2 + body: user-2@gmail.com + +- request: + method: POST + url: http://jsonplaceholder.typicode.com/users + body: [{"key": "id", "value": "1"}, {"key": "id", "value": "2"}] + response: + status: 200 + body: + - id: 1 + name: user-1 + email: user-1@gmail.com + - id: 2 + userId: 2 + name: user-2 + email: user-2@gmail.com + +- request: + method: GET + url: http://jsonplaceholder.typicode.com/foo + expectedHits: 1 + response: + status: 200 + body: + - a: 11 + b: 12 + - a: 21 + b: 22 + +- request: + method: POST + url: http://jsonplaceholder.typicode.com/bar + body: [{"id": "11"}, {"id": "21"}] + response: + status: 200 + body: + - a: 11 + b: 12 + - a: 21 + b: 22 +``` + +```yml @test +- method: POST + url: http://localhost:8080/graphql + body: + query: query { users { id name post { id title userId } } } + +- method: POST + url: http://localhost:8080/graphql + body: + query: query { posts { id title user { id name } } } + +- method: POST + url: http://localhost:8080/graphql + body: + query: query { foo { a b bar { a b } } } +``` diff --git a/tests/execution/body-batching.md b/tests/execution/body-batching.md new file mode 100644 index 0000000000..a5fce54fce --- /dev/null +++ b/tests/execution/body-batching.md @@ -0,0 +1,114 @@ +# Batching post + +```graphql @config +schema + @server(port: 8000, queryValidation: false) + @upstream(httpCache: 42, batch: {maxSize: 1000, delay: 1, headers: []}) { + query: Query +} + +type Query { + users: [User] @http(url: "http://jsonplaceholder.typicode.com/users") +} + +type Post { + id: Int + title: String + body: String + userId: Int! +} + +type User { + id: Int! + name: String! + posts: [Post] + @http( + url: "https://jsonplaceholder.typicode.com/posts" + method: POST + body: {userId: "{{.value.id}}", title: "foo", body: "bar"} + batchKey: ["userId"] + ) + comments: [Comment] + @http( + url: "https://jsonplaceholder.typicode.com/comments" + method: POST + body: {title: "foo", body: "bar", meta: {information: {userId: "{{.value.id}}"}}} + batchKey: ["userId"] + ) +} + +type Comment { + id: Int +} +``` + +```yml @mock +- request: + method: GET + url: http://jsonplaceholder.typicode.com/users + expectedHits: 2 + response: + status: 200 + body: + - id: 1 + name: user-1 + - id: 2 + name: user-2 + - id: 3 + name: user-3 +- request: + method: POST + url: https://jsonplaceholder.typicode.com/posts + body: + [ + {"userId": "1", "title": "foo", "body": "bar"}, + {"userId": "2", "title": "foo", "body": "bar"}, + {"userId": "3", "title": "foo", "body": "bar"}, + ] + response: + status: 200 + body: + - id: 1 + title: foo + body: bar + userId: 1 + - id: 2 + title: foo + body: bar + userId: 2 + - id: 3 + title: foo + body: bar + userId: 3 + +- request: + method: POST + url: https://jsonplaceholder.typicode.com/comments + body: + [ + {"title": "foo", "body": "bar", "meta": {"information": {"userId": "1"}}}, + {"title": "foo", "body": "bar", "meta": {"information": {"userId": "2"}}}, + {"title": "foo", "body": "bar", "meta": {"information": {"userId": "3"}}}, + ] + response: + status: 200 + body: + - id: 1 + userId: 1 + - id: 2 + userId: 2 + - id: 3 + userId: 3 +``` + +```yml @test +- method: POST + url: http://localhost:8080/graphql + body: + query: query { users { id posts { userId title } } } + +- method: POST + url: http://localhost:8080/graphql + body: + query: query { users { id comments { id } } } +``` diff --git a/tests/execution/cache-control.md b/tests/execution/cache-control.md index 130452cd04..c359473e72 100644 --- a/tests/execution/cache-control.md +++ b/tests/execution/cache-control.md @@ -1,62 +1,18 @@ # Sending requests to verify Cache-Control behavior -```json @config -{ - "server": { - "headers": { - "cacheControl": true - } - }, - "upstream": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "user": { - "type": { - "name": "User" - }, - "args": { - "id": { - "type": { - "name": "Int" - } - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users", - "query": [ - { - "key": "id", - "value": "{{.args.id}}" - } - ] - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server(headers: {cacheControl: true}) @upstream { + query: Query +} + +type Query { + user(id: Int): User + @http(url: "http://jsonplaceholder.typicode.com/users", query: [{key: "id", value: "{{.args.id}}"}]) +} + +type User { + id: Int + name: String } ``` diff --git a/tests/execution/call-mutation.md b/tests/execution/call-mutation.md index 109a86eee2..bcda2cd7b0 100644 --- a/tests/execution/call-mutation.md +++ b/tests/execution/call-mutation.md @@ -83,7 +83,7 @@ type User { - request: method: PATCH url: http://jsonplaceholder.typicode.com/users/1 - body: {"postId": 1} + body: '{"postId":1}' response: status: 200 body: diff --git a/tests/execution/custom-headers.md b/tests/execution/custom-headers.md index 3a0c4f486d..9bf05ba6f4 100644 --- a/tests/execution/custom-headers.md +++ b/tests/execution/custom-headers.md @@ -1,41 +1,12 @@ # Custom Headers -```json @config -{ - "server": { - "headers": { - "custom": [ - { - "key": "x-id", - "value": "1" - }, - { - "key": "x-name", - "value": "John Doe" - } - ] - } - }, - "upstream": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "greet": { - "type": { - "name": "String" - }, - "expr": { - "body": "Hello World!" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server(headers: {custom: [{key: "x-id", value: "1"}, {key: "x-name", value: "John Doe"}]}) @upstream { + query: Query +} + +type Query { + greet: String @expr(body: "Hello World!") } ``` diff --git a/tests/execution/env-value.md b/tests/execution/env-value.md index 15a1ee7862..12eaa4db67 100644 --- a/tests/execution/env-value.md +++ b/tests/execution/env-value.md @@ -1,75 +1,21 @@ # Env value -```json @config -{ - "server": {}, - "schema": { - "query": "Query" - }, - "types": { - "Post": { - "fields": { - "body": { - "type": { - "name": "String" - }, - "cache": null - }, - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "title": { - "type": { - "name": "String" - }, - "cache": null - }, - "userId": { - "type": { - "name": "Int", - "required": true - }, - "cache": null - } - }, - "cache": null - }, - "Query": { - "fields": { - "post1": { - "type": { - "name": "Post" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/posts/{{.env.ID}}" - }, - "cache": null - }, - "post2": { - "type": { - "name": "Post" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/posts/{{.env.POST_ID}}" - }, - "cache": null - }, - "post3": { - "type": { - "name": "Post" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/posts/{{.env.NESTED_POST_ID}}" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server { + query: Query +} + +type Post { + body: String + id: Int + title: String + userId: Int! +} + +type Query { + post1: Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.env.ID}}") + post2: Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.env.POST_ID}}") + post3: Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.env.NESTED_POST_ID}}") } ``` diff --git a/tests/execution/https.md b/tests/execution/https.md deleted file mode 100644 index 93b418be13..0000000000 --- a/tests/execution/https.md +++ /dev/null @@ -1,61 +0,0 @@ -# Against a server with HTTPS - -```json @config -{ - "server": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "firstUser": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/1" - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } -} -``` - -```yml @mock -- request: - method: GET - url: http://jsonplaceholder.typicode.com/users/1 - response: - status: 200 - body: - id: 1 - name: Leanne Graham -``` - -```yml @test -- method: POST - url: http://localhost:8080/graphql - body: - query: query { firstUser { name } } -``` diff --git a/tests/execution/merge-linked-config.md b/tests/execution/merge-linked-config.md new file mode 100644 index 0000000000..f5de4c41bc --- /dev/null +++ b/tests/execution/merge-linked-config.md @@ -0,0 +1,49 @@ +# Merge linked configs + +Merge should happen only on schema while configurations like schema, upstream, telemetry should be defined only by the root config + +```graphql @file:link-1.graphql +schema @server(port: 3000) @upstream(httpCache: 42, batch: {delay: 22}) { + query: Query +} + +type Foo { + foo: String +} + +type Query { + foo: Foo @http(url: "http://jsonplaceholder.typicode.com/foo") +} +``` + +```graphql @file:link-2.graphql +schema @server(port: 4000) @upstream(httpCache: 33, batch: {delay: 48}) { + query: Query +} + +type Post { + id: Int! + userId: Int! + user: User + @graphQL(url: "http://jsonplaceholder.typicode.com", args: [{key: "id", value: "{{.value.userId}}"}], name: "user") +} + +type Query { + post(id: Int!): Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.args.id}}") +} + +type User { + id: Int + name: String +} +``` + +```graphql @config +schema + @server(port: 8000) + @upstream(httpCache: 10, batch: {delay: 10}) + @link(src: "link-1.graphql", type: Config) + @link(src: "link-2.graphql", type: Config) { + query: Query +} +``` diff --git a/tests/execution/non-scalar-value-in-query.md b/tests/execution/non-scalar-value-in-query.md new file mode 100644 index 0000000000..bb482f4292 --- /dev/null +++ b/tests/execution/non-scalar-value-in-query.md @@ -0,0 +1,44 @@ +--- +error: true +--- + +# test objects in args + +```graphql @config +schema @server @upstream { + query: Query +} + +type Query { + invalidArgumentType(criteria: Nested): [Employee!]! + @http( + url: "http://localhost:8081/family/employees" + query: [{key: "nested", value: "{{.args.criteria}}", skipEmpty: true}] + ) + unknownField(criteria: Nested): [Employee!]! + @http( + url: "http://localhost:8081/family/employees" + query: [{key: "nested", value: "{{.args.criteria.unknown_field}}", skipEmpty: true}] + ) + unknownArgument(criteria: Nested): [Employee!]! + @http( + url: "http://localhost:8081/family/employees" + query: [{key: "nested", value: "{{.args.criterias}}", skipEmpty: true}] + ) + invalidArgument(criteria: Nested): [Employee!]! + @http(url: "http://localhost:8081/family/employees", query: [{key: "nested", value: "{{.args}}", skipEmpty: true}]) + unknownArgumentType(criteria: Criteria): [Employee!]! + @http( + url: "http://localhost:8081/family/employees" + query: [{key: "nested", value: "{{.args.criteria}}", skipEmpty: true}] + ) +} + +type Employee { + id: ID! +} + +input Nested { + hasChildren: Boolean +} +``` diff --git a/tests/execution/on-response-body-grpc.md b/tests/execution/on-response-body-grpc.md new file mode 100644 index 0000000000..647c140bbf --- /dev/null +++ b/tests/execution/on-response-body-grpc.md @@ -0,0 +1,72 @@ +# onResponseBody hook on grpc directive. + +```js @file:test.js +function onResponse(data) { + const body = JSON.parse(data) + body.title += " - Changed by JS" + return JSON.stringify(body) +} +``` + +```protobuf @file:news.proto +syntax = "proto3"; + +import "google/protobuf/empty.proto"; + +package news; + +message News { + int32 id = 1; + string title = 2; + string body = 3; + string postImage = 4; +} + +service NewsService { + rpc GetNews (NewsId) returns (News) {} +} + +message NewsId { + int32 id = 1; +} +``` + +```graphql @config +schema @server(port: 8000) @link(type: Script, src: "test.js") @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +type Query { + newsById: News! + @grpc( + method: "news.NewsService.GetNews" + body: {id: 2} + onResponseBody: "onResponse" + url: "http://localhost:50051" + ) +} + +type News { + id: Int + title: String + body: String + postImage: String +} +``` + +```yml @mock +- request: + method: POST + url: http://localhost:50051/news.NewsService/GetNews + response: + status: 200 + textBody: \0\0\0\0#\x08\x02\x12\x06Note 2\x1a\tContent 2\"\x0cPost image 2 + expectedHits: 1 +``` + +```yml @test +- method: POST + url: http://localhost:8080/graphql + body: + query: query { newsById { id, title } } +``` diff --git a/tests/execution/recursive-types-json.md b/tests/execution/recursive-types-json.md deleted file mode 100644 index 3c3431047e..0000000000 --- a/tests/execution/recursive-types-json.md +++ /dev/null @@ -1,211 +0,0 @@ -# Recursive Type JSON - -```json @config -{ - "$schema": "./.tailcallrc.schema.json", - "upstream": { - "httpCache": 42 - }, - "schema": { - "query": "Query", - "mutation": "Mutation" - }, - "types": { - "Query": { - "fields": { - "user": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/1" - } - } - } - }, - "Mutation": { - "fields": { - "createUser": { - "args": { - "user": { - "type": { - "name": "User" - } - } - }, - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/user", - "method": "POST", - "body": "{{.args.user}}" - } - } - } - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int", - "required": true - } - }, - "name": { - "type": { - "name": "String", - "required": true - } - }, - "connections": { - "type": { - "list": { - "name": "Connection" - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/connections/{{.value.id}}" - } - } - } - }, - "Connection": { - "fields": { - "type": { - "type": { - "name": "String" - } - }, - "user": { - "type": { - "name": "User" - } - } - } - } - } -} -``` - -```yml @mock -- request: - method: GET - url: http://jsonplaceholder.typicode.com/users/1 - response: - status: 200 - body: - id: 1 - name: User1 -- request: - method: GET - url: http://jsonplaceholder.typicode.com/connections/1 - response: - status: 200 - body: - - type: friend - user: - id: 2 - name: User2 - -- request: - method: GET - url: http://jsonplaceholder.typicode.com/connections/2 - response: - status: 200 - body: - - type: friend - user: - id: 3 - name: User3 - - type: coworker - user: - id: 4 - name: User4 - -- request: - method: POST - url: http://jsonplaceholder.typicode.com/user - body: - id: 111 - name: NewUser - connections: - - type: friend - user: - id: 1 - name: User1 - response: - status: 200 - body: - id: 111 - name: NewUser - -- request: - method: GET - url: http://jsonplaceholder.typicode.com/connections/111 - response: - status: 200 - body: - - type: friend - user: - id: 1 - name: User1 -``` - -```yml @test -- method: POST - url: http://localhost:8080/graphql - body: - query: | - query { - user { - name - id - connections { - type - user { - name - id - connections { - user { - name - id - } - } - } - } - } - } - -- method: POST - url: http://localhost:8080/graphql - body: - query: | - mutation { - createUser( - user: { - id: 111, - name: "NewUser", - connections: [ - { - type: "friend" - user: { - id: 1 - name: "User1" - } - } - ] - } - ) { - name - id - connections { - type - user { - name - id - } - } - } - } -``` diff --git a/tests/execution/ref-other-nested.md b/tests/execution/ref-other-nested.md index 9687d9177b..a5d87c839a 100644 --- a/tests/execution/ref-other-nested.md +++ b/tests/execution/ref-other-nested.md @@ -1,69 +1,25 @@ # Ref other nested -```json @config -{ - "server": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "firstUser": { - "type": { - "name": "User1" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/1" - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - }, - "User1": { - "fields": { - "user1": { - "type": { - "name": "User2" - }, - "cache": null - } - }, - "cache": null - }, - "User2": { - "fields": { - "user2": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/1" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server { + query: Query +} + +type Query { + firstUser: User1 @http(url: "http://jsonplaceholder.typicode.com/users/1") +} + +type User { + id: Int + name: String +} + +type User1 { + user1: User2 +} + +type User2 { + user2: User @http(url: "http://jsonplaceholder.typicode.com/users/1") } ``` diff --git a/tests/execution/request-to-upstream-batching.md b/tests/execution/request-to-upstream-batching.md index c065cbb881..d9de545e0d 100644 --- a/tests/execution/request-to-upstream-batching.md +++ b/tests/execution/request-to-upstream-batching.md @@ -1,68 +1,22 @@ # Batched graphql request to batched upstream query -```json @config -{ - "server": { - "batchRequests": true - }, - "upstream": { - "batch": { - "maxSize": 100, - "delay": 1, - "headers": [] - } - }, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "user": { - "type": { - "name": "User" - }, - "args": { - "id": { - "type": { - "name": "Int", - "required": true - } - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users", - "query": [ - { - "key": "id", - "value": "{{.args.id}}" - } - ], - "batchKey": ["id"] - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server(batchRequests: true) @upstream(batch: {maxSize: 100, delay: 1, headers: []}) { + query: Query +} + +type Query { + user(id: Int!): User + @http( + url: "http://jsonplaceholder.typicode.com/users" + query: [{key: "id", value: "{{.args.id}}"}] + batchKey: ["id"] + ) +} + +type User { + id: Int + name: String } ``` diff --git a/tests/execution/simple-query.md b/tests/execution/simple-query.md index f706289a95..557c3b7e88 100644 --- a/tests/execution/simple-query.md +++ b/tests/execution/simple-query.md @@ -1,44 +1,17 @@ # Simple query -```json @config -{ - "server": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "firstUser": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/1" - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server @upstream { + query: Query +} + +type Query { + firstUser: User @http(url: "http://jsonplaceholder.typicode.com/users/1") +} + +type User { + id: Int + name: String } ``` diff --git a/tests/execution/test-conflict-allowed-headers.md b/tests/execution/test-conflict-allowed-headers.md deleted file mode 100644 index bab99fb9df..0000000000 --- a/tests/execution/test-conflict-allowed-headers.md +++ /dev/null @@ -1,21 +0,0 @@ -# test-conflict-allowed-headers - -```graphql @config -schema @server @upstream(allowedHeaders: ["a", "b", "c"]) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` - -```graphql @config -schema @server @upstream(allowedHeaders: ["b", "c", "d"]) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` diff --git a/tests/execution/test-conflict-vars.md b/tests/execution/test-conflict-vars.md deleted file mode 100644 index e1253cecfe..0000000000 --- a/tests/execution/test-conflict-vars.md +++ /dev/null @@ -1,21 +0,0 @@ -# test-conflict-vars - -```graphql @config -schema @server(vars: [{key: "a", value: "b"}, {key: "c", value: "d"}]) @upstream { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` - -```graphql @config -schema @server(vars: [{key: "a", value: "b"}, {key: "p", value: "q"}]) @upstream { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` diff --git a/tests/execution/test-enum-empty.md b/tests/execution/test-enum-empty.md index 66fbac46c2..c1d3ebcf55 100644 --- a/tests/execution/test-enum-empty.md +++ b/tests/execution/test-enum-empty.md @@ -4,42 +4,14 @@ error: true # test-enum-empty -```json @config -{ - "server": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "foo": { - "type": { - "name": "Foo" - }, - "args": { - "val": { - "type": { - "name": "String", - "required": true - } - } - }, - "expr": { - "body": "{{.args.val}}" - }, - "cache": null, - "protected": null - } - }, - "protected": null - } - }, - "enums": { - "Foo": { - "variants": [], - "doc": null - } - } +```graphql @config +schema @server { + query: Query } + +type Query { + foo(val: String!): Foo @expr(body: "{{.args.val}}") +} + +enum Foo {} ``` diff --git a/tests/execution/test-eval-partial.md b/tests/execution/test-eval-partial.md new file mode 100644 index 0000000000..9114e22438 --- /dev/null +++ b/tests/execution/test-eval-partial.md @@ -0,0 +1,26 @@ +```graphql @config +schema @server(port: 8080) @upstream(httpCache: 42, batch: {delay: 100}) { + query: Query +} + +type Query { + post(id: Int!): [Post] @http(url: "http://jsonplaceholder.typicode.com/posts/{{.args.id}}") +} + +type User { + id: Int! +} + +type Post { + id: Int! + userId: Int! + foo: String @http(url: "http://jsonplaceholder.typicode.com/posts/{{.env.FOO}}") + user: User @http(url: "http://jsonplaceholder.typicode.com/users/{{.value.userId}}") +} +``` + +```json @env +{ + "FOO": "foo" +} +``` diff --git a/tests/execution/test-interface-from-json.md b/tests/execution/test-interface-from-json.md deleted file mode 100644 index 9d2e25dbb6..0000000000 --- a/tests/execution/test-interface-from-json.md +++ /dev/null @@ -1,47 +0,0 @@ -# Interfaces defined in json - -```json @config -{ - "schema": { - "query": "Query" - }, - "types": { - "IA": { - "fields": { - "a": { - "type": { - "name": "String" - } - } - } - }, - "B": { - "implements": ["IA"], - "fields": { - "a": { - "type": { - "name": "String" - } - }, - "b": { - "type": { - "name": "String" - } - } - } - }, - "Query": { - "fields": { - "bar": { - "type": { - "name": "B" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/posts" - } - } - } - } - } -} -``` diff --git a/tests/execution/test-merge-batch.md b/tests/execution/test-merge-batch.md deleted file mode 100644 index 875b222da7..0000000000 --- a/tests/execution/test-merge-batch.md +++ /dev/null @@ -1,31 +0,0 @@ -# test-merge-batch - -```graphql @config -schema @server @upstream(batch: {delay: 0, maxSize: 1000, headers: ["a", "b"]}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` - -```graphql @config -schema @server @upstream(batch: {delay: 5, maxSize: 100, headers: ["b", "c"]}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` - -```graphql @config -schema @server @upstream { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` diff --git a/tests/execution/test-merge-query.md b/tests/execution/test-merge-query.md deleted file mode 100644 index 2ff91c33ba..0000000000 --- a/tests/execution/test-merge-query.md +++ /dev/null @@ -1,21 +0,0 @@ -# test-merge-query - -```graphql @config -schema @server(port: 3000) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` - -```graphql @config -schema @server(port: 8000) @upstream(proxy: {url: "http://localhost:3000"}) { - query: Query -} - -type Query { - hi: String @expr(body: "world") -} -``` diff --git a/tests/execution/test-nested-link.md b/tests/execution/test-nested-link.md deleted file mode 100644 index 19e9ad8fd0..0000000000 --- a/tests/execution/test-nested-link.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -identity: true ---- - -# test-nested-link - -```graphql @file:link-enum.graphql -schema @server @upstream { - query: Query -} - -enum Foo { - BAR - BAZ -} - -type Query { - foo: Foo @http(url: "http://jsonplaceholder.typicode.com/foo") -} -``` - -```graphql @file:graphql-with-link.graphql -schema @server @link(src: "link-enum.graphql", type: Config) { - query: Query -} - -type Post { - id: Int! - userId: Int! - user: User - @graphQL(url: "http://jsonplaceholder.typicode.com", args: [{key: "id", value: "{{.value.userId}}"}], name: "user") -} - -type Query { - post(id: Int!): Post @http(url: "http://jsonplaceholder.typicode.com/posts/{{.args.id}}") -} - -type User { - id: Int - name: String -} -``` - -```graphql @config -schema @server @upstream @link(src: "graphql-with-link.graphql", type: Config) { - query: Query -} -``` diff --git a/tests/execution/test-on-response-body.md b/tests/execution/test-on-response-body.md new file mode 100644 index 0000000000..d7263816c8 --- /dev/null +++ b/tests/execution/test-on-response-body.md @@ -0,0 +1,42 @@ +# Js Customize the Response with onResponseBody. + +```js @file:test.js +function onResponse(data) { + const body = JSON.parse(data) + body.name += " - Changed by JS" + return JSON.stringify(body) +} +``` + +```graphql @config +schema @server @link(type: Script, src: "test.js") { + query: Query +} + +type Query { + hello: User! @http(url: "https://jsonplaceholder.typicode.com/users/1", onResponseBody: "onResponse") +} + +type User { + id: Int! + name: String! +} +``` + +```yml @mock +- request: + method: GET + url: https://jsonplaceholder.typicode.com/users/1 + response: + status: 200 + body: + id: 1 + name: Leanne Graham +``` + +```yml @test +- method: POST + url: http://localhost:8080/graphql + body: + query: query { hello { name } } +``` diff --git a/tests/execution/test-response-header-merge.md b/tests/execution/test-response-header-merge.md deleted file mode 100644 index 2c7697401e..0000000000 --- a/tests/execution/test-response-header-merge.md +++ /dev/null @@ -1,31 +0,0 @@ -# test-response-header-value - -```graphql @config -schema @server(headers: {custom: [{key: "a", value: "a"}]}) { - query: Query -} - -type User { - name: String - age: Int -} - -type Query { - user: User @expr(body: {name: "John"}) -} -``` - -```graphql @config -schema @server(headers: {custom: [{key: "a", value: "b"}]}) { - query: Query -} - -type User { - name: String - age: Int -} - -type Query { - user: User @expr(body: {name: "John"}) -} -``` diff --git a/tests/execution/test-server-base-types.md b/tests/execution/test-server-base-types.md deleted file mode 100644 index d67c359d14..0000000000 --- a/tests/execution/test-server-base-types.md +++ /dev/null @@ -1,21 +0,0 @@ -# test-server-base-types - -```graphql @config -schema @server(port: 3000) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` - -```graphql @config -schema @server(port: 8000) @upstream(proxy: {url: "http://localhost:3000"}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} -``` diff --git a/tests/execution/test-static-value.md b/tests/execution/test-static-value.md deleted file mode 100644 index 960a74700e..0000000000 --- a/tests/execution/test-static-value.md +++ /dev/null @@ -1,62 +0,0 @@ -# Static value - -```json @config -{ - "server": {}, - "upstream": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "firstUser": { - "type": { - "name": "User" - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/1" - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } -} -``` - -```yml @mock -- request: - method: GET - url: http://jsonplaceholder.typicode.com/users/1 - response: - status: 200 - body: - id: 1 - name: Leanne Graham -``` - -```yml @test -- method: POST - url: http://localhost:8080/graphql - body: - query: query { firstUser { name } } -``` diff --git a/tests/execution/upstream-batching.md b/tests/execution/upstream-batching.md index e65c735567..b911bad51a 100644 --- a/tests/execution/upstream-batching.md +++ b/tests/execution/upstream-batching.md @@ -1,65 +1,22 @@ # Sending requests to be batched by the upstream server -```json @config -{ - "server": {}, - "upstream": { - "batch": { - "maxSize": 100, - "delay": 1, - "headers": [] - } - }, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "user": { - "type": { - "name": "User" - }, - "args": { - "id": { - "type": { - "name": "Int" - } - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users", - "query": [ - { - "key": "id", - "value": "{{.args.id}}" - } - ], - "batchKey": ["id"] - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server @upstream(batch: {maxSize: 100, delay: 1, headers: []}) { + query: Query +} + +type Query { + user(id: Int): User + @http( + url: "http://jsonplaceholder.typicode.com/users" + query: [{key: "id", value: "{{.args.id}}"}] + batchKey: ["id"] + ) +} + +type User { + id: Int + name: String } ``` diff --git a/tests/execution/with-args-url.md b/tests/execution/with-args-url.md index ccb98f2cc0..0fa10d9b4b 100644 --- a/tests/execution/with-args-url.md +++ b/tests/execution/with-args-url.md @@ -1,52 +1,17 @@ # With args URL -```json @config -{ - "server": {}, - "schema": { - "query": "Query" - }, - "types": { - "Query": { - "fields": { - "user": { - "type": { - "name": "User" - }, - "args": { - "id": { - "type": { - "name": "Int", - "required": true - } - } - }, - "http": { - "url": "http://jsonplaceholder.typicode.com/users/{{.args.id}}" - }, - "cache": null - } - }, - "cache": null - }, - "User": { - "fields": { - "id": { - "type": { - "name": "Int" - }, - "cache": null - }, - "name": { - "type": { - "name": "String" - }, - "cache": null - } - }, - "cache": null - } - } +```graphql @config +schema @server { + query: Query +} + +type Query { + user(id: Int!): User @http(url: "http://jsonplaceholder.typicode.com/users/{{.args.id}}") +} + +type User { + id: Int + name: String } ``` diff --git a/tests/execution/yaml-nested-unions.md b/tests/execution/yaml-nested-unions.md index 2f3dee7431..59b939c0a3 100644 --- a/tests/execution/yaml-nested-unions.md +++ b/tests/execution/yaml-nested-unions.md @@ -1,60 +1,36 @@ # Using union types inside other union types -```yml @config -schema: +```graphql @config +schema { query: Query +} -types: - T1: - fields: - t1: - type: - name: String - T2: - fields: - t2: - type: - name: Int - T3: - fields: - t3: - type: - name: Boolean - t33: - type: - name: Float - required: true - - T4: - fields: - t4: - type: - name: String - - T5: - fields: - t5: - type: - name: Boolean - - Query: - fields: - test: - type: - name: U - args: - u: - type: - name: U - required: true - http: - url: http://localhost/users/{{args.u}} - -unions: - U1: - types: ["T1", "T2", "T3"] - U2: - types: ["T3", "T4"] - U: - types: ["U1", "U2", "T5"] +type T1 { + t1: String +} + +type T2 { + t2: Int +} + +type T3 { + t3: Boolean + t33: Float! +} + +type T4 { + t4: String +} + +type T5 { + t5: Boolean +} + +union U1 = T1 | T2 | T3 +union U2 = T3 | T4 +union U = U1 | U2 | T5 + +type Query { + test(u: U!): U @http(url: "http://localhost/users/{{args.u}}") +} ``` diff --git a/tests/execution/yaml-union-in-type.md b/tests/execution/yaml-union-in-type.md index 2074c69945..8a56322500 100644 --- a/tests/execution/yaml-union-in-type.md +++ b/tests/execution/yaml-union-in-type.md @@ -1,68 +1,37 @@ # Using Union types inside usual type -```yml @config -schema: +```graphql @config +schema { query: Query +} -types: - T1: - fields: - t1: - type: - name: String - T2: - fields: - t2: - type: - name: Int - T3: - fields: - t3: - type: - name: Boolean - t33: - type: - name: Float - required: true +type T1 { + t1: String +} - NU: - fields: - test: - type: - name: String - u: - type: - name: U +type T2 { + t2: Int +} - NNU: - fields: - other: - type: - name: Int - new: - type: - name: Boolean - nu: - type: - name: NU +type T3 { + t3: Boolean + t33: Float! +} - Query: - fields: - test: - type: - name: U - args: - nu: - type: - name: NU - required: true - nnu: - type: - name: NNU - http: - url: http://localhost/users/{{args.nu.u}} +type NU { + test: String + u: U +} -unions: - U: - types: ["T1", "T2", "T3"] +type NNU { + other: Int + new: Boolean + nu: NU +} + +union U = T1 | T2 | T3 + +type Query { + test(nu: NU!, nnu: NNU): U @http(url: "http://localhost/users/{{args.nu.u}}") +} ``` diff --git a/tests/execution/yaml-union.md b/tests/execution/yaml-union.md index e15d9eeec9..ec31ed9073 100644 --- a/tests/execution/yaml-union.md +++ b/tests/execution/yaml-union.md @@ -1,54 +1,34 @@ # Using Union types in yaml config -```yml @config -schema: +```graphql @config +schema { query: Query +} -types: - T1: - fields: - t1: - type: - name: String - T2: - fields: - t2: - type: - name: Int - T3: - fields: - t3: - type: - name: Boolean - t33: - type: - name: Float - required: true - NU: - fields: - u: - type: - name: U - - NNU: - fields: - nu: - type: - name: NU - Query: - fields: - test: - type: - name: U - args: - u: - type: - name: U - required: true - http: - url: http://localhost/users/{{args.u}}/ - -unions: - U: - types: ["T1", "T2", "T3"] +type T1 { + t1: String +} + +type T2 { + t2: Int +} + +type T3 { + t3: Boolean + t33: Float! +} + +type NU { + u: U +} + +type NNU { + nu: NU +} + +union U = T1 | T2 | T3 + +type Query { + test(u: U!): U @http(url: "http://localhost/users/{{args.u}}/") +} ``` diff --git a/tests/graphql_spec.graphql b/tests/graphql_spec.graphql deleted file mode 100644 index 6f57f54ad0..0000000000 --- a/tests/graphql_spec.graphql +++ /dev/null @@ -1 +0,0 @@ -directive @error(message: String!, trace: [String!]!, description: String) repeatable on OBJECT