mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-08 23:50:38 +03:00
Fixed lint in graphene.test
This commit is contained in:
parent
6c2b940a03
commit
c41b183fad
|
@ -18,7 +18,9 @@ def format_execution_result(execution_result, format_error):
|
|||
response = {}
|
||||
|
||||
if execution_result.errors:
|
||||
response['errors'] = [format_error(e) for e in execution_result.errors]
|
||||
response['errors'] = [
|
||||
format_error(e) for e in execution_result.errors
|
||||
]
|
||||
|
||||
if not execution_result.invalid:
|
||||
response['data'] = execution_result.data
|
||||
|
@ -32,16 +34,14 @@ class Client(object):
|
|||
self.schema = schema
|
||||
self.execute_options = execute_options
|
||||
self.format_error = format_error or default_format_error
|
||||
|
||||
|
||||
def format_result(self, result):
|
||||
return format_execution_result(
|
||||
result,
|
||||
self.format_error
|
||||
)
|
||||
return format_execution_result(result, self.format_error)
|
||||
|
||||
def execute(self, *args, **kwargs):
|
||||
executed = self.schema.execute(*args, **dict(self.execute_options, **kwargs))
|
||||
executed = self.schema.execute(*args,
|
||||
**dict(self.execute_options, **kwargs))
|
||||
if is_thenable(executed):
|
||||
return Promise.resolve(executed).then(self.format_result)
|
||||
|
||||
|
||||
return self.format_result(executed)
|
||||
|
|
Loading…
Reference in New Issue
Block a user