Next.js Discord

Discord Forum

How to use the repo pattern

Unanswered
Maltese posted this in #help-forum
Open in Discord
Avatar
MalteseOP
What to do if I have select: author, comments, tags, replys and etc into a single query. This will mean that my function name should be something like this getPostWithAuthorCommentsTagsReplys is there some best practice when dealing with such a case

5 Replies

Avatar
American Chinchilla
Single responsibility
For additional add ons you can use query params
And use a builder pattern etc
Avatar
MalteseOP
what you mean by signle repo, I am using the repo pattern and for every table I am creating a repo
can you give me example, how you will do it?