-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relay pagination omits pageInfo fields #2521
Comments
As far as I can tell we always include all the fields we are getting from your query relevant code are you adding all the fields in your selection-set? We have a test here showing that it should work 😅 |
Yes, I include all fields in the query. The test that you pointed out obviously passes because it checks the default case when the query requests the first page (the code here). However, I'm talking about cases when the query paginates using If you change this test changed as following, it will fail:
BTW, that test checks if Essentially, |
We're running into the same issue. I'm positive that I'm querying Is someone working on a fix for this ? I'm happy to contribute. |
For some reason, the
relayPagination
implementation doesn't copy the responsepageInfo
but instead picks only specific fields.This behavior doesn't seem correct as it does not conform to the Relay spec. The spec says that the server MAY return
hasPreviousPage: true
for the forward pagination andhasNextPage: true
for the backward one. However, the urql implementation assumes thathasPreviousPage
for the forward pagination andhasNextPage,
for the backward one, respectively, response fields can be ignored.I'm happy to contribute a fix for this.
urql version & exchanges:
Expected behavior
relayPagination()
returns allpageInfo
fields regardless of to query variables.Actual behavior
relayPagination()
returns only:endCursor
andhasNextPage
when query vars haveafter
startCursor
andhasPreviousPage
when query vars havebefore
The text was updated successfully, but these errors were encountered: