To make things simple, a Cursor is a almost like a pointer in the array of data (edges), and every element of an array (edge) has it's own cursor that you can point at and ask (give me X items after this cursor or before this cursor).
Let's say that we have 30
stockActivities and start by asking for the first 10 elements:
We already know the pointer (cursor) of the last element in the array of results, so we can simply ask for the first 10 elements after that pointer
We already know the pointer (cursor) of the first element in the array of results, so we can simply ask for the last 10 elements before that pointer
You can use
after to navigate however you want in the data, and it gives you precise results based on your choice.
- You can ask for the first 2 elements after the 5th element in the current result
- You can ask for the last 5 elements before the 2nd element in the current result