From 6bd89f2c78caae00cf8e0fcb9ba3f1b3dfc5fc03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ochman?= Date: Mon, 31 Oct 2016 12:16:58 +0100 Subject: [PATCH] Fix UnboundLocalError occurrences --- graphene_django/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphene_django/views.py b/graphene_django/views.py index b6344de..3a363e7 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -111,6 +111,7 @@ class GraphQLView(View): result, status_code = self.get_response(request, data, show_graphiql) if show_graphiql: + query, variables, operation_name, id = self.get_graphql_params(request, data) return self.render_graphiql( request, graphiql_version=self.graphiql_version, @@ -146,6 +147,7 @@ class GraphQLView(View): show_graphiql ) + status_code = 200 if execution_result: response = {} @@ -155,7 +157,6 @@ class GraphQLView(View): if execution_result.invalid: status_code = 400 else: - status_code = 200 response['data'] = execution_result.data if self.batch: