简体   繁体   中英

Prisma graphql error on signUp mutation

I tried to do a signup mutation in the playground but I am getting an error which I cannot understand, tried a lot of ways to fix it like adding an authorisation header by getting a token from prisma token also, quite stuck..

在此处输入图片说明

That error occurs if you have two different versions of graphql in your entire dependency tree.

Your dependencies and dev dependencies for package.json need to use the same version of graphql , and all those dependencies need to have graphql as their peer dependency, like this:

  "peerDependencies": {
    "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0"
  }

Note that in your own package.json , you don't need the peer dependency. Here's an example of dependencies in your package.json that fulfill the requirements I mentioned above:

  "dependencies": {
    "graphql-yoga": "1.4.3",
    "prisma-binding": "1.5.16"
  },
  "devDependencies": {
    "graphql-cli": "2.15.8",
    "prisma": "1.3.3"
  }

I copied the dependencies from here .

Update your package.json to the above dependencies , then rm -rf node_modules yarn.lock and npm install or yarn .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM