【问题标题】:invalid GraphQL introspection query result无效的 GraphQL 自省查询结果
【发布时间】:2019-04-02 07:05:21
【问题描述】:

在 aws 控制台上修改我的 appsync 架构后,我正在尝试运行“放大代码生成”cli 命令以更新我的本地项目文件。但是,我收到以下错误:

amplify codegen
- Downloading the introspection schema
√ Downloaded the schema
- Generating GraphQL operations
- Generating
undefined
√ Code generated successfully and saved in file
2018-10-29T10:48:28.717Z - error: uncaughtException: GraphQL schema file should contain a valid GraphQL introspection query result date=Mon Oct 29 2018 18:48:28 GMT+0800 (Malay Peninsula Standard Time), pid=4768, uid=null, gid=null, cwd=C:\code_repo\dir\a\react-dashboard, execPath=C:\Program Files\nodejs\node.exe, version=v8.10.0, argv=[C:\Program Files\nodejs\node.exe, C:\Program Files\nodejs\node_modules\@aws-amplify\cli\bin\amplify, codegen], rss=126963712, heapTotal=103223296, heapUsed=79488616, external=390282, loadavg=[0, 0, 0], uptime=1068500.4532678, trace=[column=11, file=C:\Users\kaustavg\amplify-launch\amplify-cli\packages\amplify-graphql-docs-generator\src\generator\generate.ts, function=Object.generate [as default], line=19, method=generate [as default], native=false, column=57, file=C:\Users\kaustavg\amplify-launch\amplify-cli\packages\amplify-graphql-docs-generator\src\index.ts, function=generate, line=43, method=null, native=false, column=11, file=C:\Users\Alex\AppData\Roaming\nvm\v8.10.0\node_modules\@aws-amplify\cli\node_modules\amplify-codegen\src\commands\statements.js, function=projects.forEach, line=35, method=forEach, native=false, column=null, file=null, function=Array.forEach, line=null, method=forEach, native=false, column=12, file=C:\Users\Alex\AppData\Roaming\nvm\v8.10.0\node_modules\@aws-amplify\cli\node_modules\amplify-codegen\src\commands\statements.js, function=generateStatements, line=17, method=null, native=false, column=9, file=C:\Users\Alex\AppData\Roaming\nvm\v8.10.0\node_modules\@aws-amplify\cli\node_modules\amplify-codegen\src\commands\generateStatementsAndType.js, function=Object.generateStatementsAndTypes [as generate], line=27, method=generateStatementsAndTypes [as generate], native=false, column=null, file=null, function=null, line=null, method=null, native=false, column=7, file=internal/process/next_tick.js, function=process._tickDomainCallback, line=228, method=_tickDomainCallback, native=false], stack=[Error: GraphQL schema file should contain a valid GraphQL introspection query result,     at Object.generate [as default] (C:\Users\kaustavg\amplify-launch\amplify-cli\packages\amplify-graphql-docs-generator\src\generator\generate.ts:19:11),     at generate (C:\Users\kaustavg\amplify-launch\amplify-cli\packages\amplify-graphql-docs-generator\src\index.ts:43:57),     at projects.forEach (C:\Users\Alex\AppData\Roaming\nvm\v8.10.0\node_modules\@aws-amplify\cli\node_modules\amplify-codegen\src\commands\statements.js:35:11),     at Array.forEach (<anonymous>),     at generateStatements (C:\Users\Alex\AppData\Roaming\nvm\v8.10.0\node_modules\@aws-amplify\cli\node_modules\amplify-codegen\src\commands\statements.js:17:12),     at Object.generateStatementsAndTypes [as generate] (C:\Users\Alex\AppData\Roaming\nvm\v8.10.0\node_modules\@aws-amplify\cli\node_modules\amplify-codegen\src\commands\generateStatementsAndType.js:27:9),     at <anonymous>,     at process._tickDomainCallback (internal/process/next_tick.js:228:7)]

发生这种情况的原因是什么?

【问题讨论】:

    标签: amazon-web-services aws-appsync aws-amplify


    【解决方案1】:

    当我试图将我的项目从一台计算机移动到另一台计算机时,我遇到了类似的问题。

    起初我以为是内存错误,因为它是在生成过程中出错。

    为我解决错误的方法是安装 GraphQL 包。

    原来使用 npm 安装 amplify 包时,它会显示 graphql 的要求,但如果你使用 yarn 代替它则不会。

    【讨论】:

      猜你喜欢
      • 2019-02-05
      • 2020-03-11
      • 2020-02-15
      • 1970-01-01
      • 2020-06-01
      • 2019-12-29
      • 2019-09-19
      • 2018-10-08
      • 2019-01-26
      相关资源
      最近更新 更多