-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Getting empty object instead of file #94
Comments
I don't think you need the body parser at all, |
Oh, sorry I was confused. I think the readme example assumed Apollo, not |
Sorry, this was totally my mistake. I missed that part saying: " the resolver recieves a promise...". So I was missing Thanks :) |
Glad you worked it out! As for passing the file on to an external service using REST, you should be able to use the stream as a multipart form field when using libraries such as |
@jordan-jarolim the stream should be a duplex stream, (it’s actually a writable stream that proxies readable methods/events to a readable stream) so the data event should work... if it doesn’t, it will once #92 lands, since it bumps the version of capacitor to one that uses a real read stream as opposed to a proxy. Note that you can always pipe it to a passthrough stream, and listen on that one. |
@mike-marcacci Well I tried the example using pipe with file output but it behaves little bit nondeterministic. It sometimes produces an empty file of 0B (just simple .txt of 2B originally). I also tried own implementation using 'data' or 'readable' events and I had still the same problem. If I dump a type of the stream using |
Hey @jordan-jarolim thanks for reporting back! What you're describing sounds like a timing issue that was already fixed in Again, once #92 lands, this your |
Hi, I ran into this problem and cannot figure it out. Once I upload file using apollo-upload-client + apollo-upload-server I am getting an empty object {} instead of a file. I went through several issues and everything seems to be set up correctly.
scalar Upload
etc...Here is my server config:
server.use('/graphql', bodyParser.json(), auth, apolloUploadExpress(), graphqlExpress((req, res) => { const context = { user: req.user, req, res, }; return { schema, context, }; }));
Is there any known issue with bodyParser as mentioned in one of referenced issues? Could you point me to any other direction please?
Thanks
The text was updated successfully, but these errors were encountered: