File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,13 @@ Port from [express-graphql](https://github.com/graphql/express-graphql).
14
14
npm install --save koa-graphql
15
15
```
16
16
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
18
24
19
25
Mount ` koa-graphql ` as a route handler:
20
26
@@ -38,6 +44,8 @@ app.use(
38
44
app .listen (4000 );
39
45
```
40
46
47
+ ## Setup with Koa Router
48
+
41
49
With ` @koa/router ` :
42
50
43
51
``` js
@@ -59,6 +67,8 @@ router.all(
59
67
app .use (router .routes ()).use (router .allowedMethods ());
60
68
```
61
69
70
+ ## Setup with Koa v1
71
+
62
72
For Koa 1, use [ koa-convert] ( https://github.com/koajs/convert ) to convert the middleware:
63
73
64
74
``` js
You can’t perform that action at this time.
0 commit comments