Cannot use GraphQLNonNull "[User]!" from another module or realm

1.1k views Asked by At

I know that the question was asked a lot, but the existing answers didn't help me. Whenever I try to start my server, I get this error:

[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,graphql
[nodemon] starting `babel-node src/index.js`
The server is up!
Error: Cannot use GraphQLNonNull "[User]!" 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.
    at instanceOf (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/node_modules/graphql/jsutils/instanceOf.js:28:13)
    at isNonNullType (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/node_modules/graphql/type/definition.js:194:34)
    at isWrappingType (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/node_modules/graphql/type/definition.js:364:30)
    at Object.getNamedType (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/node_modules/graphql/type/definition.js:423:12)
    at buildInfoFromFragment (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/src/info.ts:105:21)
    at Object.buildInfo (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/src/info.ts:36:12)
    at Prisma.Delegate.delegateToSchema (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/src/Delegate.ts:159:18)
    at Prisma.<anonymous> (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/src/Delegate.ts:65:17)
    at step (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/dist/Delegate.js:32:23)
    at Object.next (/Users/yildirim/Desktop/backend/node_modules/graphql-binding/dist/Delegate.js:13:53)

Writing "resolutions" to the "package.json" file didn't help me either. So it sounds like a version conflict issue here.

this is my package.json file:

{
  "name": "backend",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "nodemon src/index.js --ext js,graphql --exec babel-node",
    "test": "echo \"Error: no test specified\" && exit 1",
    "get-schema": "graphql-codegen --config codegen.yml"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@graphql-codegen/cli": "1.17.8",
    "nodemon": "^2.0.4",
    "@graphql-codegen/typescript-document-nodes": "1.17.8",
    "@graphql-codegen/introspection": "1.17.8"
  },
  "dependencies": {
    "@graphql-codegen/schema-ast": "^1.17.8",
    "babel-cli": "^6.26.0",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.7.0",
    "core-util-is": "^1.0.2",
    "graphql-cli": "^4.0.0",
    "graphql-tools": "^6.2.3",
    "graphql-yoga": "^1.18.3",
    "prisma-binding": "^2.3.16",
    "uuid": "^8.3.0"
  }
}

I really do not know how to continue. Can anyone help me? thanks in advance! :)

0

There are 0 answers