-
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
, andFormData
APIs available in modern Node.js and removed the dev dependenciesnode-abort-controller
andnode-fetch
. -
Replaced the test utility function
streamToString
with the functiontext
fromnode:stream/consumers
that’s available in modern Node.js. -
Use the Node.js test runner API and remove the dev dependency
test-director
.
- Support Express v5 by updating the optional peer dependency
@types/express
to4.0.29 - 5
and the dev dependencyexpress
to v5, via #389.
- Tweaked the package description.
- Updated the
package.json
fieldrepository
to conform to new npm requirements. - Updated the package scripts:
- Reordered the scripts.
- Replaced
npm run
withnode --run
.
- Updated GitHub Actions CI config:
- No longer run the workflow on pull request.
- Enable manual workflow dispatching.
- Run checks in seperate jobs.
- Removed custom step names.
- Replaced
npm run
withnode --run
. - Updated the tested Node.js versions to v18, v20, v22.
- Updated
actions/checkout
to v4. - Updated
actions/setup-node
to v4.
- Migrated to the ESLint v9 CLI and “flat” config.
- Integrated a new dev dependency
eslint-plugin-jsdoc
and revised types. - Removed the Node.js CLI option
--unhandled-rejections=throw
in the package scripttests
as it’s now the default for all supported Node.js versions. - Avoid hardcoding a default value in the type
FileUploadCreateReadStreamOptions
propertyhighWaterMark
description and use the functiongetDefaultHighWaterMark
fromnode:stream
in tests. - Replaced the test helper class
Deferred
with polyfilledPromise.withResolvers
. - Removed an unnecessary
await
in tests. - Omit unused catch bindings in the function
processRequest
. - Corrected the JSDoc type
FileUploadCreateReadStreamOptions
in the moduleprocessRequest.mjs
. - Avoid using
return
in the middleware. - Added a new dev dependency
async-listen
to replace the test utility functionlisten
. - Enabled the TypeScript compiler options
noUnusedLocals
andnoUnusedParameters
and used the prefix_
for purposefully unused function parameters in tests. - Updated the GitHub Markdown syntax for alerts in the readme.
- Tweaked wording in the readme and JSDoc descriptions.
- Updated dev dependencies.
- Use the
node:
URL scheme for Node.js builtin module imports. - Improved JSDoc in the module
GraphQLUpload.mjs
. - Revamped the readme:
- Removed the badges.
- More detailed installation instructions.
- Added information about TypeScript config and optimal JavaScript module design.
- Support non
latin1
characters in file names by setting thebusboy
optiondefParamCharset
toutf8
, fixing #328. - Removed a redundant
@ts-ignore
comment.
-
Updated the
fs-capacitor
dependency to v8, fixing #318. -
The type
FileUploadCreateReadStreamOptions
from theprocessRequest.mjs
module now uses types fromfs-capacitor
that are slightly more specific. -
The API is now ESM in
.mjs
files instead of CJS in.js
files, accessible viaimport
but notrequire
. 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";
- Updated dev dependencies.
- Updated examples in JSDoc comments.
- Updated the changelog entry for v14.0.0 to show how to migrate imports.
- Updated dev dependencies.
- Corrected the TypeScript type for the Koa context
ctx
parameter for the Koa middleware created by the functiongraphqlUploadKoa
, fromimport("koa").Context
toimport("koa").ParameterizedContext
.
- Don’t import and link types from the middlware modules
graphqlUploadExpress.js
andgraphqlUploadKoa.js
within the moduleprocessRequest.js
, fixing #314.
- Updated the
busboy
dependency to v1, fixing #311.- This important update addresses the vulnerability CVE-2022-24434 (GHSA-wm7h-9275-46v2).
- Some error messages have changed.
- Temporarily until mscdex/busboy#297 is fixed upstream, for the function
processRequest
and the middlewaregraphqlUploadExpress
andgraphqlUploadKoa
the optionmaxFileSize
is actually 1 byte less than the amount specified.
- Updated the
typescript
dev dependency. - In the function
processRequest
use theon
method instead ofonce
to listen forerror
events on thebusboy
parser, as in edge cases the same parser could have multipleerror
events and all must be handled to prevent the Node.js process exiting with an error. - Simplified error handling within the function
processRequest
. - Added a test for the function
processRequest
with a maliciously malformed multipart request.
-
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
andexports
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 deprecatedGraphQLError
constructor parameters.
- Updated dev dependencies.
- Simplified dev dependencies and config for ESLint.
- Check TypeScript types via a new package
types
script. - Removed the
jsdoc-md
dev dependency and the related package scripts, replacing the readme “API” section with a manually written “Exports” section. - Removed the
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. - Removed the
formdata-node
dev dependency. Instead,File
andFormData
are imported fromnode-fetch
. - Updated GitHub Actions CI config:
- Run tests with Node.js v14, v16, v18.
- Updated
actions/checkout
to v3. - Updated
actions/setup-node
to v3.
- Reorganized the test file structure.
- Use the
.js
file extension inrequire
paths. - Use the Node.js
Readable
propertyreadableEncoding
instead of_readableState.encoding
in tests. - Use
substring
instead of the deprecated string methodsubstr
in tests. - Fixed a typo in a code comment.
- Updated documentation.
- Added a
license.md
MIT License file, closing #86.
- Updated Node.js support to
^12.22.0 || ^14.17.0 || >= 16.0.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Removed
./package
from the packageexports
field; the fullpackage.json
filename must be used in arequire
path.
- Updated the
graphql
peer dependency to0.13.1 - 16
. - Updated dependencies.
- Also run GitHub Actions CI with Node.js v17.
- Simplified package scripts.
- Renamed imports in the test index module.
- Test the
processRequest
function with a GraphQL multipart request that has no files. - Test the
processRequest
function with an unparsable multipart request. - Replaced the
form-data
dev dependency withformdata-node
,formdata-node
, andnode-abort-controller
and refactored tests to align with web standards. - Refactored the
processRequest
function to remove theisobject
dependency. - Improved the
processRequest
function, via #273:- Fixed ending requests from being handled incorrectly as aborting in edge cases, closing #272.
- Fixed read streams created via the resolved
Upload
scalar valuecreateReadStream
method:- Not emitting the
error
event when the multipart request is aborted certain ways while the file is uploading. - Emitting incorrect
error
event details for multipart request file field parse errors.
- Not emitting the
- Configured Prettier option
singleQuote
to the default,false
. - Documentation tweaks.
- Updated Node.js support to
^12.20 || >= 14.13
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- The tests are now ESM in
.mjs
files instead of CJS in.js
files. - Replaced the the
package.json
exports
field public subpath folder mapping (deprecated by Node.js) with a subpath pattern. Deeprequire
paths must now include the.js
file extension.
- Added a package
sideEffects
field.
- Updated dependencies.
- Lint fixes for the updated Prettier version.
- Updated GitHub Actions CI config:
- Updated the tested Node.js versions to v12, v14, v16.
- Updated
actions/checkout
to v2. - Updated
actions/setup-node
to v2. - Simplify config with the
npm install-test
command. - Don’t specify the
CI
environment variable as it’s set by default.
- Removed
npm-debug.log
from the.gitignore
file as npm v4.2.0+ doesn’t create it in the current working directory. - Updated the EditorConfig URL.
- Updated the package
keywords
field. - More specific package
main
field path. - Simplified JSDoc related package scripts now that
jsdoc-md
v10 automatically generates a Prettier formatted readme. - Added a package
test:jsdoc
script that checks the readme API docs are up to date with the source JSDoc. - Refactored private constants from exports of a single module to individual modules.
- Fixed test name and comment typos.
- Updated external URLs in docs.
- Prettier format for a JSDoc code example.
- Updated a
GraphQLUpload
code example to use@graphql-tools/schema
instead ofgraphql-tools
. - Removed from the readme the notice that the package was previously published as
apollo-upload-server
. - Simplified the readme “Setup” and “Support” sections.
- Updated Node.js support to
^10.13.0 || ^12.0.0 || >= 13.7.0
. - Added a package
exports
field with conditional exports to support native ESM in Node.js and keep internal code private, whilst avoiding the dual package hazard. Published files have been reorganized, so previously undocumented deep imports will need to be rewritten according to the newly documented paths. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Updated the
graphql
peer dependency to0.13.1 - 15
, fixing #200 via #201. - Updated Prettier related package scripts.
- Configured Prettier option
semi
to the default,true
. - Ensure GitHub Actions run on pull request.
- Also run GitHub Actions with Node.js v14.
- Fixed the
ignoreStream
function tests for Node.js v14 with a newCountReadableStream
test helper, fixing #209. - Minor JSDoc wording tweak for consistency.
- Mention
Promise.allSettled
in the readme “Tips” section. - Updated MDN Web Docs links.
- Updated Node.js support from v8.10+ to v10+, as earlier versions have reached end-of-life.
- Updated the
fs-capacitor
dependency to v6, which now requires Node.js v10+, via #179. - Updated dev dependencies, some of which now require Node.js v10+.
- Replaced the
tap
dev dependency withtest-director
,coverage-node
, andhard-rejection
to improve the dev experience and reduce the dev install size by ~75.7 MB. These new dev dependencies require Node.js v10+. - Reorganized files. This is only a breaking change for projects using undocumented deep imports.
- Removed now redundant Node.js version compatibility logic in the
processRequest
function. - The
processRequest
function now places references to instances of the now exported and documentedUpload
class in the GraphQL operation for theGraphQLUpload
scalar to derive its value, and theGraphQLUpload
scalar now throws aGraphQLError
when it parses an invalid value, fixing #175 via #181. - The
GraphQLUpload
scalarparseLiteral
andserialize
methods now throwGraphQLError
(instead ofError
) instances, with tweaked messages.
- The
createReadStream
function in resolved file uploads now accepts options to configure the encoding and high water mark, fixing #177 via #179.
- Removed the now redundant
eslint-plugin-import-order-alphabetical
andexpress-async-handler
dev dependencies. - Stop using
husky
andlint-staged
. - Use
isobject
for checking if values are enumerable, non-array objects. - Tests have been massively reorganized, refactored, and improved.
- Test the
GraphQLUpload
scalar. - Test the
ignoreStream
function. - Moved the
Upload
class to its own file. - Added JSDoc for the
Upload
class instance propertyfile
. - Test the
Upload
class. - Improved JSDoc
FileUpload
typedef description. - Removed now redundant
eslint-disable-next-line
comments. - Use strict mode for scripts.
- Updated Node.js support from v8.5+ to v8.10+, to match what the
eslint
dev dependency now supports. This is unlikely to be a breaking change for the published package. - Removed the
Upload
scalar promise resolvedstream
property that has been deprecated since v7, along with associated tests. - ESM is no longer published, due to CJS/ESM compatibility issues across recent Node.js versions, via #169.
- The file structure and non-index file exports have changed. This should only affect projects using undocumented deep imports.
- Updated the
fs-capacitor
dependency to v4 to support Node.js v13, making required changes to the source and tests, via #166. - JSDoc comments are now included in the published code.
- Several anonymous functions have been named, for better error stack traces.
- Setup GitHub Sponsors funding:
- Added
.github/funding.yml
to display a sponsor button in GitHub. - Added a
package.json
funding
field to enable npm CLI funding features.
- Added
- Updated dev dependencies.
- Removed the
.nycrc.json
file:tap
now ignores test files by default.- The
lib/test-helpers
directory is now ignored usingtap
CLI arguments due to tapjs/node-tap#612.
- Removed the
esm
andmjs
package tags; they will be added back once native ESM is properly supported. - Updated JSDoc code examples to use CJS instead of ESM, as native ESM is not yet properly supported.
- No longer test
fs-capacitor
implementation details such as temp file creation and cleanup. - Commented the reasons for several
istanbul ignore next
comments.
processRequest
now throws an appropriate error when a multipart field value exceeds the configured size limit, fixing #159.- When the file size limit is exceeded, mention how many bytes the limit is in the stream error message.
- Added a new
processRequest
option to thegraphqlUploadExpress
andgraphqlUploadKoa
middleware, for improved testing without mocks or spies which are difficult to achieve with ESM.
- Updated dependencies.
- Due to updated dependencies: Lint fixes, removed redundant
eslint-disable-next-line
comments, and regenerated the readme. - Documented
koa-graphql
as known to be compatible, via #156. - Fixed a readme typo, via #161.
- Use GitHub Actions instead of Travis for CI.
- Removed
package-lock.json
from.gitignore
and.prettierignore
, as it’s disabled in.npmrc
anyway. - New file structure.
- Explicitly defined main exports (instead of using
export * from
) to prevent accidental public exposure of internal APIs. - Moved JSDoc typedefs into the index main entry file, alphabetically sorted.
- Nicer Browserslist query syntax.
- Replaced the
isObject
helper with a smarter and testedisEnumerableObject
. - Removed the
isString
helper. - Enforced 100% code coverage for tests, and improved
processRequest
internals and tests (including a new test using vanilla Node.js HTTP), fixing #130 via #162. - Removed a workaround from the
startServer
test helper. - Added a new
ProcessRequestFunction
JSDoc type, and applied it toprocessRequest
. - Renamed the
UploadOptions
JSDoc type toProcessRequestOptions
. - Misc. documentation improvements.
- Updated dependencies.
- Handle invalid object paths in
map
multipart field entries, fixing #154. - Import
WriteStream
fromfs-capacitor
as a named rather than default import.
- Updated dependencies.
- Allow batched operations again, fixing #142.
- Simplify tests by writing JSON as strings instead of using
JSON.stringify
. - Use async middleware with
express-async-handler
for Express tests. - Removed unintended
maxFiles
config in certain tests. - Added the Open Graph image design to the logo Sketch file.
- Updated dependencies.
- Handle invalid types in multipart fields and respond with meaningful HTTP 400 errors, via #139:
- Invalid
operations
type. - Invalid
map
type. - Invalid
map
entry type. - Invalid
map
entry array item type.
- Invalid
- Additionally test current Node.js v8 and v10 versions with Travis.
- Reduced the size of the published
package.json
by moving dev tool config to files. This also prevents editor extensions such as Prettier and ESLint from detecting config and attempting to operate when opening package files installed innode_modules
. - Removed the
watch
dev dependency andwatch
script. - Simplified the
prepublishOnly
script. - Change to the
classic
TAP reporter for tests. - Add
apollo-server-koa
andapollo-server-express
back to the compatible environments list in the readme, now that they use the current version of this package.
- Updated the
fs-capacitor
dependency to v2, fixing #131 via #132.
- Updated dependencies. The
busboy
update contains a bug fix for.pipe()
on file streams. - Use jsDelivr for the readme logo instead of RawGit as they are shutting down.
- Updated dev dependencies.
- Fixed hanging when a request with a large payload has an “immediate” error, such as a malformed request, fixing #123 via #124.
- Moved JSDoc type definitions to the end of files to make it easier to open to the code.
- Updated dev dependencies.
- Removed the package
module
field. Webpack by default resolves extensionless paths the same way Node.js in--experimental-modules
mode does;.mjs
files are preferred. Tools misconfigured or unable to resolve.mjs
can get confused whenmodule
points to an.mjs
ESM file and they attempt to resolve named imports from.js
CJS files. - Updated package scripts and config for the new
husky
version. - Added a package
browserslist
field with the target Node.js version for@babel/preset-env
and removed related config frombabel.config.js
. - Tests now log if the environment is CJS or ESM (
--experimental-modules
) and theNODE_ENV
. - Fixed broken readme API documentation links.
-
New naming that drops “apollo” to reflect the independent and universal nature of the project, fixing #68:
- Changed the package name from
apollo-upload-server
tographql-upload
. - Renamed
apolloUploadKoa
tographqlUploadKoa
. - Renamed
apolloUploadExpress
tographqlUploadExpress
.
To migrate you project from
apollo-upload-server@7.1.0
tographql-upload@8.0.0
:- Run
npm uninstall apollo-upload-server
. - Run
npm install graphql-upload
. - Find and replace:
apolloUploadKoa
→graphqlUploadKoa
.apolloUploadExpress
→graphqlUploadExpress
.
- Changed the package name from
- Updated dependencies.
- New project logo.
- Support
graphql
v14.
- Updated dev dependencies.
- The
processRequest
function now requires ahttp.ServerResponse
instance as its second argument. - Replaced the previously exported error classes with
http-errors
and snapshot tested error details, via #105. - No longer exporting the
SPEC_URL
constant.
Upload
scalar promises now resolve with acreateReadStream
method instead of astream
property, via #92.- Accessing an
Upload
scalar promise resolvedstream
property results in a deprecation warning that recommends usingcreateReadStream
instead. It will be removed in a future release. Via #107. - An
Upload
scalar variable can now be used by multiple resolvers, via #92. - Multiple
Upload
scalar variables can now use the same multipart data, via #92. - Malformed requests containing invalid JSON for
operations
ormap
multipart fields cause an appropriate error with a400
status instead of crashing the process, relating to #81 and #95. - Malformed requests missing
operations
,map
and files, or justmap
and files, cause an appropriate error with a400
status instead of hanging, fixing #96. - Tweaked
GraphQLUpload
scalar description to remove details about how it resolves on the server as they are irrelevant to API users. - Tweaked
GraphQLUpload
scalar error messages.
- Updated dev dependencies.
- Removed the
npm-run-all
dev dependency and made scripts and tests sync for easier debugging, at the cost of slightly longer build times. - Explicitly set
processRequest
default options instead of relying onbusboy
defaults. - Better organized project file structure.
- Configured Prettier to lint
.yml
files. - Ensure the readme Travis build status badge only tracks
master
branch.
Big thanks to new collaborator @mike-marcacci for his help solving tricky bugs and edge-cases!
- Updated Node.js support from v6.10+ to v8.5+ for native ESM, object rest/spread properties, and async functions.
- Removed the
@babel/runtime
dependency and config. - Fixed #45, #77 and #83 via #81:
- Add
error
event listeners to file streams to prevent server crashes on aborted requests or parser errors. - Use
fs-capacitor
to ensure the server doesn’t hang if an uploadawait
is out of order, or is never consumed.
- Add
- Refactored package scripts to use
prepare
to support installation via Git (e.g.npm install jaydenseric/apollo-upload-server
).
- Updated dependencies.
- Use single instead of double typographic quotes in error messages.
- Use
babel.config.js
instead of.babelrc.js
. - Enabled
shippedProposals
in@babel/preset-env
config. - Improved testing:
- Use
tap
instead ofava
. Tests no longer transpile on the fly, are faster and AVA no longer dictates the Babel version. - Tests run against the actual dist
.mjs
and.js
files in native ESM (--experimental-modules
) and CJS environments. - Removed
get-port
dev dependency. - Added Express tests.
- Test middleware error response status codes.
- Test behavior of aborted HTTP requests.
- Test that the app can respond if an upload is not handled.
- Test files to upload are created in context, rather than using arbitrary project files, via #89.
- Use
- Improved
package.json
scripts:- Leveraged
npm-run-all
more for parallelism and reduced noise. - Removed the clean script
rimraf
dev dependency in favour of nativerm -rf
. Leaner and faster; we only support *nix now for contributing anyway. - No longer use
cross-env
; contributors with Windows may setup and use a Bash shell. - Renamed the
ESM
environment variable toBABEL_ESM
to be more specific. - Removed linting fix scripts.
- Linting included in the test script; Travis CI will fail PR's with lint errors.
- Custom watch script.
- Leveraged
- Improved ESLint config:
- Simplified ESLint config with
eslint-config-env
. - Removed redundant
eslint-plugin-ava
dev dependency and config. - Undo overriding ESLint ignoring dotfiles by default as there are none now.
- Simplified ESLint config with
- Use
.prettierignore
to leavepackage.json
formatting to npm. - Tweaked package
description
andkeywords
. - Compact package
repository
field. - Improved documentation.
- Readme badge changes to deal with shields.io unreliability:
- Use the official Travis build status badge.
- Use Badgen for the npm version badge.
- Removed the licence badge. The licence can be found in
package.json
and rarely changes. - Removed the Github issues and stars badges. The readme is most viewed on Github anyway.
- Changelog version entries now have “Major”, “Minor” and “Patch” subheadings.
graphql
peer dependency range updated to^0.13.1
for native ESM support via.mjs
. It’s a breaking change despite being a semver patch.
- Updated dependencies.
- More robust npm scripts, with the ability to watch builds and tests together.
- Fixed missing dev dependency for fetching in tests.
- Use
eslint-plugin-ava
. - HTTPS
package.json
author URL. - New readme logo URL that doesn’t need to be updated every version.
- Temporary solution for importing CommonJS in
.mjs
, fixing reopened #40.
- Correct imports for vanilla Node.js
--experimental-modules
and.mjs
support, fixing #40.
- Updated dependencies.
- Simplified npm scripts.
- Readme updates:
- Updated peer dependencies to support
graphql@0.12
, via #36.
- Updated dependencies.
- Transpile and polyfill for Node.js v6.10+ (down from v7.6+) to support AWS Lambda, fixing #33.
- Modular project structure that works better for native ESM.
- Added tests.
- Set up Travis to test using the latest stable Node.js version and the oldest supported in
package.json
engines
(v6.10). - Added a Travis readme badge.
- Improved error handling, fixing #26:
- Custom errors are thrown or emitted with meaningful messages that are exported so consumers can use
instanceof
with them. - Where it makes sense, errors cause relevant HTTP status codes to be set in middleware.
- Misordered multipart fields cause
processRequest
to throwMapBeforeOperationsUploadError
andFilesBeforeMapUploadError
errors in middleware. - The
map
field provided by the client is used to naively check themaxFiles
option is not exceeded for a speedyMaxFilesUploadError
error in middleware. The real number of files parsed is checked too, incase the request is malformed. - If files are missing from the request the
scalar Upload
promises reject with aFileMissingUploadError
error. - Already if a file exceeds the
maxFileSize
option the file is truncated, the stream emits alimit
event andstream.truncated === true
. Now anerror
event is also emitted with aMaxFileSizeUploadError
. - Aborting requests from the client causes
scalar Upload
promises to reject with aUploadPromiseDisconnectUploadError
error for file upload streams that have not yet been parsed. For streams being parsed anerror
event is emitted with anFileStreamDisconnectUploadError
error andstream.truncated === true
. It is up to consumers to cleanup aborted streams in their resolvers.
- Custom errors are thrown or emitted with meaningful messages that are exported so consumers can use
- Updated dependencies.
- Smarter Babel config with
.babelrc.js
. - Refactor to use fewer Busboy event listeners.
- New API to support the GraphQL multipart request spec v2.0.0-alpha.2. Files no longer upload to the filesystem; readable streams are used in resolvers instead. Fixes #13 via #22.
- Export a new
Upload
scalar type to use in place of the oldUpload
input type. It represents a file upload promise that resolves an object containingstream
,filename
,mimetype
andencoding
. - Deprecated the
uploadDir
middleware option. graphql
is now a peer dependency.
- Added new
maxFieldSize
,maxFileSize
andmaxFiles
middleware options.
- Middleware are now arrow functions.
- Updated Node.js support from v6.4+ to v7.6+.
- Express middleware now passes on errors instead of blocking, via #20.
- Using Babel directly, dropping Rollup.
- New directory structure for compiled files.
- Module files now have
.mjs
extension. - No longer publish the
src
directory. - No more sourcemaps.
- Use an arrow function for the Koa middleware, to match the Express middleware.
- Compiled code is now prettier.
- Prettier markdown files.
- Updated package keywords.
- Updated an Apollo documentation link in the changelog.
- Readme improvements:
- Added links to badges.
- Removed the inspiration links; they are less relevant to the evolved codebase.
- Fixed an Apollo link.
- Replaced example resolver code with a link to the Apollo upload examples.
- Updated dependencies.
- Readme tweaks including a new license badge.
- Updated dependencies.
- Removed
package-lock.json
. Lockfiles are not recommended for packages. - Moved Babel config out of
package.json
to prevent issues when consumers run Babel overnode_modules
. - Readme tweaks and fixes:
- Renamed the
File
input typeUpload
for clarity. - Wording and formatting improvements.
- Covered React Native.
- Documented custom middleware.
- Renamed the
- Updated dependencies.
- Added a changelog.
- Dropped Yarn in favor of npm@5. Removed
yarn.lock
and updated install instructions. - Set targeted Node version as a string for
babel-preset-env
. - New ESLint config. Dropped Standard Style and began using Prettier.
- Using lint-staged to ensure contributors don't commit lint errors.
- Removed
build:watch
script. Usenpm run build -- --watch
directly.
- Updated dependencies.
- Support regular requests from clients other than apollo-upload-client again, fixing #4.
- Removed incorrect commas from example GraphQL input type.
- Support
apollo-upload-client
v3 and query batching.
- Clearer package description.
- Use Standard Style instead of ESLint directly.
- Exporting a new helper function for processing requests. It can be used to create custom middleware, or middleware for unsupported routers.
- Exporting new Koa middleware.
- Upload directory is ensured on every request now. While slightly less efficient, it prevents major errors when if it is deleted while the server is running.
- Updated dependencies.
- Documented npm install as well as Yarn.
- Typo fix in the readme.
- Fixed broken Github deep links in the readme.
- Readme rewording.
- Simplified
package.json
description.
- Added missing metadata to
package.json
. - Added a link to apollographql/graphql-server in the readme.
Initial release.