Skip to content

Commit e48598f

Browse files
committed
added check for content-type "application/graphql" in django view
1 parent 2f0bd7c commit e48598f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

graphene/contrib/django/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def post(self, request, *args, **kwargs):
6060
query = received_json_data.get('query')
6161
except ValueError:
6262
return self.response_errors(ValueError("Malformed json body in the post data"))
63+
elif content_type == 'application/graphql':
64+
query = request.body.decode()
6365
else:
6466
query = request.POST.get('query') or request.GET.get('query')
6567
return self.execute_query(request, query or '')

0 commit comments

Comments
 (0)