Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #430 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 108 108
Lines 15606 15882 +276
Branches 1384 1412 +28
==========================================
+ Hits 15606 15882 +276
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9458e67 to
50a20a7
Compare
2b437e1 to
4439b05
Compare
0b4f87d to
1218be7
Compare
4439b05 to
9a0ae15
Compare
1218be7 to
93efc2f
Compare
2bd993a to
a3ffbaf
Compare
0829b03 to
351382a
Compare
56aeab5 to
f2efc1c
Compare
b43bb56 to
7f45f60
Compare
1f7172a to
5ec7479
Compare
ide
left a comment
There was a problem hiding this comment.
I am skeptical of this feature for a few reasons. They can be addressed but I'll write them out here:
- We don't use this feature currently. If an LLM keeps wanting to add it, we can add a CLAUDE.md saying not to suggest it.
- This could be problematically slow depending on the number of rows needed to be scanned. I'm thinking we'd want a way to cap the count. The UX would show the number of pages if it's under, say, 20, but otherwise just show "more".
- Refetching the count during pagination is wasteful. Only the initial query (which isn't necessarily for page 1) needs the count, and then incremental loads should not compute it by default.
7f45f60 to
58deffd
Compare
5ec7479 to
6d88125
Compare
6d88125 to
d3a2418
Compare
|
I think we're in agreement. I could imagine in the future exposing a loaderMethod, Closing for now. |

Why
A frequent operation that is needed during pagination is computation of the total number of pages. Some relay-style paginators (connections, edges) expose a
totalCountfield on the Connection type.This PR adds this feature. Note that I'm not a strong proponent for this, but claude is and it wouldn't stop trying to implement it or suggest it in code review throughout this process. So we built it, but I'm open to not landing it if we think it'll be abused (query on every page, for example). Claude and my research seem to think that it makes sense and is aligned with other libraries like apollo.
How
See docblock for
includeTotalfor summary, but at a high level this does either a postgres window function or acount(*)to get the count. Window functions are more efficient since the postgres execution can fetch that information in the same query, but they only work when cursors are not used (otherwise the window function would apply over the rows selected by the cursor condition).Test Plan
Full test coverage, many tests.