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
933 stars 217 forks source link

Fix: ensure that status codes are checked in any case #63

Open ThomasObenaus opened 3 years ago

ThomasObenaus commented 3 years ago

If this check is missing then responses from the server with the graphql end-point that are not compliant to the graphql spec will be just ignored (not treated as an error). One reason for this behavior of the server could be (e.g. springboot) that the request is already rejected before it reaches the graphql end-point due to missing authorization. In this case the security filter that does not know about graphql responds with an error that is not compliant to the GQL spec. The same situation would be in case of a 404, 403 etc.

smettu1 commented 2 years ago

This fix will really help, wasted a lot of time on this one. https://github.com/machinebox/graphql/issues/72