Skip to content

feat!: msw/graphql, graphql as an optional peer dependency#2691

Draft
kettanaito wants to merge 4 commits intofeat/3.0from
feat/graphql-peer-dep
Draft

feat!: msw/graphql, graphql as an optional peer dependency#2691
kettanaito wants to merge 4 commits intofeat/3.0from
feat/graphql-peer-dep

Conversation

@kettanaito
Copy link
Copy Markdown
Member

@kettanaito kettanaito commented Apr 6, 2026

Motivation

msw leaks the graphql namespace through the root entrypoints, which makes graphql import problematic for developers who aren't even using GraphQL. This negatively impacts the bundle footprint as well.

This is a change in a set of changes aimed to improve DX and bundle size of msw across the board.

⚠️ BREAKING CHANGES

  • graphql namespace and any related values/types are no longer exported from msw. Please use a designated msw/graphql export path to work with GraphQL requests.
  • msw/core/graphql export path has been changed to msw/graphql for brevity.

Todos

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 164c4248-5dbe-44dc-b26a-a60c0f1e7467

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/graphql-peer-dep

Comment @coderabbitai help to get the list of available commands and usage tips.

@kettanaito kettanaito changed the base branch from main to feat/3.0 April 6, 2026 10:48
@kettanaito kettanaito added this to the 3.0 milestone Apr 6, 2026
@kettanaito kettanaito requested review from thepassle and removed request for thepassle April 6, 2026 10:51
@kettanaito
Copy link
Copy Markdown
Member Author

kettanaito commented Apr 6, 2026

@Andarist, hi 👋 Mentioning you just in case so this wouldn't conflict with the work you're doing. TL;DR msw/graphql is an explicit entrypoint now, graphql is a proper optional peer dependency. Added a new build config to tsup.config.ts. Dropped the graphqlImport plugin since there's no need to guard against those imports in the core—nothing depends on grahpql there anymore.

@kettanaito kettanaito mentioned this pull request Apr 6, 2026
4 tasks
@kettanaito kettanaito added the BREAKING CHANGE Pull request introducing breaking changes. label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING CHANGE Pull request introducing breaking changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant