我正在尝试使用以下命令下载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中有以下依赖项和dev依赖项
"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"
}我刚刚删除了Packy-lock.json和重新运行npm install,但仍然得到了相同的错误。
我是否需要手动调整阿波罗或图形so的版本,如果需要,调整到什么?或者有没有其他方法来解决这个问题。
提前谢谢。
发布于 2022-10-21 21:34:21
对于图形下载,不推荐使用CLI。。此代码适用于:
npx rover --output json graph introspect [url here] > schemas/[name here].json
发布于 2021-10-31 11:51:46
在package.json中将graphql设置为v15.7.2。这是可行的,但也需要删除node_modules目录,删除包-lock.json文件,并重新运行npm安装,以消除与多个graphql库版本的冲突。
https://stackoverflow.com/questions/69779257
复制相似问题