graphql icon indicating copy to clipboard operation
graphql copied to clipboard

feat: add `WithHeader` & `WithCookie`

Open Laisky opened this issue 5 years ago • 6 comments
trafficstars

can set http client's headers and cookies

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

fully backwards-compatible.

Laisky avatar Dec 11 '19 12:12 Laisky

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

IamFlowZ avatar Jan 31 '20 17:01 IamFlowZ

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

https://github.com/Laisky/graphql

Laisky avatar Feb 01 '20 07:02 Laisky

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

StevenACoffman avatar Dec 02 '20 17:12 StevenACoffman

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

andig avatar Jul 25 '21 16:07 andig

When is this going to be merged?

khwerhahn avatar Sep 27 '21 21:09 khwerhahn

will this be merged ?

jaskirat8 avatar May 23 '22 07:05 jaskirat8