issue with has_previous_page
matteosister opened this issue · 3 comments
I think I found a little problem in the logic of has_previous_page parameter while using it with an ecto query.
in this line the parameters is true if offset is > 0 (right), but also if last is different from nil. This is not ok, because if I have a query with the parameter first, and one of after and before, it is always false.
I think that the offset > 0 is enough to tell if a query slice have a previous page.
What do you think?
if the previous issue is true, the same is valid for the has_next_page. If used with last instead of first it always returns false
@matteosister this is correct behavior regarding to Relay Cursor Connections specification. Not so usable if you want to create prev/next style pagination (and not just infinite scroll).
https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo.Fields
ooook...thanks for the head up. I will rewrite the function in my own codebase because I need pagination.
Thanks!!!