Skip to content

Commit 4be0716

Browse files
committed
Add TypeScript section to README
1 parent 241301a commit 4be0716

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ Port from [express-graphql](https://github.com/graphql/express-graphql).
1414
npm install --save koa-graphql
1515
```
1616

17-
## Usage
17+
### TypeScript
18+
19+
This module includes a [TypeScript](https://www.typescriptlang.org/)
20+
declaration file to enable auto complete in compatible editors and type
21+
information for TypeScript projects.
22+
23+
## Simple Setup
1824

1925
Mount `koa-graphql` as a route handler:
2026

@@ -38,6 +44,8 @@ app.use(
3844
app.listen(4000);
3945
```
4046

47+
## Setup with Koa Router
48+
4149
With `@koa/router`:
4250

4351
```js
@@ -59,6 +67,8 @@ router.all(
5967
app.use(router.routes()).use(router.allowedMethods());
6068
```
6169

70+
## Setup with Koa v1
71+
6272
For Koa 1, use [koa-convert](https://github.com/koajs/convert) to convert the middleware:
6373

6474
```js

0 commit comments

Comments
 (0)