reaction icon indicating copy to clipboard operation
reaction copied to clipboard

Add offset pagination everywhere

Open aldeed opened this issue 4 years ago • 6 comments

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 avatar May 22 '20 15:05 aldeed

@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 avatar May 26 '20 09:05 trojanh

@trojanh looks good. Feel free to proceed if you can.

focusaurus avatar Jun 05 '20 19:06 focusaurus

@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.

bayareacoder avatar Jun 09 '20 22:06 bayareacoder

thanks @focusaurus , I have started some work on this, should finish all of them soon @bayareacoder .

trojanh avatar Jun 10 '20 05:06 trojanh

@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 avatar Jun 10 '20 06:06 trojanh

@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.

bayareacoder avatar Jun 10 '20 14:06 bayareacoder