【发布时间】:2021-12-15 03:23:39
【问题描述】:
我正在尝试使用命令下载 graphql 架构
apollo client:download-schema --endpoint=https://my-endpoint --header='x-hasura-admin-key: <my key>'
我收到一个错误:Error: Cannot find module 'graphql/validation/rules/UniqueTypeNames'
我在 package.json 中有以下依赖和开发依赖
"dependencies": {
"@apollo/client": "^3.4.16",
"@vue/apollo-composable": "^4.0.0-alpha.15",
"core-js": "^3.6.5",
"graphql": "^16.0.0",
"graphql-tag": "^2.12.5",
"vue": "^3.2.20",
"vue-auth0-plugin": "^2.4.1",
"vue-router": "^4.0.0-0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-typescript": "^7.0.0",
"apollo": "^2.33.7",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
"typescript": "~4.1.5"
}
我刚刚删除了 package-lock.json 并重新运行 npm install,但仍然出现同样的错误。
我是否需要手动调整 apollo 或 graphql 的版本,如果需要,调整到什么? 或者有没有其他方法可以解决这个问题。
提前致谢。
【问题讨论】:
-
嗯 - 只需将 graphql 设置为 15.7.2 版并重新安装。我还有另一个错误,但看起来我已经修复了上面的原始错误。在我确认是这种情况之前,我会一直保留这个问题,但如果是这样,升级到 v16.0.0 时可能会发生重大变化
标签: graphql command-line-interface schema apollo