graphql-python / flask-graphql

Adds GraphQL support to your Flask application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail to decode unicode payloads

varuna82 opened this issue · comments

GraphQL requests that contain unicode characters fails with the error message 'POST body sent invalid JSON.'

I was able to fix it by adding utf-8 parameter to decode method .

graphqlview.py L132:
request_json = json.loads(request.data.decode('utf-8'))

This is already fixed in master branch of the git repo. However pip seem to have an older version yet.

Hello guys,
I playing with GraphQL and I received this exception AttributeError str' object has no attribute 'decode' with python 3.
I'd like to propose distinction between 'str' and 'unicode' in GraphQLView class function parse_body()