-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Upload fails with DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead. #2105
Comments
Could you please provide a small, runnable reproduction of your particular problem? (CodeSandbox is great for this). Or at the very least, an example of one of your resolvers? Basically: This warning message should be just that: a warning. According to the both the issue you linked (#2054 (review)) and the official CHANGELOG for |
This is working as intended; @optunetobi please migrate to the new API in your mutation resolvers: - const { stream, filename, mimetype } = await upload
+ const { createReadStream, filename, mimetype } = await upload
+ const stream = createReadStream() If you don't, it will still work for now but you will see this deprecation warning: As @abernix pointed out, this API change happened in |
@abernix thank you for your feedback and explanation. Unfortunately it broke my resolver code in my case, or I was misattributing this warning as an error as I passed the stream to another cloud-storage uploader, which then failed without error to console (I may have forgotten a catch). @jaydenseric thank you for the detailed explanation, I could fix it now. (with your provided diff) |
Fixes this warning: DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead. See apollographql/apollo-server#2105 (comment)
Fixes this warning: DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead. See apollographql/apollo-server#2105 (comment)
Fixes this warning: DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead. See apollographql/apollo-server#2105 (comment)
Fixes this warning: DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead. See apollographql/apollo-server#2105 (comment)
Fixes this warning: DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead. See apollographql/apollo-server#2105 (comment)
Fixes this warning: DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead. See apollographql/apollo-server#2105 (comment)
Using node 8.11.4 with [email protected]:
It seems that this was due to changes since [email protected], as the version before worked without an Error.
Assuming the breaking change was only intended for node versions before 8.5, then my report means that 8.11.4 is affected by this probably. #2054
(Update: my bad, 8.11.4 is good 👍 )
The text was updated successfully, but these errors were encountered: