From ad87a004387828ea926a3543d526dd0d54268864 Mon Sep 17 00:00:00 2001 From: shukryzablah <28762146+shukryzablah@users.noreply.github.com> Date: Tue, 14 Mar 2023 18:14:14 -0400 Subject: [PATCH] Remove redundant call to validate The call to `validate` in the django view is redundant with the validation call in graphql-core. --- graphene_django/views.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/graphene_django/views.py b/graphene_django/views.py index 4d68b13..bb628bd 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -9,7 +9,7 @@ from django.shortcuts import render from django.utils.decorators import method_decorator 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 import OperationType, get_operation_ast, parse from graphql.error import GraphQLError from graphql.execution import ExecutionResult @@ -303,11 +303,7 @@ class GraphQLView(View): ), ) ) - - validation_errors = validate(self.schema.graphql_schema, document) - if validation_errors: - return ExecutionResult(data=None, errors=validation_errors) - + try: extra_options = {} if self.execution_context_class: