-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
[Bug]: Loaded type does not catch missing population types when Collection is in populate
array
#5580
Comments
You need to use the |
Alright, glad to know that's the issue. I figured that was likely the case, as it was resolved as soon as I added the |
Nope, without using the |
Well I have a lot of refactoring to do it seems given we did not use the |
It would be technically possible to make this work without the Maybe something to think about when I start thinking about v7 (next year+). |
Not sure if it's worth it, tbh. It's kind of in the name: Type-Safe relations :P |
On second thought, it would be nice to have relations loaded via |
Describe the bug
When adding a function that has the loaded type as an argument, it should only accept an entity that has those populated relations. However, if you introduce a
Collection
relation into thepopulate
array when fetching the entity before passing it to the function,Loaded
seems to not throw an error on the function argument.Reproduction
https://github.com/kpervin/mikro-orm-reproduction/tree/loaded-population-issue
What driver are you using?
@mikro-orm/mysql
MikroORM version
next
Node.js version
20.9.0
Operating system
5.15.146.1-microsoft-standard-WSL2
Validations
The text was updated successfully, but these errors were encountered: