Skip to content

Paginate not working in prisma 5 with NestJs #18

@btd1337

Description

@btd1337

When using this library with NestJs, this error occurs:

class UsersRepository {
    constructor(private readonly prisma: PrismaService) {}

    findMany() {
        return this.prisma.users.paginate();  // "The property 'paginate' does not exist on type 'UserDelegate'."
    }
}
// Prisma instantiation

import pagination from 'prisma-extension-pagination';

@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
    async onModuleInit(): Promise<void> {
        await this.$connect();
        this.$extends(pagination());
  }
}
NestJs: 8.4.7
Typescript: 4.7.4
Prisma: 5.2.0
prisma-extension-pagination: 0.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions