I am creating an app and I have the backend in NestJS. It is basically a SaaS. I have a problem, which is that I have three modules: Company, User, and Vehicle. Vehicle and User need the company service to access the database query functions that are requested there. So far, so good. When I want to call the User or Vehicle service in Company, it creates a circular dependency, which would be easy to solve if it were only Company -> Vehicle, but it is Company -><- Vehicle and Company -> <- User. This creates a loop that cannot be solved with forwardRef() since more than one module interacts. What can I do to solve this problem?
#Circular dependencies
3 messages · Page 1 of 1 (latest)