New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow @InjectRepository with a function #36
Comments
I would greatly appreciate this functionality as well! |
are there any workarounds for solving the circular dependency issue? |
Any updates on this issue? |
I ran into this as well. To resolve, I patched the inject repository by checking if the metadata exists by calling I don't know if I should spent time creating a pull request as #37 is also still open. |
Is this something you can advise on @MichalLytek as you've approved #37? |
Do you have every entity and controller in different files? |
@afiorito This article may help - |
Not to pollute the comments, but +1 to the article that @udayrajMT linked. We have been using the internal.ts pattern with typeorm + type-graphql for months in production without any issue and we haven't run into a single circular dependency issue since. |
I have some circular depended entities (
User
andToken
) and when I injectingRepository<User>
andRepository<Token>
in some class, User isundefined
on the moment of the class construction.Error message:
Missing "entityType" parameter of "@InjectRepository" decorator for a ...
If you allow to provide functions that returns class type, it will solve this problem:
The text was updated successfully, but these errors were encountered: