mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 19:32:33 +03:00
Ignore the non-standard result.invalid flag
This commit is contained in:
parent
34936092ca
commit
0d9ba1c0d9
|
@ -8,20 +8,15 @@ from graphene.types.schema import Schema
|
||||||
def default_format_error(error):
|
def default_format_error(error):
|
||||||
if isinstance(error, GraphQLError):
|
if isinstance(error, GraphQLError):
|
||||||
return format_graphql_error(error)
|
return format_graphql_error(error)
|
||||||
|
|
||||||
return {"message": str(error)}
|
return {"message": str(error)}
|
||||||
|
|
||||||
|
|
||||||
def format_execution_result(execution_result, format_error):
|
def format_execution_result(execution_result, format_error):
|
||||||
if execution_result:
|
if execution_result:
|
||||||
response = {}
|
response = {}
|
||||||
|
|
||||||
if execution_result.errors:
|
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
|
response["data"] = execution_result.data
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user