graphql-client
graphql-client copied to clipboard
introspect-schema does not work with header
As per the documentation:
graphql-client introspect-schema --help
graphql-client-introspect-schema 0.9.0
Get the schema from a live GraphQL API. The schema is printed to stdout
USAGE:
graphql-client introspect-schema [OPTIONS] <schema-location>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--authorization <authorization> Set the contents of the Authorizaiton header
--header <headers>... Specify custom headers. --header 'X-Name: Value'
--output <output> Where to write the JSON for the introspected schema
ARGS:
<schema-location> The URL of a GraphQL endpoint to introspect
I understand this should work:
> graphql-client introspect-schema --header 'HeaderName: HeaderValue' 'https://foo.bar/graphql.json'
But it doesn't:
error: The following required arguments were not provided:
<schema-location>
USAGE:
graphql-client introspect-schema <schema-location> --header <headers>...
For more information try --help
What happens ?
We might be able to change this, but at the moment <schema-location>
has to be the first argument to introspect-schema (as displayed in the USAGE
section).
To take your example, this should work:
> graphql-client introspect-schema 'https://foo.bar/graphql.json' --header 'HeaderName: HeaderValue'
Hmmm this seems to work (thanks a lot!), but that is clearly not what I understand from the USAGE
section:
graphql-client introspect-schema [OPTIONS] <schema-location>
with [OPTIONS]
as a placeholder for the
OPTIONS:
--authorization <authorization> Set the contents of the Authorizaiton header
--header <headers>... Specify custom headers. --header 'X-Name: Value'
--output <output> Where to write the JSON for the introspected schema
clearly specifies the OPTIONS
should be written before and not after <schema-location>
.
Besides, this seems to not apply for --output
, which works fine when written before the <schema-location>
.
(Btw, unrelated, there's a typo in the doc: Authorizaiton
).