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.

23 lines (20 loc) 490 B
'use strict'; class Upload { constructor() { this.promise = new Promise((resolve, reject) => { this._resolve = resolve; this._reject = reject; }); // Prevent unhandled promise rejection errors this.promise.catch(() => { }); } resolve(file) { this.file = file; this._resolve(file); } reject(error) { this._reject(error); } } exports.Upload = Upload; //# sourceMappingURL=upload.js.map