Prisma sort by latest post to a thread
Hi everyone, trying to return a list of "threads" which have lots of "posts" on them. I'm trying to write a query that will return the x most recently updated threads by sorting on their latest post.
I've tried using take: 1, and _max on the relation and a few other things but it feels like I'm missing something. Feels like it should be fairly trivial but I just can't figure out an easy way to do it in the query.
Any ideas for this pattern? (I'm abstracting a bit, my objects are named a bit differently but the pattern is the same).
0 Replies