cypress-graphql-mock-network icon indicating copy to clipboard operation
cypress-graphql-mock-network copied to clipboard

Multiple Copies of GraphQL

Open stolinski opened this issue 3 years ago • 3 comments

Hi, I've been using this for a bit, but unfortunately updating to the latest causes the dreaded multiple copies of GraphQL error. Using an older version like 0.3.0 seems to resolve, but would love to get to the latest if possible. Any idea why this might have happened in the recent versions? I can provide a repo if needed/wanted.

stolinski avatar Dec 16 '21 23:12 stolinski

I just tried this with the latest version and am also experiencing this issue.

hsavit1 avatar Mar 30 '22 23:03 hsavit1

specifically, I'm seeing

     Error: Cannot use GraphQLObjectType "Answer" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.

hsavit1 avatar Mar 30 '22 23:03 hsavit1

When I lowered the version to 0.3.0 as @stolinski has suggested, it worked 👍

hsavit1 avatar Mar 30 '22 23:03 hsavit1