|
1 | 1 | # MidwayJS & DataLoader
|
2 | 2 |
|
3 |
| -Guidance on DataLoader integration with MidwayJS. |
| 3 | +Guidance on [DataLoader](https://github.com/graphql/dataloader) integration with [MidwayJS](https://github.com/midwayjs/midway). |
4 | 4 |
|
5 |
| -> Note: All examples are created upon TypeGraphQL, for TypeGraphQL usage in MidwayJS application, see [midway-examples](https://github.com/midwayjs/midway-examples/tree/master/v2/demo-graphql). |
| 5 | +> **Note: All examples are created upon [TypeGraphQL](https://typegraphql.com/), for information about TypeGraphQL + MidwayJS, see [midway-examples: graphql](https://github.com/midwayjs/midway-examples/tree/master/v2/demo-graphql).** |
6 | 6 | >
|
7 |
| -> Note: If you're also using Prisma2 in your application, then no extra DataLoader setup is needed because since Prisma 2 a [built-in DataLoader implemention](https://github.com/prisma/prisma/blob/2.21.x/src/packages/client/src/runtime/Dataloader.ts) was included. |
| 7 | +> **Note: If you're also using Prisma2 in your application, no extra DataLoader setup is needed because since Prisma2, a [built-in DataLoader implemention](https://github.com/prisma/prisma/blob/2.24.x/src/packages/client/src/runtime/Dataloader.ts) was included.** |
8 | 8 |
|
9 | 9 | ## Implementions
|
10 | 10 |
|
11 |
| -> TODO: AD/DISAD VANTAGES on each implemen |
| 11 | +- [x] Register DataLoader instances with **Batch Loader Functions** by TypeGraphQL middleware, manually. |
| 12 | +- [x] Register DataLoader instances with **Service(like TypeORM findByIds)** by TypeGraphQL middleware, manually. |
| 13 | + - Check [register-batchloader-manually](./src/lib/register-batchloader-manually.ts) for more details. |
12 | 14 |
|
13 |
| -- [x] Register DataLoader instances with **Plain Functions** by TypeGraphQL middleware, manually. |
14 |
| -- [x] Register DataLoader instances with **Service(TypeORM findByIds)** by TypeGraphQL middleware, manually. |
15 | 15 | - [x] Register DataLoader instances with **TypeORM Relation Metadata** by TypeGraphQL middleware, automatically.
|
16 |
| -- [x] Register DataLoader instances with **Provided batchLoadFn** by MidwayJS interceptors, with custom decorator. |
17 |
| -- [ ] Register DataLoader instances with **TypeORM Relation Metadata** by TypeGraphQL middleware, automatically. |
| 16 | +- [x] Register DataLoader instances with **TypeORM Relation Metadata** by TypeGraphQL middleware, automatically. ([type-graphql-dataloader](type-graphql-dataloader) under the hood.) |
0 commit comments