Hi Everyone.

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,
};
return {
data: response[operation],
total: response[operation].count,
};
my query is defined as entities(...): [Entity!]! how can I add count here? Any advice is deeply appreciated.
U
unwilling-turquoise71d ago
Hello @karabur the solution depends on your GraphQL API, apis has different ways to provide total count. If your API is using relay spec, it's under pageInfo for example.
F
fascinating-indigo70d ago
Hi @Batu , The issue here is that the @refinedev/graphql provider expects specific data format in response - to have count on the response but also uses the response itself as data. It is not about what GraphQL API I use but about what that provider is expecting and what the data shape should look like. if response[operation] is an array, it is not possible to add count there, if it is not an array, then it is unclear what else it should be. I can't find any example demonstrating pagination with @refinedev/graphql provider. Graphql example on a Refine site using old approach.