machinebox / graphql

Simple low-level GraphQL HTTP client for Go
https://blog.machinebox.io/a-graphql-client-library-for-go-5bffd0455878
Apache License 2.0
937 stars 218 forks source link

Get the status code in case of error #25

Open bejito opened 5 years ago

bejito commented 5 years ago

Hi ! I can't find a way to get the response status code when an HTTP error is returned. My use case is that I want to check if it is a 401 (in which case I want to renew the client token).

Thanks !

necrophonic commented 5 years ago

I've had the same issue. I believe this should be fixed by #47 once accepted and merged.

saopayne commented 4 years ago

When can we have this in a release, please? https://github.com/machinebox/graphql/blob/3a92531802258604bd12793465c2e28bc4b2fc85/graphql.go#L142

We need this check and it's not available in V2.2. Can master be promoted to a release?