mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 17:46:57 +03:00
added check for content-type "application/graphql" in django view
This commit is contained in:
parent
2f0bd7cf7c
commit
e48598f4e6
|
@ -60,6 +60,8 @@ class GraphQLView(View):
|
|||
query = received_json_data.get('query')
|
||||
except ValueError:
|
||||
return self.response_errors(ValueError("Malformed json body in the post data"))
|
||||
elif content_type == 'application/graphql':
|
||||
query = request.body.decode()
|
||||
else:
|
||||
query = request.POST.get('query') or request.GET.get('query')
|
||||
return self.execute_query(request, query or '')
|
||||
|
|
Loading…
Reference in New Issue
Block a user