-
Notifications
You must be signed in to change notification settings - Fork 50
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
<InMemoryUploadedFile: logo_Reverse.svg (image/svg+xml)> is not JSON serializable ... but other uploads work fine. #32
Comments
It seems that the error happens in django_graphene .. but its odd. I think it only happens for the in memory file upload. what is odd, is that it only seems to be happening on one of my posts, |
this was the problem
this means that this package is hiding errors. somehow |
hi, how did you resolve this issue? I'm having same problem, i do have a mutation that is working perfectly fine, and another mutation that throws |
it means that you are not passing an expected input. like in my previous comment shows the actual error is hidden by graphene-file-uploadin my instance i was missing the position
|
@japrogramer Thanks for the info, yes it seems there is a totally unrelated error in the input data, just wasted 3 hours on this. For future reference to new users, i was able to pinpoint the error by removing arguments one by one and find a combination when it works so i can inspect which argument was causing the error. |
@japrogramer , @ungaro It will be a great help if you can solve this, I'm getting the error Object of type "VersatileImageFieldFile is not JSON serializable" while trying to upload image but after that when I query back it shows the uploaded content how to pass the error 500 internal server error |
@Thousif-S I would do following to resolve this issue: 1-Remove the VersatileImageFieldFile from your Mutation. Test it from the graphql view with arguments. Does it work now? Unfortunately graphene-file-upload hides the real error, so that makes you think that it's related to graphene-file-upload, but in the end it was another error that i was not aware of. In my case it was related to another field expecting different type of argument. |
@ungaro Thanks for your swift reply , After making a bunch of tries It worked out, still can't figure out what went wrong though. |
as mentioned by @japrogramer there is an obscured error underneath, a field that is failing validation against its defined type. Graphql is trying to serializer the input from the client (so as to display the first validation error) which happens to include an uploaded file, which is not json serializable. |
I have made file uploads before, and they work.
However here i must have found a bug in graphene-file-upload.
The text was updated successfully, but these errors were encountered: