A popular approach for handling file uploads when using Apollo Client is to utilize the Apollo Upload Client Middleware that will POST a multi-part form upload, along with the GraphQL query. In this scenario, the query lives in a different part of the POST body than as generally expected by graphene-django's GraphQLView class.
The body includes notions of operations and a map that correlates data to each individual operation, as defined by the multipart form upload spec for GraphQL.
It seems as though the problem here lies in the get_graphql_params static method, which is unable to extract GraphQL parameters from the request it received. I spent about a half hour seeing if I could sort this out, but wasn't able to square it away.
I would recommend adding functionality that detects when the body is consistent with this spec, and to add appropriate parsing capability.
At this point, my workaround is to skip using Apollo Client all together for file uploads, and to post a multi-part form upload query with a GraphQL body. This works, but it seems to be inconsistent with the spec, and it's not really as tightly integrated as I would like.
I was able to solve this with
https://github.com/lmcgartland/graphene-file-upload
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I was able to solve this with
https://github.com/lmcgartland/graphene-file-upload