Open hffmnn opened 8 months ago
When running the StarWars example I looked into the pageInfo for humans (There is a total count of 5 humans. ).
pageInfo
humans
Requesting the first 3 gives this (which is correct):
... "pageInfo": { "startCursor": "0", "endCursor": "2", "hasNextPage": true, "hasPreviousPage": false } ...
Requesting the next 3 after the first 3 (first:3, after: "2") gives this (which is wrong, hasNextPage should be false)
first:3, after: "2"
hasNextPage
false
"pageInfo": { "startCursor": "3", "endCursor": "4", "hasNextPage": true, "hasPreviousPage": true }
I played around with it a little bit further and found other things:
humans(first: 0, after: "2") gives
humans(first: 0, after: "2")
"pageInfo": { "startCursor": null, "endCursor": null, "hasNextPage": false, // should be true "hasPreviousPage": true }
Because the calculation to get the connection data is rather complex and mutativ (if this is a word) I didn't really understand what was going wrong.
🤔 I also wondered if these calculations could get abstracted away somehow (given the total count of items and all the other cursor info as input)
When running the StarWars example I looked into the
pageInfo
forhumans
(There is a total count of 5 humans. ).Requesting the first 3 gives this (which is correct):
Requesting the next 3 after the first 3 (
first:3, after: "2"
) gives this (which is wrong,hasNextPage
should befalse
)I played around with it a little bit further and found other things:
humans(first: 0, after: "2")
givesBecause the calculation to get the connection data is rather complex and mutativ (if this is a word) I didn't really understand what was going wrong.
🤔 I also wondered if these calculations could get abstracted away somehow (given the total count of items and all the other cursor info as input)