UNPKG

graphql-upload-ts

Version:

TypeScript-first middleware and Upload scalar for GraphQL multipart requests (file uploads) with support for Apollo Server, Express, Koa, and more.

13 lines (10 loc) 284 B
import type { Readable } from 'node:stream'; /** * Safely ignores a Node.js readable stream. */ export function ignoreStream(stream: Readable) { // Prevent an unhandled error from crashing the process. stream.on('error', () => {}); // Waste the stream. stream.resume(); }