yezyilomo / django-restql

Turn your API made with Django REST Framework(DRF) into a GraphQL like API.
https://yezyilomo.github.io/django-restql
MIT License
621 stars 43 forks source link

When I deploy django-restql on AWS lambda, "?query={}" results into HTTP 400 error. #279

Open RadySonabu opened 3 years ago

yezyilomo commented 3 years ago

HTTP 400 is usually associated with an error message, would be helpful to see one otherwise it would be hard to know what’s really wrong, I’ve never used lambda before but I don’t think if that has anything to do with your error.

RadySonabu commented 3 years ago

HTTP 400 is usually associated with an error message, would be helpful to see one otherwise it would be hard to know what’s really wrong, I’ve never used lambda before but I don’t think if that has anything to do with your error.

https://wqaside363.execute-api.us-west-2.amazonaws.com/dev/api/my-user/?query={id} this results to HTTP 400 but while using this on a localhost it works well.

yezyilomo commented 3 years ago

The link you sent works just fine to me, it returns only user IDs..

RadySonabu commented 3 years ago

If it's a link, it will work but if you copy and paste the link, it won't work.

https://wqaside363.execute-api.us-west-2.amazonaws.com/dev/api/my-user/?query={id,username} if you copy this directly, it won't work.

yezyilomo commented 3 years ago

If it's a link, it will work but if you copy and paste the link, it won't work.

https://wqaside363.execute-api.us-west-2.amazonaws.com/dev/api/my-user/?query={id,username} if you copy this directly, it won't work. Below is the error message

The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.

It seems like your server doesn't support encoding of some characters am guessing curly brackets{}, so they need to be encoded before sending the URL to a server.

RadySonabu commented 3 years ago

Thanks @yezyilomo. I'll post it here after I fix it on my end.