A minimalistic middleware and Upload scalar for handling GraphQL multipart file uploads (queries/mutations) in Node.js servers (Express, Koa, etc.). v1.6.4 (latest) supports Node ≥12 and GraphQL 0.13.1–16. Ships TypeScript types. Forked from graphql-upload with a single production dependency (busboy), no disk I/O, no temporary files, and simpler developer-friendly error messages. Does not follow strict multipart spec (no duplicate file references). Drop-in replacement for graphql-upload with minor API differences (e.g., createReadStream() must be called once with no arguments).
npm install graphql-upload-minimalNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up Express + Apollo Server with graphql-upload-minimal middleware, defines a Upload scalar and a singleUpload mutation.
Ensure createReadStream() is called exactly once; store the stream if needed elsewhere.
Call createReadStream() with no arguments.
Do not reuse the same file variable in multiple places in one query/mutation.
Replace graphql-upload with graphql-upload-minimal in package.json and update imports.
Place app.use(graphqlUploadExpress()) before app.use('/graphql', ...).Use const { createReadStream } = await file; instead of const { createReadStream } = file;Add scalar Upload to typeDefs and include Upload in your resolvers object (e.g., resolvers: { Upload, Query: ..., Mutation: ... })Call it as a function: app.use(graphqlUploadExpress()) not new graphqlUploadExpress().