import { ClassType , Field , ObjectType } from 'type-graphql' ; export function PaginatedResponse < TItem > ( TItemClass , TOwner , fieldName ) { @ ObjectType ( `Paginated${ TItemClass . name }From${ TOwner . name }_${ fieldName }Response` , { isAbstract : true , } ) abstract class PaginatedResponseClass { @ Field ( ( ) => [ TItemClass ] ) items : TItem [ ] ; @ Field ( ) total : number ; @ Field ( ) hasMore : boolean ; } return PaginatedResponseClass as any ; }