Releases: jaydenseric/graphql-api-koa
Releases · jaydenseric/graphql-api-koa
Version 9.1.3
Patch
- Updated dev dependencies.
- Simplified the
execute
middleware using a new private functionassertKoaContextRequestGraphQL
. - Improved
execute
middleware related types:- The middleware no longer requires the Koa context to have a
request.body
type of[key: string]: unknown
. - Option
override
now has a more accurate type for function argument 1context
.
- The middleware no longer requires the Koa context to have a
- Tweaked formatting in tests.
Version 9.1.2
Patch
- Updated dependencies.
- Fixed TypeScript types for the class
GraphQLAggregateError
properties that were unintentionallyany
.
Version 9.1.1
Patch
- Updated dependencies.
- Use the
node:
URL scheme for Node.js builtin module imports in tests. - Revamped the readme:
- Removed the badges.
- Added information about TypeScript config and optimal JavaScript module design.
Version 9.1.0
Minor
- Added the
GraphQLAggregateError.mjs
module to the packageexports
field.
Version 9.0.0
Major
- Updated Node.js support to
^14.17.0 || ^16.0.0 || >= 18.0.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Public modules are now individually listed in the package
files
andexports
fields. - Removed
./package
from the packageexports
field; the fullpackage.json
filename must be used in arequire
path. - Removed the package main index module; deep imports must be used.
- Shortened public module deep import paths, removing the
/public/
. - The
errorHandler
Koa middleware no longer exposes errorlocations
andpath
properties within the GraphQL response bodyerrors
array for errors that aren’t GraphQL validation or execution errors. - Implemented TypeScript types via JSDoc comments.
Patch
- Updated dependencies.
- Removed the
isobject
dependency. - Simplified dev dependencies and config for ESLint.
- Removed the
jsdoc-md
dev dependency and the packagedocs-update
anddocs-check
scripts, replacing the readme “API” section with a manually written “Exports” section. - Check TypeScript types via a new package
types
script. - Simplified package scripts.
- 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.
- Improved tests and test helpers.
- Stopped using deprecated
GraphQLError
constructor parameters in tests. - Updated the
execute
Koa middleware to throw an appropriate HTTP error when the GraphQL operationoperationName
is invalid. - Implemented a more reliable system based on a new
GraphQLAggregateError
class for throwing a GraphQL validation or execution aggregate error in theexecute
Koa middleware for special handling in theerrorHandler
Koa middleware. - Updated the
errorHandler
Koa middleware to overwrite an existing Koa contextresponse.body
if it’s not a suitable object when handling an error. - Configured Prettier option
singleQuote
to the default,false
. - Improved documentation.
- Added a
license.md
MIT License file.
Version 8.0.0
Major
- Updated Node.js support to
^12.20.0 || ^14.13.1 || >= 16.0.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Updated the
graphql
peer dependency to^16.0.0
. - Updated the
errorHandler
Koa middleware to avoid theformatError
function deprecated ingraphql
v16, using the newGraphQLError.toJSON
method.
Patch
- Also run GitHub Actions CI with Node.js v17.
Version 7.0.0
Major
- Updated Node.js support to
^12.20 || >= 14.13
. - Updated dependencies, some of which require newer Node.js versions than previously supported.
- The API is now ESM in
.mjs
files instead of CJS in.js
files, accessible viaimport
but notrequire
. - Replaced the the
package.json
exports
field public subpath folder mapping (deprecated by Node.js) with a subpath pattern.
Minor
- Added a package
sideEffects
field.
Patch
- Stop using
hard-rejection
to detect unhandledPromise
rejections in tests, as Node.js v15+ does this natively. - 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. - 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. - Readme tweaks.
Version 6.0.0
Major
- 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. - Use the
application/graphql+json
content-type instead ofapplication/json
for GraphQL requests and responses. This content-type is being standardized in the GraphQL over HTTP specification.
Patch
- Updated dev dependencies.
- Updated the EditorConfig URL.
- Stopped testing with Node.js v13.
- Prettier format JSDoc example code.
- Added ESM related keywords to the package
keywords
field.
Version 5.1.0
Minor
- Improved
execute
middleware errors:- More specific error when the operation field
query
isn’t a string. - Use GraphQL errors when the query can’t be parsed due to syntax errors and expose the location of the syntax error to the client.
- More specific error when the operation field
Patch
- Updated dev dependencies.
Version 5.0.0
Major
- Updated Node.js support to
^10.13.0 || ^12.0.0 || >= 13.7.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
Patch
- Updated the
graphql
peer dependency to0.13.1 - 15
. - Also run GitHub Actions with Node.js v14.