You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting up a new server using advanced TS example (via prisma cli) throws the following error:
Error: Cannot use GraphQLSchema "[object Object]" 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 functionfrom another could produce confusing and
spurious results.
at instanceOf (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/jsutils/instanceOf.js:17:13)
at isSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/schema.js:48:35)
at validateSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/validate.js:51:25)
at assertValidSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/validate.js:76:16)
at Object.validate (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/validation/validate.js:61:35)
at doRunQuery (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/apollo-server-core/src/runQuery.ts:143:30)
at /Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/apollo-server-core/src/runQuery.ts:69:39
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
Workaround
As per the following suggestion, adding a resolutions key to the package.json of the newly initialized project fixes the issue:
Problem
Setting up a new server using
advanced
TS example (viaprisma
cli) throws the following error:Workaround
As per the following suggestion, adding a
resolutions
key to thepackage.json
of the newly initialized project fixes the issue:Related
The text was updated successfully, but these errors were encountered: