I get an error while developing a package which adds functionality to graphql.
My issue is the check to verify that only one instance of graphql is in use.
If I npm link my package to my graphql server it does no longer run since the error gets thrown.
npm link does (as far as I understand) also use the node_modules of my linked package.
Which results in another instance of graphql which I want in this specific case.
The error in question:
Cannot use ${className} "${stringifiedValue}" 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.
I was wondering if an environment variable which circumvents this exception would be something that can be considered.
I am opening a PR with the change.
Hi there,
I get an error while developing a package which adds functionality to graphql. My issue is the check to verify that only one instance of graphql is in use. If I
npm link
my package to my graphql server it does no longer run since the error gets thrown.npm link
does (as far as I understand) also use the node_modules of my linked package. Which results in another instance of graphql which I want in this specific case.The error in question:
Source of the error: https://github.com/graphql/graphql-js/blob/main/src/jsutils/instanceOf.ts
I was wondering if an environment variable which circumvents this exception would be something that can be considered. I am opening a PR with the change.
Thanks, Daniel