Add shortcut totalCount

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-12-22 12:36:29 +01:00
parent c435d16ba6
commit 48183906f8
2 changed files with 38 additions and 0 deletions

View File

@@ -29,3 +29,13 @@ func OnlyIDSelected(ctx context.Context) bool {
return fields[0].Name == "id"
}
func OnlyTotalCountSelected(ctx context.Context) bool {
fields := graphql.CollectFieldsCtx(ctx, nil)
if len(fields) != 1 {
return false
}
return fields[0].Name == "totalCount"
}