GraphQL execution and error handling middleware written from scratch for Koa.
execute
middleware using a new private function assertKoaContextRequestGraphQL
.execute
middleware related types:
request.body
type of [key: string]: unknown
.override
now has a more accurate type for function argument 1 context
.node:
URL scheme for Node.js builtin module imports in tests.^14.17.0 || ^16.0.0 || >= 18.0.0
.files
and exports
fields../package
from the package exports
field; the full package.json
filename must be used in a require
path./public/
.errorHandler
Koa middleware no longer exposes error locations
and path
properties within the GraphQL response body errors
array for errors that aren’t GraphQL validation or execution errors.isobject
dependency.jsdoc-md
dev dependency and the package docs-update
and docs-check
scripts, replacing the readme “API” section with a manually written “Exports” section.types
script.actions/checkout
to v3.actions/setup-node
to v3.GraphQLError
constructor parameters in tests.execute
Koa middleware to throw an appropriate HTTP error when the GraphQL operation operationName
is invalid.GraphQLAggregateError
class for throwing a GraphQL validation or execution aggregate error in the execute
Koa middleware for special handling in the errorHandler
Koa middleware.errorHandler
Koa middleware to overwrite an existing Koa context response.body
if it’s not a suitable object when handling an error.singleQuote
to the default, false
.license.md
MIT License file.^12.20.0 || ^14.13.1 || >= 16.0.0
.graphql
peer dependency to ^16.0.0
.errorHandler
Koa middleware to avoid the formatError
function deprecated in graphql
v16, using the new GraphQLError.toJSON
method.^12.20 || >= 14.13
..mjs
files instead of CJS in .js
files, accessible via import
but not require
.package.json
exports
field public subpath folder mapping (deprecated by Node.js) with a subpath pattern.sideEffects
field.hard-rejection
to detect unhandled Promise
rejections in tests, as Node.js v15+ does this natively.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.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.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.application/graphql+json
content-type instead of application/json
for GraphQL requests and responses. This content-type is being standardized in the GraphQL over HTTP specification.keywords
field.^10.13.0 || ^12.0.0 || >= 13.7.0
.graphql
peer dependency to 0.13.1 - 15
.