-
-
Notifications
You must be signed in to change notification settings - Fork 12
fix: find input args validation #178
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
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
Claude finished @ymc9's task —— View job Code Review AnalysisReviewing the PR "fix: find input args validation" with focus on code quality, bugs, performance, security, and test coverage. Todo List
SummaryThis is a focused bug fix that addresses validation issues for find operation arguments. The changes are minimal, well-targeted, and improve type safety without introducing breaking changes. Detailed Review✅ Positive Aspects
|
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.
Pull Request Overview
This PR fixes input argument validation for find operations by distinguishing between unique and non-unique find operations in the validation schema. The key issue was that the validation logic was incorrectly allowing certain fields (like cursor and distinct) for unique find operations when they should only be allowed for collection-based operations.
- Updated type definitions to include all CRUD operations including
findUniqueOrThrowandfindFirstOrThrow - Fixed validation schema logic to properly handle unique vs non-unique find operations
- Moved
cursoranddistinctfield validation to only apply to non-unique (collection) operations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/runtime/src/client/plugin.ts | Updated type reference from CrudOperation to AllCrudOperation for broader operation coverage |
| packages/runtime/src/client/crud/validator.ts | Fixed find validation logic to properly distinguish unique vs collection operations and moved inappropriate fields |
| packages/runtime/src/client/crud/operations/base.ts | Added new AllCrudOperation type to include missing operation types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
No description provided.