Pollux 01
Pollux 01

Reputation: 121

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..

enter image description here

Upvotes: 4

Views: 6077

Answers (1)

marktani
marktani

Reputation: 7808

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.

Upvotes: 10

Related Questions