[英]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.. 我试图在操场上进行注册突变,但遇到一个我无法理解的错误,尝试了多种方法来修复它,例如也通过从prisma令牌中获取令牌来添加授权标头,这很困难。
That error occurs if you have two different versions of graphql
in your entire dependency tree. 如果整个依赖关系树中有两个不同版本的
graphql
,则会发生该错误。
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: package.json
依赖项和dev依赖项需要使用相同版本的graphql
,所有这些依赖项都必须具有graphql
作为其对等依赖项,如下所示:
"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. 请注意,在您自己的
package.json
,您不需要对等项依赖。 Here's an example of dependencies in your package.json
that fulfill the requirements I mentioned above: 这是您
package.json
中满足我上面提到的要求的依赖项的一个示例:
"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
. 将
package.json
更新为上述依赖项,然后rm -rf node_modules yarn.lock
和npm install
或yarn
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.