From f94d254f7a66437708395ab0258d19967bcc0ba5 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Mon, 27 Jun 2022 15:17:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BD=20Use=20.formatted=20instead=20of?= =?UTF-8?q?=20format=5Ferror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- graphene_django/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/graphene_django/views.py b/graphene_django/views.py index c23b020..f533f70 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -11,7 +11,6 @@ from django.views.decorators.csrf import ensure_csrf_cookie from django.views.generic import View from graphql import OperationType, get_operation_ast, parse, validate from graphql.error import GraphQLError -from graphql.error import format_error as format_graphql_error from graphql.execution import ExecutionResult from graphene import Schema @@ -387,7 +386,7 @@ class GraphQLView(View): @staticmethod def format_error(error): if isinstance(error, GraphQLError): - return format_graphql_error(error) + return error.formatted return {"message": str(error)}