Paging with FetchMore() does not update apollo graphql

Hi guys, I’m starting now with graphql and I’m trying to do a pagination with apollo graphql. However, after fetching with FetchMore() using start and limit, my graphql doesn’t update. I don’t know if it’s relevant but I’m using the strapi as a backend.

note: I can see the query arriving correctly in the browser but it doesn’t list the new results.

Could you share more details about how you’re rendering the data, and what the backend schema looks like?

Hi @Dylan_Wulf, data is coming from Strapi CMS.

response

Currently I managed to make it work, using updated_query but it is warning that the functionality will be deprecated.

I’m using this query:

query

Currently, type Policies are not being used or do not work correctly.

Ok, you have two problems here. The first problem is that your type policy is using the field name Events, when your actual field name is called eventsConnection. Your second problem is that the default offsetLimitPagination helper function only works if the field that accepts the arguments is the one that returns the array. In this case your backend schema is different than what the default offsetLimitPagination function expects, so you’ll need to write your own type policy. The code for the default offsetLimitPagination function is located here in case you want to reference it: apollo-client/pagination.ts at main · apollographql/apollo-client · GitHub