nursing-limeN
Refine2y ago
4 replies
nursing-lime

Pagination with @refinedev/graphql provider

Hi Everyone.
I am building some CRUD pages in our product and found Refine to be a great fit for our case.
With that, I am having an issue - I am using @refinedev/graphql provider, and can't figure out how to make pagination work.

My list query returns an array of entities, and I don't see a way to add count variable.
it is used here in provider
          return {
                data: response[operation],
                total: response[operation].count,
            };

Which looks quite weird, I would expect it to have something like data: response[operation].data, I dont see how that could ever work with current code.

data expected to be an array, and count will be always undefined.
Any working example of pagination with @refinedev/graphql or other advise would be greatly appreciated.

So far I ended up with workaround of patching getList with a wrapper method which takes data which is actually a paginated data, with two fields - list of values and total count, and "extracts" from there, returning proper values. Not an ideal solution
Was this page helpful?