Reaction: Add offset pagination everywhere

Created on 22 May 2020  路  6Comments  路  Source: reactioncommerce/reaction

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.

enhancement help wanted

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

focusaurus picture focusaurus  路  4Comments

mikemurray picture mikemurray  路  4Comments

Eduard-Hasa picture Eduard-Hasa  路  4Comments

aldeed picture aldeed  路  4Comments

spencern picture spencern  路  3Comments