I have a screen that displays a list of products, sorted by average rating. I've written a field-level resolver using a SQL query: (AVG(rating) FROM Ratings WHERE Rating.listener.id = parent.id) is roughly the pseudocode. Although this means I can get the average rating when a user looks at a single product, I cannot use the
orderBy
provided by Prisma for the list of products since the average rating isn't stored in the database. How should I work around this?