How to add two dto for one query param?

I want to use two dto's for one query param.

@Query() query: CurrencyTypeDto|PaginationLimitDto

I know I can use inheritance. Maybe there is another way?


NestJs offers something called IntersectionType() to combine two types into one new type (dto), to Implement that you need to:

    export class queryDto extends IntersectionType(
  CurrencyTypeDto,
  PaginationLimitDto,
) {}

then you can use it: @Query() query: queryDto

Ref : intersection