/midwayjs-dataloader

MidwayJS + GraphQL + TypeGraphQL + DataLoader. 💕

Primary LanguageTypeScriptMIT LicenseMIT

MidwayJS & DataLoader

Guidance on DataLoader integration with MidwayJS.

Note: All examples are created upon TypeGraphQL, for information about TypeGraphQL + MidwayJS, see midway-examples: graphql.

Note: If you're also using Prisma2 in your application, no extra DataLoader setup is needed because since Prisma2, a built-in DataLoader implemention was included.

Implementions

  • Register DataLoader instances with Batch Loader Functions by TypeGraphQL middleware, manually.

  • Register DataLoader instances with Service(like TypeORM findByIds) by TypeGraphQL middleware, manually.

  • Register DataLoader instances with TypeORM Relation Metadata by TypeGraphQL middleware, automatically.

  • Register DataLoader instances with TypeORM Relation Metadata by TypeGraphQL middleware, automatically. (type-graphql-dataloader under the hood.)