0

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

maxweld
  • 229
  • 2
  • 15

1 Answers1

2

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
Abdullah Saleem
  • 3,701
  • 1
  • 19
  • 30
  • Thanks - that moved it on. Now have a new problem, but probably best to raise it as a separate issue. It seems that there are multiple versions of the graphql libraries. Ho Hum. But thanks again – maxweld Oct 31 '21 at 10:23
  • 1
    Deleted package-lock.json and npm_modules, and then ran npm install Seems to have resolved the graphql version issue. I now have a schema - thanks. – maxweld Oct 31 '21 at 10:43