Server wasn't able to start properly after install graphql plugin

After I installed the graphql plugin the server returned an error.

I’m new to Strapi, so sorry if the question doesn’t fit here. Thanks. :pray:

debug Server wasn't able to start properly.
error Error: Cannot use GraphQLObjectType "Query" 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 (C:\.........\node_modules\strapi-plugin-graphql\node_modules\graphql\jsutils\instanceOf.js:29:13)
    at isObjectType (C:\.........\node_modules\strapi-plugin-graphql\node_modules\graphql\type\definition.js:122:34)
    at printType (C:\.........\node_modules\strapi-plugin-graphql\node_modules\graphql\utilities\printSchema.js:130:36)
    at C:\.........\node_modules\strapi-plugin-graphql\node_modules\graphql\utilities\printSchema.js:59:12
    at Array.map (<anonymous>)
    at printFilteredSchema (C:\.........\node_modules\strapi-plugin-graphql\node_modules\graphql\utilities\printSchema.js:58:13)
    at Object.printSchema (C:\.........\node_modules\strapi-plugin-graphql\node_modules\graphql\utilities\printSchema.js:40:10)
    at writeGenerateSchema (C:\.........\node_modules\strapi-plugin-graphql\services\schema-generator.js:138:31)
    at Object.generateSchema (C:\.........\node_modules\strapi-plugin-graphql\services\schema-generator.js:109:5)
    at Object.initialize (C:\.........\node_modules\strapi-plugin-graphql\hooks\graphql\index.js:76:74)
    at C:\.........\node_modules\strapi\lib\hooks\index.js:37:28

Resolved. This is the solution for those who need it.

npm i --save graphql@15.5.0

2 Likes

Legend! was looking for a solution for this. Thanks a lot!