graphql: set GraphQLError.data
Even if errors occured, the server may return data. Store that data in GraphQLError.data so that callers can easily access it.
This commit is contained in:
parent
b9e55a0a22
commit
ea11cd45d0
|
@ -11,6 +11,7 @@ class GraphQLError(Exception):
|
|||
def __init__(self, body):
|
||||
self.body = body
|
||||
self.errors = body["errors"]
|
||||
self.data = body.get("data")
|
||||
|
||||
def exec_gql(site, query, user=None, client_id=None, valid=None, **variables):
|
||||
op = GraphQLOperation(query)
|
||||
|
|
Loading…
Reference in New Issue