From 0454d080aa46bd8284b3fbbeed6561e40ef49955 Mon Sep 17 00:00:00 2001 From: danthewildcat Date: Sun, 29 Oct 2023 11:42:27 -0400 Subject: [PATCH] Optimize views (#1439) * Optimize execute_graphql_request * Require operation_ast to be found by view handler * Remove unused show_graphiql kwarg * Old style if syntax * Revert "Remove unused show_graphiql kwarg" This reverts commit 33b3426092a2c6ceea35026276087f9c203e53ab. * Add missing schema validation step * Pass args directly to improve clarity * Remove duplicated operation_ast not None check --------- Co-authored-by: Firas Kafri <3097061+firaskafri@users.noreply.github.com> Co-authored-by: Kien Dang --- graphene_django/views.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/graphene_django/views.py b/graphene_django/views.py index 1ec65988..3897e9d4 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -336,12 +336,7 @@ def execute_graphql_request( ) ) - validation_errors = validate( - schema, - document, - self.validation_rules, - graphene_settings.MAX_VALIDATION_ERRORS, - ) + validation_errors = validate(schema, document) if validation_errors: return ExecutionResult(data=None, errors=validation_errors)