Skip to content

Latest commit

 

History

History
368 lines (256 loc) · 16.7 KB

changelog.md

File metadata and controls

368 lines (256 loc) · 16.7 KB

graphql-api-koa changelog

9.1.3

Patch

  • Updated dev dependencies.
  • Simplified the execute middleware using a new private function assertKoaContextRequestGraphQL.
  • 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 1 context.
  • Tweaked formatting in tests.

9.1.2

Patch

  • Updated dependencies.
  • Fixed TypeScript types for the class GraphQLAggregateError properties that were unintentionally any.

9.1.1

Patch

  • Updated dependencies.
  • Use the node: URL scheme for Node.js builtin module imports in tests.
  • Revamped the readme:

9.1.0

Minor

  • Added the GraphQLAggregateError.mjs module to the package exports field.

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 and exports fields.
  • Removed ./package from the package exports field; the full package.json filename must be used in a require 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 error locations and path properties within the GraphQL response body errors 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 package docs-update and docs-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 operation operationName is invalid.
  • Implemented a more reliable system based on a new GraphQLAggregateError class for throwing a GraphQL validation or execution aggregate error in the execute Koa middleware for special handling in the errorHandler Koa middleware.
  • Updated the errorHandler Koa middleware to overwrite an existing Koa context response.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.

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 the formatError function deprecated in graphql v16, using the new GraphQLError.toJSON method.

Patch

  • Also run GitHub Actions CI with Node.js v17.

7.0.0

Major

Minor

  • Added a package sideEffects field.

Patch

  • Stop using hard-rejection to detect unhandled Promise 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.

6.0.0

Major

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.

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.

Patch

  • Updated dev dependencies.

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 to 0.13.1 - 15.
  • Also run GitHub Actions with Node.js v14.

4.1.2

Patch

  • Updated dev dependencies.

  • Updated Prettier related package scripts.

  • Configured Prettier option semi to the default, true.

  • Ensure GitHub Actions run on pull request.

  • Minor v0.1.0 changelog entry tweak.

  • For clarity, manually specify a 500 HTTP status code even though it’s the default when throwing errors via http-errors.

  • Changed the error that the execute Koa middleware throws when there are GraphQL execution errors:

    • The error is no longer created using http-errors, which doesn’t easily accept a 200 status. This allowed the removal of the createHttpError function workaround.

    • Changed the error message (an internal change as this message is not exposed to the client by the errorHandler Koa middleware):

      - GraphQL errors.
      + GraphQL execution errors.
  • Updated the errorHandler Koa middleware, fixing #8:

    • It can now handle a non enumerable object error, e.g. null.
    • The extensions property of an error is now always exposed to the client in the payload errors array, even if the error message is not exposed via an expose property.
    • Added new ErrorKoaMiddleware and ErrorGraphQLResolver JSDoc typedefs to better document the special properties errors may have for the errorHandler Koa middleware to use to determine how the error appears in the response payload errors array and the response HTTP status code.
    • Documented that additional custom Koa middleware can be used to customize the response.
  • Renamed the startServer test helper to listen.

4.1.1

Patch

  • Updated dev dependencies.
  • Use isobject for checking if values are enumerable, non-array objects.
  • Destructure GraphQL execute results.

4.1.0

Minor

Patch

  • Updated dev dependencies.
  • Added a new hard-rejection dev dependency to ensure unhandled rejections in tests exit the process with an error.
  • Reorganized the test files.
  • Simplified test/index.js.
  • Tweaked some test names.
  • Reduced the execute middleware per request validation work.
  • Better handling of invalid GraphQL operation variables and GraphQL execution errors.

4.0.0

Major

  • ESM is no longer published, due to CJS/ESM compatibility issues across recent Node.js versions.
  • The file structure and non-index file exports have changed. This should only affect projects using undocumented deep imports.

Patch

  • Stop testing the statusCode property of HTTP errors; they are inconsequential as Koa uses the status property.

3.0.0

Major

  • Updated Node.js support from v8.5+ to v10+.
  • Updated dev dependencies, some of which require newer Node.js versions that v8.5.

Minor

  • Added a package module field.
  • 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.

Patch

2.2.0

Minor

  • Added a new execute middleware validationRules option.

Patch

  • Updated dev dependencies.
  • Ensure only desired execute middleware options apply to the GraphQL execute function.
  • Move tests to files adjacent to source files.
  • Renamed the isPlainObject helper to isEnumerableObject and added tests.
  • Moved isEnumerableObject checks into the checkOptions helper and added tests.
  • Renamed the checkSchema helper to checkGraphQLSchema and added tests.
  • Tweaked option related error messages.
  • Significantly simplified test assertions using t.throws and t.match.
  • Moved JSDoc type defs into src/index.js.
  • Renamed the MiddlewareOptionsOverride JSDoc type to ExecuteOptionsOverride.
  • Tweaked JSDoc descriptions.
  • Consistent JSDoc syntax style for array types.
  • Prettier errorHandler JSDoc example source code formatting.
  • Moved an execute middleware constant from function to module scope.
  • Added “Minor” and “Patch” subheadings to old changelog entries.

2.1.0

Minor

  • execute middleware now throws an appropriate error when the schema option is undefined, without an override.

Patch

  • Updated dependencies.
  • Cleaner readme “API” section table of contents with “See” and “Examples” headings excluded, thanks to jsdoc-md v3.1.0.
  • Removed the watch script and watch dev dependency.
  • Redid the test scripts and added a .nycrc.json file for improved reporting and code coverage.
  • Simplified the prepublishOnly script.
  • Reduced the size of the published package.json by moving dev tool config to files.
  • Removed the package module field. By default webpack resolves extensionless paths the same way Node.js (prior to v12) in --experimental-modules mode does; .mjs files are preferred. Tools misconfigured or unable to resolve .mjs can get confused when module points to an .mjs ESM file and they attempt to resolve named imports from .js CJS files.
  • Enforced 100% code coverage for tests.
  • Test errorHandler middleware handles an error correctly after ctx.response.body was set.
  • Added the Open Graph image design to the logo Sketch file.

2.0.0

Major

  • Errors thrown in resolvers without an expose: true property have their message masked by Internal Server Error in the response body to prevent client exposure. Koa app listeners and middleware still have access to the original errors.

1.1.2

Patch

  • Fix event listeners added in v1.1.1 to be compatible with Node.js < v10.
  • Downgrade node-fetch to fix --experimental-modules tests for Node.js < v10.2.0 (see bitinn/node-fetch#502).

1.1.1

Patch

  • Updated dependencies.
  • Updated package scripts and config for the new husky version.
  • Silence the http-errors deprecated non-error status code; use only 4xx or 5xx status codes warnings that appear (due to jshttp/http-errors#50) when there are GraphQL errors.
  • Expanded the source into separate files for easier code navigation.
  • Add a project logo.

1.1.0

Minor

Patch

  • Updated dependencies.
  • Stopped using npm-run-all for package scripts.
  • Configured Prettier to lint .yml files.
  • Ensure the readme Travis build status badge only tracks master branch.
  • Use Badgen for the readme npm version badge.

1.0.0

Patch

  • Updated dependencies.
  • Lint fixes following dependency updates.
  • Use jsdoc-md instead of documentation to generate readme API docs.
  • Removed a temporary workaround for a fixed Babel CLI bug.
  • Updated package description and tags.

0.3.1

Patch

0.3.0

Minor

  • Refactored package scripts to use prepare to support installation via Git (e.g. npm install jaydenseric/graphql-api-koa).

Patch

  • Corrected an errorHandler middleware example in the readme.
  • Compact package repository field.

0.2.0

Minor

  • Set Node.js support as v8.5+.

Patch

  • Avoided using a Koa context response shortcut.
  • Fixed test snapshot consistency between Node.js versions (see tapjs/node-tap#450).
  • Manually test error properties instead of using snapshots.
  • Added errorHandler middleware tests.
  • Readme badge changes to deal with shields.io unreliability:
    • Used the more reliable build status badge provided by Travis and placed it first as it loads the quickest.
    • 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.
  • Improved documentation.

0.1.0

Initial release.