简体   繁体   中英

How to download a GraphQL schema?

I am running an Apollo CLI command to obtain the schema from my Hasura endpoint.

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

It fails with

  √ 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

I have tried various variations of the incantation, but all return the same error.

Any ideas would be greatly appreciated. :-)

我最好的猜测是用双引号替换'使用类似的东西

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM