Skip to content

Commit 3509aab

Browse files
committed
add more helpers for counts
1 parent 7b570d3 commit 3509aab

File tree

14 files changed

+1195
-57
lines changed

14 files changed

+1195
-57
lines changed

.changeset/funny-hoops-shine.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@pothos/plugin-drizzle": minor
3+
---
4+
5+
Add new field builder methods and connection enhancements:
6+
7+
- `t.relatedField`: New method for creating custom fields based on relations with custom selections using the `buildFilter` callback
8+
- `t.relatedCount`: Simplified method for counting related records, with optional `where` filter support
9+
- `totalCount: true` option for `relatedConnection`: Adds a `totalCount` field to related connections
10+
- `totalCount` callback for `drizzleConnection`: Allows adding a `totalCount` field to drizzle connections
11+
- `totalCountOnly` optimization: Skips the main query when only `totalCount` is requested (for both connection types)

0 commit comments

Comments
 (0)