Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to decode unicode payloads #10

Closed
varuna82 opened this issue Sep 8, 2016 · 2 comments
Closed

Fail to decode unicode payloads #10

varuna82 opened this issue Sep 8, 2016 · 2 comments

Comments

@varuna82
Copy link
Contributor

varuna82 commented Sep 8, 2016

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'))

@varuna82
Copy link
Contributor Author

varuna82 commented Sep 8, 2016

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

@Martin456
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants