-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/graphql filtered count and seed script #3
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
base: audit-package-update
Are you sure you want to change the base?
Fix/graphql filtered count and seed script #3
Conversation
countDisasters() previously ignored all filters (type, status, dateFrom, dateTo) and always returned the total row count. The GraphQL disasters query now returns accurate total and totalPages for filtered results. Co-authored-by: Cursor <cursoragent@cursor.com>
Three new tests verify that total and totalPages reflect the applied filters (status, type, and combined pagination + filter) rather than the unfiltered row count. Co-authored-by: Cursor <cursoragent@cursor.com>
Single TypeScript script (npm run seed) that populates the API via the bulk insert endpoint. Covers 6 continents, 12 disaster types, dates spanning Jan 2025 – Feb 2026, and all three statuses. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughAdded seeding infrastructure to populate the database with sample disaster data via a new npm script, enhanced the disasters GraphQL query to respect filters when calculating totals and pagination, and introduced comprehensive tests validating filtering and pagination behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation