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.

21 lines (19 loc) 470 B
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); } } export { Upload }; //# sourceMappingURL=upload.mjs.map