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:
Simon Ser 2023-03-14 15:34:01 +00:00 committed by Drew DeVault
parent b9e55a0a22
commit ea11cd45d0
1 changed files with 1 additions and 0 deletions

View File

@ -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)