From 8eb881e085f0814ebfc9c4275cd878e72813d3d6 Mon Sep 17 00:00:00 2001 From: Kuan Date: Thu, 13 Apr 2017 10:11:10 -0700 Subject: [PATCH] Fix graphiql refreshing operationName undefined operationName is serialized into the query string as a string. When getting the query value for operationName, we need to convert string "null" into None. --- graphene_django/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphene_django/views.py b/graphene_django/views.py index 4129668..6514ea1 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -282,6 +282,8 @@ class GraphQLView(View): raise HttpError(HttpResponseBadRequest('Variables are invalid JSON.')) operation_name = request.GET.get('operationName') or data.get('operationName') + if operation_name == "null": + operation_name = None return query, variables, operation_name, id