feat: add TotalCount field to PageInfo
test: add TotalCount assertions to existing tests
This commit is contained in:
@@ -99,6 +99,7 @@ func GetPage[T any](items []T, first *int, after *string, last *int, before *str
|
||||
HasNextPage: eIx < len(items),
|
||||
HasPreviousPage: sIx > 0,
|
||||
EndCursor: ptr(EncodeCursor(fn(page[len(page)-1]))),
|
||||
TotalCount: len(items),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,4 +112,5 @@ type PageInfo struct {
|
||||
HasNextPage bool
|
||||
HasPreviousPage bool
|
||||
EndCursor *string
|
||||
TotalCount int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user