sangria-relay icon indicating copy to clipboard operation
sangria-relay copied to clipboard

spec divergence in "hasPreviousPage"?

Open vivekdhayaal opened this issue 6 years ago • 3 comments

as per the spec: https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo "hasPreviousPage ... If the client is paginating with first/after, then the client may return true if edges prior to after exist, if it can do so efficiently, otherwise may return false."

as per the implementation: https://github.com/sangria-graphql/sangria-relay/blob/1854afd/src/main/scala/sangria/relay/Connection.scala#L120 "hasPreviousPage" is always false when the "last" argument is not specified. When we are paginating with "first/after", we don't specify "last", so "hasPreviousPage" is always false. It never returns true.

Can this issue be fixed to return "true" when edges prior to "after" exist?

vivekdhayaal avatar Dec 14 '18 15:12 vivekdhayaal

@OlegIlyenko would you be able to help with this?

vivekdhayaal avatar Dec 17 '18 11:12 vivekdhayaal

@OlegIlyenko sorry to at you like this but do you or any other maintainer have any input on this? Can we expect this to be fixed?

anddoutoi avatar Jan 08 '19 14:01 anddoutoi

@vivekdhayaal @anddoutoi I personally don't use this library. But I can provide you support if you want to open a PR.

yanns avatar Oct 11 '22 16:10 yanns

fix by https://github.com/sangria-graphql/sangria-relay/pull/225

yanns avatar Apr 25 '23 06:04 yanns