Closed ryguyk closed 2 weeks ago
Yah pagination was out of scope of the original. Was supposed to be a copy and move
But that original scope assumed that specifying the number of results in the query actually worked and was not hard coded to 50. Sorry you had to make that discovery Ryan.
@swirtSJW @jilladams @ryguyk – a few questions related to sprint planning:
Per latest comments and considering age of the ticket, I'm closing.
See #8199. We should add support for queries to be written in JSON:API (in addition to GraphQL).
This was largely done - at least workably - in initial work on #8199, but then scrapped due to growing scope. Part of that growing scope is the page size limitation (50 results). In itself, this should not be too difficult to handle. This can be accomplished doing something like below:
However, this has some drawbacks. First, the paged results are fetched in series rather than in parallel. It'd be better to grab the total results on the first fetch, then fetch the remaining pages in parallel, constructing queries based on the total-results count.
Second, this will seemingly result in duplicated entries in the
included
array. It might be useful to remove these duplicates, but it might also not be necessary. If the logic to reference these included items is to simply find the first matching item, it might be wasted processing time to worry about removing duplicates.It will likely be worthwhile to explore existing node.js libraries for dealing with JSON:API. If none are suitable, a small custom library should likely be developed.