JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 143
  • Score
    100M100P100Q82148F
  • License MIT

GraphQL execution and error handling middleware written from scratch for Koa.

Package Exports

  • graphql-api-koa/GraphQLAggregateError.mjs
  • graphql-api-koa/errorHandler.mjs
  • graphql-api-koa/execute.mjs
  • graphql-api-koa/package.json

Readme

graphql-api-koa logo

graphql-api-koa

npm version CI status

GraphQL execution and error handling middleware written from scratch for Koa.

Installation

To install graphql-api-koa and the graphql peer dependency with npm, run:

npm install graphql-api-koa graphql

Setup the Koa middleware in this order:

  1. errorHandler, to catch errors from following middleware for a correctly formatted GraphQL response.
  2. A GraphQL multipart request processor like graphqlUploadKoa from graphql-upload, to support file uploads (optional).
  3. A request body parser like koa-bodyparser.
  4. execute, to execute GraphQL.

See the execute middleware examples to get started.

Requirements

  • Node.js: ^14.17.0 || ^16.0.0 || >= 18.0.0

Exports

These ECMAScript modules are published to npm and exported via the package.json exports field: