-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please make "constructQuery" exported #78
Comments
I came here to ask for the same thing. I personally just want to get the generated query as a string |
For what it's worth, I was able to use a RoundTripper to read the body of the request to get the query. Not ideal, but it works. type roundTripFunc func(r *http.Request) (*http.Response, error)
func (s roundTripFunc) RoundTrip(r *http.Request) (*http.Response, error) {
return s(r)
} httpClient.Transport = roundTripFunc(func(r *http.Request) (x *http.Response, y error) {
b, _ := io.ReadAll(r.Body)
fmt.Println(string(b))
return
}) |
We use proprietary header for Authorization, so I used RoundTrip as well. |
Hi,
All I need is to use your "constructQuery" for tests. Please make it public.
I got custom types at queries and found that I want to write small assert test to avoid bad constructions.
For example, I converted an input map to custom type:
It gives me the correct query after construction:
query($filter:[codes!]!){classification(filters: $filter)}
But when I use
map[string]string
instead ofcodes
, it transforms to:query($filter:[!]!){classification(filters: $filter)}}
So I need to protect "codes" type name by tests.
The text was updated successfully, but these errors were encountered: