Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Catch graphql syntax errors
Unknowna72973e58416
diff --git a/saleor/graphql/views.py b/saleor/graphql/views.pyindex 94eac6823d..6dc710d0f3 100644--- a/saleor/graphql/views.py+++ b/saleor/graphql/views.py@@ -7,7 +7,8 @@ from django.views.generic import Viewfrom graphene_django.settings import graphene_settingsfrom graphene_django.views import instantiate_middlewarefrom graphql import get_default_backend-from graphql.error import GraphQLError, format_error as format_graphql_error+from graphql.error import (+ GraphQLError, GraphQLSyntaxError, format_error as format_graphql_error)from graphql.execution import ExecutionResult@@ -116,7 +117,7 @@ class GraphQLView(View):invalid=True)try:document = self.backend.document_from_string(self.schema, query)- except ValueError as e:+ except (ValueError, GraphQLSyntaxError) as e:return ExecutionResult(errors=[e], invalid=True)extra_options = {}if self.executor: