Skip to content

Commit

Permalink
Improve the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydenseric committed Jun 28, 2022
1 parent e92203b commit 3481f9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- 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`.
- Documentation tweaks.
- Improved documentation.
- Added a `license.md` MIT License file.

## 8.0.0
Expand Down
11 changes: 11 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@ To install [`graphql-api-koa`](https://npm.im/graphql-api-koa) and the [`graphql
npm install graphql-api-koa graphql
```

Setup the Koa middleware in this order:

1. [`errorHandler`](./errorHandler.mjs), to catch errors from following middleware for a correctly formatted [GraphQL response](https://spec.graphql.org/October2021/#sec-Errors).
2. A [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec) processor like `graphqlUploadKoa` from [`graphql-upload`](https://npm.im/graphql-upload), to support file uploads (optional).
3. A request body parser like [`koa-bodyparser`](https://npm.im/koa-bodyparser).
4. [`execute`](./execute.mjs), to execute GraphQL.

See the [`execute`](./execute.mjs) middleware examples to get started.

## Requirements

- [Node.js](https://nodejs.org): `^14.17.0 || ^16.0.0 || >= 18.0.0`

## Exports

These ECMAScript modules are published to [npm](https://npmjs.com) and exported via the [`package.json`](./package.json) `exports` field:
Expand Down

0 comments on commit 3481f9a

Please sign in to comment.