Open andig opened 3 years ago
how do I provide my own request factory?
I've kept it simple. After creating the client you would simply replace client.RequestFactory
with a custom func(method, url string, body io.Reader) (*http.Request, error)
.
Ping @dmitshur
This PR allows customizing the requests sent for APIs that require additional headers.
Replace #47, #48, #49, https://github.com/shurcooL/graphql/pull/64, #68.
This is not the most beautiful solution but offers the highest amount of customizing the request with the least amount of added lines of code. Making the request factory a private member and optional
NewClient
parameter would be a further option./cc @dmitshur