Skip to content

chore: add support for graphql-js v17 - #401

Merged
captbaritone merged 3 commits into
graphql:mainfrom
xballoy:support-graphql-17
Sep 18, 2026
Merged

captbaritone merged 3 commits into
graphql:mainfrom
xballoy:support-graphql-17

Conversation

@xballoy

@xballoy xballoy commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds support for graphql-js v17. The graphql peer dependency now accepts both v16 and v17, so existing consumers are not forced to upgrade.

Test plan

  • Test suite passes against graphql@17.0.2
  • Test suite passes against graphql@16.2.0 (peer range floor)

@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: xballoy / name: Xavier Balloy (3c4310d)

@xballoy xballoy changed the title Add support for graphql-js v17 chore: add support for graphql-js v17 Sep 1, 2026
@xballoy

xballoy commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Hey @benjie there's not a lot of activity on the repo but any chance this get reviewed and merged? 🙇
Thanks!

@benjie benjie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @xballoy; a few questions for you

Comment thread .mocharc.yml Outdated
Comment thread package.json
Comment thread tsconfig.json Outdated
@xballoy xballoy mentioned this pull request Sep 3, 2026
2 tasks
Widen the graphql peerDependency to accept both v16 and v17
("^16.2.0 || ^17.0.0") so existing consumers aren't forced onto v17's
Node >=22 requirement. No source changes were needed - the type-system
exports this library uses (GraphQLObjectType, GraphQLInterfaceType,
resolveObjMapThunk, ThunkObjMap, etc.) are unchanged between the two
majors.

- Bump the graphql devDependency to ^17.0.2 and verify the test suite
  against it (also spot-checked against graphql@16.2.0).
- Add skipLibCheck to tsconfig.json: graphql@17's .d.ts files reference
  the global AbortController/AbortSignal types, which the repo's older
  @types/node doesn't declare.
- Add a `no-require-module` node-option to .mocharc.yml: graphql@17
  opts into Node's "module-sync" exports condition, which routes
  require('graphql') through Node's require(esm) support. Mocha loads
  spec files concurrently, and multiple files requiring graphql at
  once trips a race in that mechanism ("Cannot require() ES Module
  ... because it is not yet fully loaded"). Disabling require-module
  falls back to the plain CJS build and avoids the race.
- Raise the CI Node versions (dev tooling env var and test matrix) to
  22/24, the minimum needed to install and run graphql@17.
skipLibCheck was added to work around a tsc error that doesn't
reproduce against the pinned @types/node (which already declares
AbortController/AbortSignal itself), so tsc passes without it.

The test job's CI matrix only ever exercised whichever graphql
version npm ci installs (the v17 devDependency), leaving the v16.2.0
floor of the widened peerDependency unverified by CI. Add a
graphql_version matrix dimension and override the installed graphql
package per leg (without touching package-lock.json) so both majors
are runtime-tested.
@codecov

codecov Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (89c251b) to head (b4c9f2a).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #401   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          748       748           
  Branches        48        48           
=========================================
  Hits           748       748           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

GitHub-hosted Node 22.23.2 predates the require(esm) flag rename from
--experimental-require-module to --require-module, so it rejects
--no-require-module outright and every mocha invocation dies before
running a single test. Use --no-experimental-require-module instead,
the legacy alias that's recognized on both Node 22 and Node 24.
@xballoy
xballoy requested a review from benjie September 3, 2026 14:43

@benjie benjie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; I'm not sure who (if anyone) is responsible for releases of this project... I'll add it to my TODO list to check in a couple weeks if no-one else has published in the interim.

@xballoy

xballoy commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@benjie it's been 2 weeks, do you think you could merge and release this? Thanks

@saihaj

saihaj commented Sep 16, 2026

Copy link
Copy Markdown
Member

In past @graphql/graphql-js-reviewers-write would maintain and publish versions but I haven't published any releases for this

@captbaritone captbaritone added the PR: feature 🚀 requires increase of "minor" version number label Sep 18, 2026
@captbaritone
captbaritone merged commit 903ebe0 into graphql:main Sep 18, 2026
11 checks passed
@captbaritone

Copy link
Copy Markdown
Contributor

Thanks for this. I'll look into cutting a release.

@xballoy
xballoy deleted the support-graphql-17 branch September 21, 2026 17:21
@captbaritone captbaritone mentioned this pull request Sep 21, 2026
@captbaritone

Copy link
Copy Markdown
Contributor

Published in v0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature 🚀 requires increase of "minor" version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants