UNPKG

graphql-upload

Version:

Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.

17 lines (14 loc) 364 B
'use strict'; /** * Safely ignores a Node.js readable stream. * @kind function * @name ignoreStream * @param {ReadableStream} stream Node.js readable stream. * @ignore */ module.exports = function ignoreStream(stream) { // Prevent an unhandled error from crashing the process. stream.on('error', () => {}); // Waste the stream. stream.resume(); };