aiohttp-graphql
aiohttp-graphql copied to clipboard
Fix for parse body when sending files with multipart
Recently I tried to send files with multipart and came across the issue where graphql told me that I'm sending an empty query. I am using apollo-upload-client to send files and I saw that it's indeed sends the query with all necessary parameters, but graph couldn't parse it correctly. The reason is that this client send the query in the key 'operations' where value is json. I don't know if they changed it recently, but since it's official client for uploading files with graphql, I think this should be fixed. I would like to write a tests for it as well, but I think they are kinda broken, at least I couldn't make them run. Hope to hear from you, thanks for a great library.
It would be nice if this was merged. For Flask usage one of my current projects uses https://github.com/lmcgartland/graphene-file-upload perhaps it could be useful for comparing implementations ? Definitely better to have this part of this package and not an extension of an extension.
@wumpus I don't think that this will be merged no matter the implementation. However, we've been using my fork for some internal project at my company. There is a bug for when you uploading big files. It's not crucial for our use case but if you consider using my fork, I can definitely fix it.
graphene-file-upload extends Flask+graphl, perhaps you could study how it works and then release this code as a separate project?
I'd use this code for uploading images and short videos, is that big enough to be buggy with your code? Ought to be relatively easy to fix if it is easy to trigger the bug in testing.