2 ms·
How do you deal in such a project with similar queries that fetch not all the same data? E.g. Query A retrieves an Author and a count of all the boks he has wr
by chrisandchris 6y ago
How do you deal in such a project with similar queries that fetch not all the same data?
E.g. Query A retrieves an Author and a count of all the boks he has written. Query B retrieves an author and the title of the most recent book he has written. I see following options:
- make two models, one for each query -> leads to a lot of similar models and code-bloat
- make a base query and fetch additional data with an additional query -> leads to a lot of small queries that would sometimes be more performant as a single query