helios1138 / graphql-typed-client

A tool that generates a strongly typed client library for any GraphQL endpoint. The client allows writing GraphQL queries as plain JS objects (with type safety, awesome code completion experience, custom scalar type mapping, type guards and more)
MIT License
212 stars 18 forks source link

Headers cli flag #30

Open bconnorwhite opened 4 years ago

bconnorwhite commented 4 years ago

Added option to set headers through cli tool

zhigang1992 commented 4 years ago

Can you add doc to readme? also would it be better to do -h 'Authorization: Bear abcd' instead. Better for commandline.

bconnorwhite commented 4 years ago

I forgot you can use the same flag multiple times with commander, I've adjusted this now to stack multiple headers: ... -H 'Authorization: Bearer abcd' -H 'Another: header'

Also added the header option to the README. I left the short flag as -H instead of -h though to avoid a collision with the -h help flag, but feel free to change this

zhigang1992 commented 4 years ago

@helios1138 plz take a look. 😄