Skip to content
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

Do not trigger all @Relations.toOne before a saving hook #426

Closed
jycouet opened this issue May 2, 2024 · 2 comments
Closed

Do not trigger all @Relations.toOne before a saving hook #426

jycouet opened this issue May 2, 2024 · 2 comments

Comments

@jycouet
Copy link
Collaborator

jycouet commented May 2, 2024

Describe the bug
When I insert a task, I noticed that all @Relations.toOne are triggered before the saving hook.

To Reproduce
Here is the repro:
https://stackblitz.com/edit/github-j2kvts?file=src%2Fshared%2Fmodel.ts
Click on the GOOO button and see logs.

Expected behavior
Only defaultIncluded fields should be requested, not all @Relations.toOne

Additional context
It's not happening in initApi 🤔

@noam-honig
Copy link
Collaborator

I decided a bit differently - I simply do not reload them in this scenario - if someone needs them loaded - they can do it manually

noam-honig added a commit that referenced this issue May 12, 2024
noam-honig added a commit that referenced this issue May 12, 2024
@jycouet
Copy link
Collaborator Author

jycouet commented May 13, 2024

Working well ✅
Thx 🎉

@jycouet jycouet closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants