graphql-upload
Advanced tools
Changelog
17.0.0
Updated Node.js support to ^18.18.0 || ^20.9.0 || >=22.0.0
.
Updated dev dependencies, some of which require newer Node.js versions than previously supported.
Use the TypeScript v5.5+ JSDoc tag @import
to import types in modules.
Removed JSDoc tag @typedef
that were unintentionally re-exporting types; to migrate import TypeScript types from the correct module:
- import type { GraphQLUpload } from "graphql-upload/Upload.mjs";
+ import type GraphQLUpload from "graphql-upload/GraphQLUpload.mjs";
- import type { processRequest } from "graphql-upload/Upload.mjs";
+ import type processRequest from "graphql-upload/processRequest.mjs";
- import type { GraphQLUpload } from "graphql-upload/processRequest.mjs";
+ import type GraphQLUpload from "graphql-upload/GraphQLUpload.mjs";
Refactored tests to use the standard AbortController
, fetch
, File
, and FormData
APIs available in modern Node.js and removed the dev dependencies node-abort-controller
and node-fetch
.
Replaced the test utility function streamToString
with the function text
from node:stream/consumers
that’s available in modern Node.js.
Use the Node.js test runner API and remove the dev dependency test-director
.
@types/express
to 4.0.29 - 5
and the dev dependency express
to v5, via #389.package.json
field repository
to conform to new npm requirements.npm run
with node --run
.npm run
with node --run
.actions/checkout
to v4.actions/setup-node
to v4.eslint-plugin-jsdoc
and revised types.--unhandled-rejections=throw
in the package script tests
as it’s now the default for all supported Node.js versions.FileUploadCreateReadStreamOptions
property highWaterMark
description and use the function getDefaultHighWaterMark
from node:stream
in tests.Deferred
with polyfilled Promise.withResolvers
.await
in tests.processRequest
.FileUploadCreateReadStreamOptions
in the module processRequest.mjs
.return
in the middleware.async-listen
to replace the test utility function listen
.noUnusedLocals
and noUnusedParameters
and used the prefix _
for purposefully unused function parameters in tests.Changelog
16.0.2
node:
URL scheme for Node.js builtin module imports.GraphQLUpload.mjs
.Changelog
16.0.0
Updated the fs-capacitor
dependency to v8, fixing #318.
The type FileUploadCreateReadStreamOptions
from the processRequest.mjs
module now uses types from fs-capacitor
that are slightly more specific.
The API is now ESM in .mjs
files instead of CJS in .js
files, accessible via import
but not require
. To migrate imports:
- import GraphQLUpload from "graphql-upload/GraphQLUpload.js";
+ import GraphQLUpload from "graphql-upload/GraphQLUpload.mjs";
- import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.js";
+ import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.mjs";
- import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.js";
+ import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.mjs";
- import processRequest from "graphql-upload/processRequest.js";
+ import processRequest from "graphql-upload/processRequest.mjs";
- import Upload from "graphql-upload/Upload.js";
+ import Upload from "graphql-upload/Upload.mjs";
Changelog
15.0.2
ctx
parameter for the Koa middleware created by the function graphqlUploadKoa
, from import("koa").Context
to import("koa").ParameterizedContext
.Changelog
15.0.0
busboy
dependency to v1, fixing #311.
processRequest
and the middleware graphqlUploadExpress
and graphqlUploadKoa
the option maxFileSize
is actually 1 byte less than the amount specified.typescript
dev dependency.processRequest
use the on
method instead of once
to listen for error
events on the busboy
parser, as in edge cases the same parser could have multiple error
events and all must be handled to prevent the Node.js process exiting with an error.processRequest
.processRequest
with a maliciously malformed multipart request.Changelog
14.0.0
Updated Node.js support to ^14.17.0 || ^16.0.0 || >= 18.0.0
.
Updated the graphql
peer dependency to ^16.3.0
.
Updated the http-errors
dependency to v2.
Public modules are now individually listed in the package files
and exports
fields.
Removed the package main index module; deep imports must be used. To migrate imports:
- import { GraphQLUpload } from "graphql-upload";
+ import GraphQLUpload from "graphql-upload/GraphQLUpload.js";
- import { graphqlUploadExpress } from "graphql-upload";
+ import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.js";
- import { graphqlUploadKoa } from "graphql-upload";
+ import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.js";
- import { processRequest } from "graphql-upload";
+ import processRequest from "graphql-upload/processRequest.js";
- import { Upload } from "graphql-upload";
+ import Upload from "graphql-upload/Upload.js";
Shortened public module deep import paths, removing the /public/
. To migrate imports:
- import GraphQLUpload from "graphql-upload/public/GraphQLUpload.js";
+ import GraphQLUpload from "graphql-upload/GraphQLUpload.js";
- import graphqlUploadExpress from "graphql-upload/public/graphqlUploadExpress.js";
+ import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.js";
- import graphqlUploadKoa from "graphql-upload/public/graphqlUploadKoa.js";
+ import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.js";
- import processRequest from "graphql-upload/public/processRequest.js";
+ import processRequest from "graphql-upload/processRequest.js";
- import Upload from "graphql-upload/public/Upload.js";
+ import Upload from "graphql-upload/Upload.js";
Implemented TypeScript types via JSDoc comments, closing #282.
The GraphQLUpload
scalar no longer uses deprecated GraphQLError
constructor parameters.
types
script.jsdoc-md
dev dependency and the related package scripts, replacing the readme “API” section with a manually written “Exports” section.hard-rejection
dev dependency. Instead, tests are run with the Node.js CLI flag --unhandled-rejections=throw
to make Node.js v14 behave like newer versions.formdata-node
dev dependency. Instead, File
and FormData
are imported from node-fetch
.actions/checkout
to v3.actions/setup-node
to v3..js
file extension in require
paths.Readable
property readableEncoding
instead of _readableState.encoding
in tests.substring
instead of the deprecated string method substr
in tests.license.md
MIT License file, closing #86.Changelog
13.0.0
^12.22.0 || ^14.17.0 || >= 16.0.0
../package
from the package exports
field; the full package.json
filename must be used in a require
path.graphql
peer dependency to 0.13.1 - 16
.processRequest
function with a GraphQL multipart request that has no files.processRequest
function with an unparsable multipart request.form-data
dev dependency with formdata-node
, formdata-node
, and node-abort-controller
and refactored tests to align with web standards.processRequest
function to remove the isobject
dependency.processRequest
function, via #273:
Upload
scalar value createReadStream
method:
error
event when the multipart request is aborted certain ways while the file is uploading.error
event details for multipart request file field parse errors.singleQuote
to the default, false
.Changelog
12.0.0
^12.20 || >= 14.13
..mjs
files instead of CJS in .js
files.package.json
exports
field public subpath folder mapping (deprecated by Node.js) with a subpath pattern. Deep require
paths must now include the .js
file extension.sideEffects
field.actions/checkout
to v2.actions/setup-node
to v2.npm install-test
command.CI
environment variable as it’s set by default.npm-debug.log
from the .gitignore
file as npm v4.2.0+ doesn’t create it in the current working directory.keywords
field.main
field path.jsdoc-md
v10 automatically generates a Prettier formatted readme.test:jsdoc
script that checks the readme API docs are up to date with the source JSDoc.GraphQLUpload
code example to use @graphql-tools/schema
instead of graphql-tools
.apollo-upload-server
.