graphql / graphql-js

A reference implementation of GraphQL for JavaScript
http://graphql.org/graphql-js/
MIT License
20.03k stars 2.02k forks source link

Unexpected GraphQL type definition: Query (As string: Query).Please check that you are importing only one instance of the 'graphql' package. #1804

Closed umutyerebakmaz closed 5 years ago

umutyerebakmaz commented 5 years ago

Unexpected GraphQL type definition: Query (As string: Query).Please check that you are importing only one instance of the 'graphql' package.

current version: "graphql": "14.1.1", the version I'm currently using is OK. I get this error message when I update to version 14.2.0 How can I solve this problem? I'll lower the version if I can't solve it. Thank you in advance for your help.

package.json

{
"name": "graphql-modules-accountsjs-server",
"version": "1.0.0",
"description": "GraphQL-Modules AccountsJS Boilerplate",
"main": "src/index.ts",
"repository": "https://github.com/ardatan/graphql-modules-accountsjs-boilerplate",
"author": "Arda TANRIKULU",
"license": "MIT",
"scripts": {
"generate": "gql-gen",
"generate:watch": "nodemon --exec yarn generate -e graphql",
"start:server": "ts-node -r tsconfig-paths/register -T src/index.ts",
"start:server:watch": "nodemon --exec yarn start:server -e ts",
"dev": "concurrently "yarn generate:watch" "yarn start:server:watch"",
"start": "yarn generate && yarn start:server",
"build": "tsc"
},
"dependencies": {
"@accounts/graphql-api": "0.13.0",
"@accounts/mongo": "0.13.0",
"@accounts/password": "0.13.0",
"@accounts/server": "0.13.0",
"@graphql-modules/di": "0.6.5",
"@graphql-modules/core": "0.6.5",
"@types/express": "4.16.1",
"@types/express-graphql": "0.6.2",
"@types/graphql": "14.0.7",
"@types/mongodb": "3.1.22",
"cors": "2.8.5",
"express": "4.16.4",
"express-graphql": "0.7.1",
"graphql": "14.1.1",
"graphql-tag": "2.10.1",
"graphql-toolkit": "0.2.8",
"graphql-tools": "4.0.4",
"mongodb": "3.2.2",
"reflect-metadata": "0.1.13",
"ts-node": "8.0.3",
"tsconfig-paths": "3.8.0",
"tslib": "1.9.3",
"typescript": "3.3.4000"
},
"devDependencies": {
"concurrently": "4.1.0",
"graphql-code-generator": "0.18.0",
"graphql-codegen-add": "0.18.0",
"graphql-codegen-typescript-common": "0.18.0",
"graphql-codegen-typescript-mongodb": "0.18.0",
"graphql-codegen-typescript-resolvers": "0.18.0",
"graphql-codegen-typescript-server": "0.18.0",
"nodemon": "1.18.10"
}
}

@umutyerebakmaz

IvanGoncharov commented 5 years ago

@umutyerebakmaz Please remove node_modules folder and reinstall all dependencies. Also please post the output of npm ls here.

umutyerebakmaz commented 5 years ago

@IvanGoncharov I was using different versions within frontend folder and server folder. I'm so sorry my mistake. Many thanks for your help. solved.