DEV Community

Discussion on: Handling File Uploads with Apollo Server 2.0.

Collapse
 
ankush0694 profile image
Ankush0694

const { filename, mimetype, encoding, createReadStream } = await file;
console.log(filename);

try {
const stream = createReadStream();
console.log(stream);
} catch (error) {
throw error;
}

return { filename, mimetype, encoding };

this code is giving me Error : createReadStream() is not a function