chore(deps): upgrade graphql-request to v6 - #245
Open
eitoball wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The smoke-test sample remains pinned to v4 and retains documentation claiming the now-fixed incompatibility.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Upgrades the GraphQL request stack to v6 and fixes generated ClientError imports.
Changes:
- Bumps related dependencies and lockfile entries.
- Imports
ClientErrorfrom the package root. - Updates the corresponding generation test.
File summaries
| File | Description |
|---|---|
package.json |
Upgrades GraphQL request dependencies. |
yarn.lock |
Resolves upgraded dependency graph. |
src/visitor.ts |
Generates the supported root import. |
tests/swr.spec.ts |
Updates the import assertion. |
Review details
- Files reviewed: 3/4 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
eitoball
force-pushed
the
upgrade/graphql-request-v6
branch
from
August 30, 2026 08:57
330a46d to
92fd16e
Compare
graphql-request v5.2.0 introduced a package.json `exports` field that
blocks deep subpath imports, so the generated `import { ClientError }
from 'graphql-request/dist/types'` stops resolving. Switch the
generated import to the package root, which has exported `ClientError`
consistently since v4.
@graphql-codegen/typescript-graphql-request is bumped alongside it
since its peerDependency on graphql-request jumps straight from
`~5.1.0` to `^6.0.0` with no version that supports both in between.
eitoball
force-pushed
the
upgrade/graphql-request-v6
branch
from
August 30, 2026 09:00
92fd16e to
60d4ebb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Upgrades
graphql-requestfrom^4.0.0to^6.1.0and@graphql-codegen/typescript-graphql-requestfrom^4.0.0to^6.2.0, and fixes the generatedClientErrorimport so it keeps resolving on the newer package.Why
The latest
graphql-requestis v7, and getting there safely requires going through v6 first:@graphql-codegen/typescript-graphql-request'speerDependenciesrange ongraphql-requestjumps directly from~5.1.0to^6.0.0— there is no published version that supports both, so the two packages must be bumped together rather than one version at a time.Separately,
graphql-requestv5.2.0 added a package.jsonexportsfield, which blocks deep subpath imports. This plugin's generated SDK code did:That subpath stops resolving once a consumer installs
graphql-requestv5.2.0+, breaking every project generated with this plugin.ClientErrorhas been exported from the package root since v4, so the fix is to import from the root instead.This is step 1 of a planned two-step migration (v4 → v6 → v7); the v7 jump will follow in a separate PR once its own breaking changes (ESM-only export map at v7.0.0, restored CJS support at v7.4.0, spec-compliant default
Acceptheader,HeadersInit-based header typing) are verified against this plugin's generated output.Changes
src/visitor.ts: generated import changed from'graphql-request/dist/types'to'graphql-request'tests/swr.spec.ts: updated the assertion covering the generated import to matchpackage.json: bumpedgraphql-requestto^6.1.0and@graphql-codegen/typescript-graphql-requestto^6.2.0yarn.lock: regenerated for the aboveTest plan
yarn test(build + eslint + prettier + jest) passes with the new dependency versionsvisitor.tsfix, then passes (GREEN) after🤖 Generated with Claude Code