The pagination util function supports offset automatically, but the offset field needs to be added to the GraphQL schema params for each query for it to work. This is a general tracking issue, but someone should investigate to determine which queries and missing offset, and create an individual enhancement issue for each in the api-plugin-* repos.
@aldeed I was checking the queries and found out these pagination queries are missing offset params,
groups,
roles,
productsByTagId,
tags,
ordersByAccountId,
discountCodes,
surcharges,
getFlatRateFulfillmentRestrictions
I can work on adding the params to these queries once you confirm.
@trojanh looks good. Feel free to proceed if you can.
@trojanh Is anything forthcoming on this? We are using a front end framework to develop a reaction-commerce admin UI that only supports offset-, and not cursor-, based pagination so could definitely use this too. In terms of priority, entities with likely many objects are of course priority, so: tags, productsByTagId and ordersByAccountId in particular. Thanks.
thanks @focusaurus , I have started some work on this, should finish all of them soon @bayareacoder .
@focusaurus I think all the PRs above cover pretty much all remaining queries not having offset params, Please review these PRs and let me know if they look good.
@trojanh Thank you! Hopefully this can be merged soon and made available in a new Docker image for reaction-development-platform. We are running that to develop an own admin UI against the Reaction API. These changes will make the queries consistent so we can show better pagination controls for all entities.