graphql-yoga: Update to graphql 0.13.0 crashes subscriptions
Update:
Add the following to your package.json and run yarn install. This should fix the problem:
"resolutions": {
"graphql": "0.13.1"
}
After updating to graphql-yoga to 1.2.5 subscriptions are not working anymore because of duplicated graphql version. And a lot of warnings are throwing on yarn installation -> i think that the deps are not compatible with 0.13.0
warning "graphql-yoga > apollo-upload-server@4.0.0-alpha.3" has incorrect peer dependency "graphql@0.11 - 0.12".
warning "graphql-yoga > graphql-subscriptions@0.5.6" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0".
warning "graphql-yoga > graphql-tools@2.18.0" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0".
warning "graphql-yoga > subscriptions-transport-ws@0.9.5" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
warning "graphql-yoga > apollo-server-express > apollo-server-core@1.3.2" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0".
warning "graphql-yoga > apollo-server-express > apollo-server-core > apollo-cache-control@0.0.9" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
warning "graphql-yoga > apollo-server-express > apollo-server-core > apollo-tracing@0.1.3" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
warning "graphql-yoga > apollo-server-express > apollo-server-core > graphql-extensions@0.0.7" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
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 function from another could produce confusing and↵spurious results.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 23 (7 by maintainers)
For everyone still having problems with this, please try the following things if the error still appears:
yarn upgrade-interactive --latestand make sure you’re running the newest version of the following packages (if used)prisma-bindinggraphql-yogaprismagraphql-clirm -rf node_modulesyarn installThis issue is still happening for me with
yarnversion1.6.0even with the resolutions fix.Sounds like you may need to clear yarn’s cache
yarn cache clean@schickling Works for me! 💯
Thanks! 🎉 ✨
By now all packages have been updated, so with the newest package versions this should now work even without the
resolutionsaddition.After a rollback to a previous version it works again my entries in the working version of package.json
For anyone still running into this, upgrading
yarnfrom0.27.5to1.3.2fixed it for me.