chore: add support for graphql-js v17 - #401
Conversation
|
|
|
Hey @benjie there's not a lot of activity on the repo but any chance this get reviewed and merged? 🙇 |
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.
3c4310d to
1dff714
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
benjie
left a comment
There was a problem hiding this comment.
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.
|
@benjie it's been 2 weeks, do you think you could merge and release this? Thanks |
|
In past @graphql/graphql-js-reviewers-write would maintain and publish versions but I haven't published any releases for this |
|
Thanks for this. I'll look into cutting a release. |
|
Published in v0.11.0 |
Summary
Adds support for graphql-js v17. The
graphqlpeer dependency now accepts both v16 and v17, so existing consumers are not forced to upgrade.Test plan
graphql@17.0.2graphql@16.2.0(peer range floor)