You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/docs/persistence/typegoose/relations.mdx
+82Lines changed: 82 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -401,3 +401,85 @@ export class TagDTO {
401
401
</TabItem>
402
402
</Tabs>
403
403
404
+
405
+
## Discriminators
406
+
407
+
Typegoose supports mongoose [discriminators](https://mongoosejs.com/docs/discriminators.html). `nestjs-query` provides support for them through the `NestjsQueryTypegooseModule`.
408
+
409
+
To use discriminators you need to define them in your `NestjsQueryTypegooseModule.forFeature` call.
410
+
411
+
When working with discriminators, `nestjs-query` requires you to provide a service class for each discriminated entity. This is necessary for the auto-generated resolvers to be created correctly. These service classes are also the perfect place to add any custom business logic for your discriminated entities.
0 commit comments