As per the relay specs, total number of rows should be provided in the connection itself. But I couldn't find a way to provide total number of rows or page count etc...
https://graphql.org/learn/pagination/
I am referring below sample provided for relay based pagination.
That's a curious case. Relay Connection spec actually does not mention
totalCount
in theConnection
object, but their examples randomly include that field anyway.Either way, you can extends SPQR's
Page
as you see fit. You can have a look at thetestExtendedPageMapping
test which makes use of a customExtendedPage
.The resolver itself looks like this:
ExtendedPage
is a simple implementation ofPage
: