You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens because we divide the TotalCount by the RequestedSize and we get an integer. We need to round up when there is a residual to get a cursor to the last items. Using Math.Ceiling or something like that.
Product
Green Donut
Version
15.1.3
Link to minimal reproduction
not needed
Steps to reproduce
Using a query with a relative cursor, where you fetch with
first
an amount of items that is not divisible by thetotalCount
to an integer.What is expected?
You get a cursor to the last page (here its page 2 because 12 / 10 > 1) when fetching the first 10 elements:
query(first: 10) { ... }
What is actually happening?
You get an empty list for the forwardCursors:
Relevant log output
Additional context
This happens because we divide the
TotalCount
by theRequestedSize
and we get an integer. We need to round up when there is a residual to get a cursor to the last items. UsingMath.Ceiling
or something like that.graphql-platform/src/GreenDonut/src/GreenDonut.Data/Extensions/GreenDonutPageExtensions.cs
Line 115 in 819f23c
The text was updated successfully, but these errors were encountered: