prisma-labs / get-graphql-schema

Fetch and print the GraphQL schema from a GraphQL HTTP endpoint. (Can be used for Relay Modern.)
669 stars 62 forks source link

Split headers on colon to support cookies #23

Closed lukehedger closed 4 years ago

lukehedger commented 6 years ago

Adds support for Cookie headers.

So, this example would now work:

get-graphql-schema --header "Cookie: biscuit=123" ENDPOINT_URL > schema.graphql

This previously would not work as the header string was split on = which is found in the actual value of the cookie.

Now the header string is split on :, which is a common convention in other tools.

ThisIsMissEm commented 6 years ago

You may wish to combine this with the basic idea of #18; That is, only match on the first colon in the header, and consume the rest as being the value.