, I am leveraging the Fluent API to address the n+1 problem as described here.
@ResolveField(() => User) private async author(@Parent() { id }: BlogPost): Promise<User> { return this._prisma.blogPost.findUnique({ where: { id }}).author(); }
@ResolveField(() => User) private async author(@Parent() { id }: BlogPost): Promise<User> { return this._prisma.blogPost.findUnique({ where: { id }}).author(); }
However, I have observed that the Fluent API does not work as expected when using the client extension. When I comment out the client extension, the Fluent API behaves correctly.
I'm using
@prisma/client: ^5.16.1
@prisma/client: ^5.16.1
and
prisma: ^5.16.1
prisma: ^5.16.1
. If you need further information or code snippets, let me know.