maxweld
maxweld

Reputation: 239

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. :-)

Upvotes: 0

Views: 3381

Answers (1)

Abdullah Saleem
Abdullah Saleem

Reputation: 3811

My best guess would be to replace ' with double quotations use something like

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

Upvotes: 2

Related Questions