-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix(delegate): orderBy with base field doesn't work when the clause is an array #1824
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request focus on enhancing the Changes
Assessment against linked issues
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (1)
tests/regression/tests/issue-1755.test.ts (1)
1-33
: LGTM! Consider expanding test coverage.The schema correctly models the polymorphic relationship needed to test the ordering functionality. However, since Video model is defined but not used in tests, consider adding test cases for Video or remove it if not needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
packages/runtime/src/enhancements/node/delegate.ts
(3 hunks)tests/regression/tests/issue-1755.test.ts
(1 hunks)
🔇 Additional comments (2)
tests/regression/tests/issue-1755.test.ts (1)
3-61
: Consider adding error case tests.
While the happy path is well tested, consider adding test cases for error scenarios:
- Invalid orderBy field names
- Invalid order directions
- Mixed valid/invalid fields in array orderBy
packages/runtime/src/enhancements/node/delegate.ts (1)
1042-1042
:
Verify the usage of orderBy
in the aggregate
method
In Prisma, the aggregate
method does not support the orderBy
parameter. Including args.orderBy
may lead to unexpected behavior or errors. Please ensure that orderBy
is intended to be used here or consider removing it.
Run the following script to check for orderBy
usage in aggregate
methods:
This script searches for instances where orderBy
is used within aggregate
method calls, which can help identify potential misuse.
fixes #1755