shurcooL / graphql

Package graphql provides a GraphQL client implementation.
MIT License
709 stars 282 forks source link

feat: add `WithHeader` & `WithCookie` #48

Open Laisky opened 4 years ago

Laisky commented 4 years ago

can set http client's headers and cookies

cli := NewClient(
    "url",
    httpClient,
    graphql.WithCookie("cookieName", "cookieVal"),
    graphql.WithHeader("headerName", "headerVal"),
)

fully backwards-compatible.

IamFlowZ commented 4 years ago

Will this be merged in anytime soon? Would be specifically useful for authorization.

Laisky commented 4 years ago

@IamFlowZ you can try my fork github.com/Laisky/graphql, fully compatible with shurcool/graphql.

https://github.com/Laisky/graphql

StevenACoffman commented 3 years ago

This is a great feature, but I would also prefer it if these were on a new method like NewClientWithOptions or something.

andig commented 3 years ago

Not a 1:1 replacement, but https://github.com/shurcooL/graphql/pull/73 might also enable this use case

khwerhahn commented 3 years ago

When is this going to be merged?

jaskirat8 commented 2 years ago

will this be merged ?