From a995e28dc4f48e83aa303e1608fd45311a174967 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Wed, 11 Nov 2026 14:44:42 -0800 Subject: [PATCH] feat: allow graphql v17 as a peer dependency Widen the peer range to ^16.11.0 || ^17.0.0 and run CI against both majors. The root devDependency stays on v16 so the compatibility suite, which runs this package inside Apollo Server v5 (a graphql v16 consumer), keeps a single copy of graphql; the v17 CI jobs swap it in after npm ci. Co-Authored-By: Claude Fable 5.1 --- .changeset/graphql-17-peer.md | 5 +++++ .github/workflows/build.yml | 12 ++++++++++++ package-lock.json | 2 +- package.json | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .changeset/graphql-17-peer.md diff --git a/.changeset/graphql-17-peer.md b/.changeset/graphql-17-peer.md new file mode 100644 index 0000000..50f14fe --- /dev/null +++ b/.changeset/graphql-17-peer.md @@ -0,0 +1,5 @@ +--- +'@apollo/subgraph': minor +--- + +Allow `graphql` v17 as a peer dependency (`^16.11.0 || ^17.0.0`). CI now runs the test suite against both v16 and v17. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 491987e..f60e8dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ jobs: fail-fast: false matrix: node-version: ['22', '24', 'latest'] + graphql-version: ['16', '17'] steps: - uses: actions/checkout@v7 @@ -24,6 +25,17 @@ jobs: - name: Install dependencies run: npm ci + # The root devDependency is graphql v16 so that the compatibility suite in + # compatibility/ (which runs this package inside Apollo Server v5, a + # graphql v16 consumer) uses a single copy of graphql. The library also + # supports graphql v17, so swap it in here to run the unit tests against + # it. Note that this only covers the unit tests, typecheck and build: the + # compatibility suite itself still runs only on v16 (see + # compatibility.yml) until an Apollo Server release accepts graphql v17. + - name: Use graphql ${{ matrix.graphql-version }} + if: matrix.graphql-version != '16' + run: npm install --no-save graphql@${{ matrix.graphql-version }} + - name: Check formatting run: npm run format:check diff --git a/package-lock.json b/package-lock.json index 07568d2..67addff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "node": ">=22.0.0" }, "peerDependencies": { - "graphql": "^16.11.0" + "graphql": "^16.11.0 || ^17.0.0" } }, "compatibility": { diff --git a/package.json b/package.json index f9b96c4..384315a 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@graphql-tools/utils": "^12.0.0" }, "peerDependencies": { - "graphql": "^16.11.0" + "graphql": "^16.11.0 || ^17.0.0" }, "devDependencies": { "@changesets/changelog-github": "^1.0.0",