How to properly handle Prima selects/includes with tRPC?
Hello,
my understanding of optimizing procedures to be the most efficient would be to enable one procedure to handle different use-cases. So I'd like a procedure like
Currently, I define a list of all attributes on a global level for each router, that includes all includable Fields (I'd then do the same for the selectable fields). But that - even with just the includable fields - ends in this madness:
The problem I have with this, is that it looks horrendous and needs to be manually adjusted everytime the schema changes
my understanding of optimizing procedures to be the most efficient would be to enable one procedure to handle different use-cases. So I'd like a procedure like
getById to take a list that allows all possible attributes from the prisma models and optionally a list of models to include.Currently, I define a list of all attributes on a global level for each router, that includes all includable Fields (I'd then do the same for the selectable fields). But that - even with just the includable fields - ends in this madness:
The problem I have with this, is that it looks horrendous and needs to be manually adjusted everytime the schema changes