-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat(query): add translateAliases
option to automatically call translate aliases on query fields
#13397
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, though there are some thing that should still be done:
- test if the alias takes priority or errors if both are defined at the same time in the query
- test if the alias has any effect if the alias is used in a query but the actual property in a update (or vise-versa)
- document the above behavior somewhere on the documentation
also i dont know how feasible it is, but maybe consider calling _applyTranslateAliases
in _optionsForExec
?
Co-authored-by: hasezoey <hasezoey@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got a couple of questions, but overall LGTM. Thanks! 👍
Co-authored-by: Hafez <a.hafez852@gmail.com>
Fix #7511
Fix #8678
Summary
Add
translateAliases
option on query, schema, and global level to applyModel.translateAliases()
on all query fields automatically:filter
,projection
,update
, anddistinct
.Examples