fuel-core
fuel-core copied to clipboard
Fix pagination state for `coins` and `blocks` query
When navigating to first
or last
pages, where the page size is even, the pagination state is computing wrongly.
We have fixed pagination on transactions
on #323. But we also need to implement it on other pagination queries like coins
and blocks
.
scenario
In a scenario where the iterable list is;
[1,2,3,4,5,6,8,9]
Page 1;
transactions(first: 3)
-> should return hasPreviousPage: false
and hasNextPage: true
.
Page 2;
transactions(first: 3, after: <Page1.endCursor>)
-> should return hasPreviousPage: true
and hasNextPage: true
.
Page 2;
transactions(first: 3, after: <Page2.endCursor>)
-> should return hasPreviousPage: true
and hasNextPage: false
.