graphql cursor pagination; cursor changing on new entries #24818
-
The cursor I get back appears not to be persistent; the entry a given cursor refers to is always the first entry. If the list updates, the same cursor will refer to a new entry. This makes it impossible to fetch new entries based on cursor; and if the list updates while I’m paging through it, this could cause me to miss items (even if I wanted to pull the full list every time, which I most emphatically do not :slight_smile: I’ve got a query like:
and I get a result like
If I then create a new repo, to generate an audit entry, and re-run the query:
Note that I get the same cursor range (…E= to …Ew) but they refer to a different set of entries. It’s as if the cursors are just indices into the list, and as new entries are added to the front of the list, the cursors change. The first entry is always |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think I’ve figured this out myself; if I add an orderBy to my request, I can sort them ascending by date and it solves this issue:
|
Beta Was this translation helpful? Give feedback.
-
@sfc-gh-mmacintyre does it solves the issue which mean cursor is persistent? |
Beta Was this translation helpful? Give feedback.
I think I’ve figured this out myself; if I add an orderBy to my request, I can sort them ascending by date and it solves this issue: