diff --git a/errors.go b/errors.go index 7314217..c1d8c29 100644 --- a/errors.go +++ b/errors.go @@ -24,8 +24,9 @@ func (e *ResponseError) Unwrap() error { return e.Err } // ServerError indicates that the server returned a response but it was not what // we consider a successful one. type ServerError struct { - Body []byte - Status string + Body []byte + Status string + StatusCode int } func (e *ServerError) Error() string { diff --git a/graphql.go b/graphql.go index f426ade..4efb6db 100644 --- a/graphql.go +++ b/graphql.go @@ -97,8 +97,9 @@ func (c *Client) do(ctx context.Context, op operationType, v interface{}, variab if resp.StatusCode != http.StatusOK { return &ServerError{ - Body: body, - Status: resp.Status, + Body: body, + Status: resp.Status, + StatusCode: resp.StatusCode, } }