Skip to content

Commit

Permalink
Fixed file stream deprecation warning
Browse files Browse the repository at this point in the history
Fixes this warning: DeprecationWarning: File upload property ‘stream’ is deprecated. Use ‘createReadStream()’ instead.
See apollographql/apollo-server#2105 (comment)
  • Loading branch information
Vultraz committed Oct 24, 2019
1 parent 87d0cd6 commit 13889e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/fields/src/types/File/Implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export class File extends Implementation {
return null;
}

const { stream, filename: originalFilename, mimetype, encoding } = await uploadData;
const { createReadStream, filename: originalFilename, mimetype, encoding } = await uploadData;
const stream = createReadStream();

if (!stream && previousData) {
// TODO: FIXME: Handle when stream is null. Can happen when:
Expand Down

0 comments on commit 13889e9

Please sign in to comment.