"TypeError: graphql.isType is not a function"

Hi, I’m running a GraphQL/Apollo/React stack and am trying to implement MockedProvider in my tests since it seems like a great way of abstracting away a lot of mocks. However, I keep running into the following error. I’ve tried updating, stepping through, and I’m still not sure why the import is failing. Any help would be great, thanks!

My test code and the error:

I would check that your version of graphql matches what @apollo/client expects.

I use Yarn v2 (v3 now actually), which tells you whenever you have a dependency mismatch and has commands like yarn why which tell you what version you are using and why.

That’s a good idea. I just made sure that both are the most recent, compatible versions and I’m sill getting the same error.

I would probably jump into node_modules or my .yarn/cache via the vscode zipfs extension and read what’s wrong directly at that point. Might help you find an outstanding issue in one of the repos you need.

1 Like

Okay thanks, I’ll give that a shot!