Transform prisma outputs relations to an array of strings instead of array of objects. this method uses the method but it handles the $transaction response as it returns an array of data and the count field.
Usage
@Injectable()
export class Service {
findAll(query: any): Promise<[Client[], number]> {
const where = query.where || {};
return this.prisma.$transaction([
this.prisma.client.findMany(query),
this.prisma.client.count({ where }),
]);
}
}