Skip to content

Commit 8eb881e

Browse files
authored
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.
1 parent eb02f87 commit 8eb881e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

graphene_django/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ def get_graphql_params(request, data):
282282
raise HttpError(HttpResponseBadRequest('Variables are invalid JSON.'))
283283

284284
operation_name = request.GET.get('operationName') or data.get('operationName')
285+
if operation_name == "null":
286+
operation_name = None
285287

286288
return query, variables, operation_name, id
287289

0 commit comments

Comments
 (0)