graphql / graphql-relay-js

A library to help construct a graphql-js server supporting react-relay.
MIT License
1.54k stars 181 forks source link

fix: align previous/next page flag with relay standard #388

Open tcleonard opened 2 years ago

tcleonard commented 2 years ago

Fix issue #286 and #58

linux-foundation-easycla[bot] commented 2 years ago

CLA Missing ID CLA Not Signed

tcleonard commented 2 years ago

@Cito the goal of this MR is to align the computation of the page info with the relay official spec. Indeed the computation of the "has previous/next page" flags was not matching what is defined in the documentation. I have added unit tests for the missing cases. Since the standard definition can return unexpected result in some cases I left some comment to make that very explicit that it is not a bug.

Cito commented 2 years ago

@tcleonard Thanks, but I'm not maintaining graphql-relay-js. Maybe @IvanGoncharov can look into this? If it gets merged, I will gladly port it over to graphql-relay-py.