We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I'm trying to fetch the HTTP request-response in order to display custom error messages when an error occurred.
I checked the code, and I found this:
https://github.com/hasura/go-graphql-client/blob/master/graphql.go#L175
if resp.StatusCode != http.StatusOK { body, _ := ioutil.ReadAll(resp.Body) err := newError(ErrRequestError, fmt.Errorf("%v; body: %q", resp.Status, body)) if c.debug { err = err.withRequest(request, reqReader) } return nil, nil, nil, Errors{err} }
It would be possible to have a way to retrieve the response resp so that I can get the response body and the status code?
resp
err := client.Mutate(ctx, m, variables) if err != nil { // TODO: extract the status code and response body // resp := client.GetResponse()) ? }
Thank you.
The text was updated successfully, but these errors were encountered:
It's impossible for now, but I'll add the solution soon.
Sorry, something went wrong.
No branches or pull requests
Hi,
I'm trying to fetch the HTTP request-response in order to display custom error messages when an error occurred.
I checked the code, and I found this:
https://github.com/hasura/go-graphql-client/blob/master/graphql.go#L175
It would be possible to have a way to retrieve the response
resp
so that I can get the response body and the status code?Thank you.
The text was updated successfully, but these errors were encountered: