Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide headers with sendIntrospectionQuery #21

Merged
merged 4 commits into from
Feb 7, 2018

Conversation

MarcelCutts
Copy link
Contributor

@MarcelCutts MarcelCutts commented Feb 5, 2018

When using sendIntrospectionQuery, a naked request is made.

Apollo-Codegen's version of this tool allows your to specify headers. This is a super useful when trying to grab the schema of GraphQL services that may live on the web and require authorisation - e.g. github's GraphQL endpoint.

This update allows you to pass multiple headers to sendIntrospectionQuery with the -H or ---headers flag.

It also adds a bit of guidance and help to the program, making it a bit easier on the user.

❯ node sendIntrospectionQuery.js --help
Usage: sendIntrospectionQuery.js <url>  [--headers "key:value"]

Commands:
  sendIntrospectionQuery.js url  URL of the GraphQL endpoint

Options:
  --version      Show version number                                   [boolean]
  -H, --headers  Additional Headers to send with introspection query     [array]
  -?, --help     Show help                                             [boolean]

Examples:
  sendIntrospectionQuery.js                 Get GraphQL Schema
  https://example.com/graphql
  sendIntrospectionQuery.js                 Get GraphQL Schema with
  https://example.com/graphql --headers     Authorisation header
  "Authorisation: <token>"

@mhallin
Copy link
Owner

mhallin commented Feb 7, 2018

Hello!

Thank you for this. I will be releasing a new version of this package on the weekend.

@mhallin mhallin merged commit 63f2655 into mhallin:master Feb 7, 2018
ylecornec pushed a commit to o1-labs/graphql_ppx that referenced this pull request Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants