mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
Return 400 status code if result has any error
All exceptions in `graphql.execution.executor.resolve_or_error` will be returned as `GraphQLLocatedError` element on `errors` attribute.
This commit is contained in:
parent
5d6c7f2dc3
commit
1f2d732775
|
@ -154,7 +154,7 @@ class GraphQLView(View):
|
||||||
if execution_result.errors:
|
if execution_result.errors:
|
||||||
response['errors'] = [self.format_error(e) for e in execution_result.errors]
|
response['errors'] = [self.format_error(e) for e in execution_result.errors]
|
||||||
|
|
||||||
if execution_result.invalid:
|
if execution_result.invalid or execution_result.errors:
|
||||||
status_code = 400
|
status_code = 400
|
||||||
else:
|
else:
|
||||||
response['data'] = execution_result.data
|
response['data'] = execution_result.data
|
||||||
|
|
Loading…
Reference in New Issue
Block a user