4 ms·
I think you misunderstood the issue. Of course you will use variables for the pagination itself, the issue is that your head of line query will be grabbing othe
by masklinn 5y ago
I think you misunderstood the issue. Of course you will use variables for the pagination itself, the issue is that your head of line query will be grabbing other fields than the paginated one.
You don't want to repeat these fetches in the followup queries, they're redundant, and assuming the API is rate-limited they will decrease your query budget for no value.
That counts double if you're fetching multiple paginated fields (which also adds to the awkwardness).
- searchableguy 5y agoI think I got what you are saying now. If you want to get paginated children nodes, then the root will be fetched again which is a problem.
- masklinn 5y agoIndeed. It may not be a huge problem depending on how much data you need, but there are lots of cases where you'd really rather avoid refetching the rest of the root. TBF you could also deal with it using fragments I think, but still, not great.
- obi1kenobi 5y agoAgreed — consider what happens when you have a node(start: Int, limit: Int) inside or alongside another such node with start and limit. Your pagination is now two-dimensional, with each node's start/limit as points on its own axis. Now add a third node to the query. Now you have three-dimensional pagination. This quickly goes off the rails. Try writing a generic N-dimensional paginator for such a query to see why it's difficult. Even designing a sensible and reasonably flexible API for one is a headache.