Skip to content

Commit

Permalink
Fix graphiql refreshing operationName undefined
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
khankuan authored Apr 13, 2017
1 parent eb02f87 commit 8eb881e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions graphene_django/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ def get_graphql_params(request, data):
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

Expand Down

0 comments on commit 8eb881e

Please sign in to comment.