Closed prajjwaldimri closed 5 years ago
You should be promisifying and awaiting the file upload like in the example:
https://github.com/jaydenseric/apollo-upload-examples/blob/master/api/resolvers.mjs#L21
Give that a go and see if you still have the issue.
Whoa! It worked. But I still don't understand what's going on here. I mean aren't the readableStreams supposed to be read from events? Why are those events outputting null?
What was happening, was the resolver was instantly returning without waiting for the file to finish uploading. When all the resolvers return, the GraphQL server sends a response. What happens if the server responds before the client has finished uploading the request? It disconnects.
Got it. Thanks :+1: :)
You should be promisifying and awaiting the file upload like in the example:
https://github.com/jaydenseric/apollo-upload-examples/blob/master/api/resolvers.mjs#L21
Give that a go and see if you still have the issue.
@jaydenseric this page is not found. Would you update this information please? I has the same problem.
Can someone help to solve the same in python using Django? Thanks in advance!
For some reason, my server is returning an empty stream instead of the file.
Here's the client's request:
On the server
Nothing gets outputted. When I send stream's data as response it returns as null.
Interestingly, filename, mimetype and encoding all are populated.
I am using apollo-server-express as my server.
Here's the schema for the method
Will really appreciate your help on this. Thanks :)