-
Hello 👋 First of all, I want to express my gratitude for this fantastic repository. It is extremely useful. I have encountered issues with circular dependencies multiple times while working with NestJS, which led me to seek answers here. To give an example of what I am trying to understand:
With this in mind, consider a website with a page displaying a list of books. If a book has been read by the logged-in user, the book should have a caption indicating that the user has already read it. Given the architecture of this repository, how can a flag (e.g. " |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I'm not exactly sure from your explanation how you got circular dependencies and how
You can have one endpoint (command) to set book as read, and another one like Also, Anyway, need more context to give a better answer. |
Beta Was this translation helpful? Give feedback.
I'm not exactly sure from your explanation how you got circular dependencies and how
hasRead
flag is related to circular dependencies that you get, will need more context.You can have one endpoint (command) to set book as read, and another one like
getBooks
(query) that returns a list of books where you joinbook
anduser_book
and return it.Also,
book
anduser_book
are part of the same bounded context and can be a part of a single module, I don't see much sense separating them. If you have 3 tables it doesn't mean you need 3 modules, you are just creating modules tha…