如何下载 GraphQL 架构?

How to download a GraphQL schema?

我是 运行 从我的 Hasura 端点获取架构的 Apollo CLI 命令。

apollo schema:download --header 'X-Hasura-Admin-Secret: <my secret>' --endpoint https://sample-backend-for-hasura-tutorial.hasura.app/v1/graphql schema.json

它失败了

  √ Loading Apollo Project
  × Saving schema to schema.json
    → TypeError:  is not a legal HTTP header name
    Error: TypeError:  is not a legal HTTP header name

我尝试了各种不同的咒语,但都return同样的错误。

如有任何想法,我们将不胜感激。 :-)

我最好的猜测是用双引号替换 ' 使用像

这样的东西
apollo schema:download --header="X-Hasura-Admin-Secret: <my secret>" --endpoint https://sample-backend-for-hasura-tutorial.hasura.app/v1/graphql schema.json