-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
relayStylePagination
read
method clobbers pageInfo.startCursor
and pageInfo.endCursor
#8267
Comments
Having the same issue, can't use |
So i just copied all implementation and replaced apollo-client/src/utilities/policies/pagination.ts Lines 101 to 102 in 54fe88a
By let { startCursor } = existing.pageInfo;
let { endCursor } = existing.pageInfo; |
This is a serious issue. Relay-style pagination is one of the core features offered by all GraphQL implementations, and is included in the official GraphQL docs. Can this please receive further attention? |
@migueloller @diracs-delta @meliborn Please have a look at this PR and let me know if it meets your expectations: #8438 |
Should fix #8267, taking inspiration from @migueloller's suggestion in #8267 (comment)
@benjamn Gave your PR a quick glance, it looks good to me. Glad it was (relatively) easy! I was just about to submit a PR earlier, but you beat me to it 😅 . TYSM! |
Should fix #8267, taking inspiration from @migueloller's suggestion in #8267 (comment)
…licy `read` functions (#8438) Should fix #8267, taking inspiration from @migueloller's suggestion in #8267 (comment)
Intended outcome:
With a query as follows:
I would expect
endCursor
to be the value returned from the API, not""
.Actual outcome:
Even though the API returns a valid cursor in
endCursor
, therelayStylePagination
type policy attempts to read it fromedges[0].cursor
(or the last edge's cursor) and completely replaces the one in `pageInfo.These should default to
pageInfo.{startCursor,endCursor}
and not""
.apollo-client/src/utilities/policies/pagination.ts
Lines 101 to 102 in cefb3c3
How to reproduce the issue:
Perform a query as described above while using
relayStylePagination
.The text was updated successfully, but these errors were encountered: