This is probably a simple use-case with a straight...
# talk-keto
w
This is probably a simple use-case with a straightforward solution but I am struggling with it. Would love input. I have a multi-tenanted application where users can create projects. These projects are for students so they are naturally related to one or more content areas. I want to create a paginated API route that will utilize Keto to find projects where our subject is the owner (this part I have done already) and then I want to filter by content area and return 10 projects. Subsequent calls to the request will include a
nextPageToken
and fetch the next ten. My challenge is that I don’t know how to achieve this since the paginated results from Keto are of course not filtered by content area. If I first query my application database to filter by content area then the paginated response will include projects not created by my user. Does anybody know a way I can achieve a consistent length paginated result where my query is filtered both by a response from a keto
/check
call and also by other fields in the database?
k
Did you ever find an answer to this? This seems like a typical use case where solutions aren't documented....
w
Luckily our app has not scaled. Solution I implemented was to set the page length to
100
in my
/check
call and use a large
WHERE IN
statement. 🤷 Hurt my soul a little bit to do it. Been meaning to noodle on this for a while. Maybe we could get in touch and try to brainstorm a solution together
k
Ha! Yeah, I think each way I cut it, it hurts a bit. We're looking to start adopting keto, but this is something I can see us hitting a bit of a wall with. Gonna have a noodle as well, I'll let you know where I get with it
w
Sounds good