Skip to content

GraphQL Query is not intercepted in apollo-client #960

Description

@shoNagai

Environment

Name Version
msw 0.35.0
apollo/client 3.0.2
node 14.17.1
OS mac os big sar 11.6

Request handlers

I'm using apollo client, and I'm trying to test intercepting the result of useQuery, but it's not intercepted.
The verified minimalist repository is shown below.

https://github.com/shoNagai/example-next-msw-apollo-client

When I did server.printHandlers() in jest.setup.js, the following log was output.

❯ npm run test

> test
> jest --config ./jest.config.js

  console.log
    [graphql] query viewer (origin: *)
      Declaration: /Users/nagaishou/gaudiy/module/example-next-msw-apollo-client/mocks/handlers.ts:4:11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscope:nodeRelated to MSW running in Node

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions