how do you make it possible to query a sub field i...
# orm-help
j
how do you make it possible to query a sub field in a paginated manner without having prisma fetch all the possible entries for the list? ie. I have a query 'users' on the app layer which takes some filtering arguments, the 'User' type then has a sub field 'posts' which i would like to paginate, if i just write a resolver for the property on the app layer it receives the 'User' as the parent argument but with all its posts, is there a way to avoid pulling all posts from the database into the resolver, with the goal of improving performance?
n
yes,
posts
on the Prisma API exposes pagination parameters as described here: https://www.prisma.io/docs/reference/prisma-api/queries-ahwee4zaey#pagination
j
so it's not possible to filter a field on elements in a query? (note: I'm trying to construct a query on users that includes some of each users posts)
n
yes, that is possible.