graphql: parse response JSON once on error

This commit is contained in:
Simon Ser 2023-03-14 15:33:58 +00:00 committed by Drew DeVault
parent 599f3fe477
commit b9e55a0a22
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ class GraphQLOperation:
resp = r.json()
if r.status_code != 200 or "errors" in resp:
if valid is None:
raise GraphQLError(r.json())
raise GraphQLError(resp)
else:
_copy_errors(valid, resp)
return resp.get("data")