Resource Library
Sanity GROQ Pagination with Slice + Total Count
Fetch paged items with GROQ slice while also retrieving total counts, and keep a safe fallback for local/dev.
Scroll
12 Apr 2025
5 min read
Sanity
Fetch paged items with GROQ slice while also retrieving total counts, and keep a safe fallback for local/dev.
Use two queries: a count query for total and a slice query for the page window. When Sanity is missing or returns empty, fall back to hardcoded content so routes remain stable in CI and local development.
Next.js
React
TypeScript
Tailwind
AB
AlterByte Strategy Team
Digital Delivery Experts
Keep Reading
Performance
Performance Budgeting: Keep LCP Under 1.2s
A practical budgeting approach: constrain images, fonts, hydration, and third-party scripts so speed stays predictable.
Read Guide
Engineering
Server Pagination Patterns with Prisma (Skip/Take + Count)
A practical reference for consistent pagination in admin and dashboard tables: count + skip/take, clamping, and redirects.
Read Guide