So, I am using the same query in 2 places. In one place I want to get more results on scroll in the search component and because relayStylePagination does read and merge I get the wanted result.
const cache = new InMemoryCache({
typePolicies: {
Query: {
fields: {
users: relayStylePagination(),
},
},
},
});
But I am using the same Query to get users in a paginated list with 15 results and on click on number 2 page I want another 15 results but instead I get 30 because they get merged.
Has anyone had the same problem and what are some possible solutions? Best Regards.
It sounds like you're describing an offset which would require a different query to accomplish this: https://www.apollographql.com/docs/react/pagination/offset-based
This way you can provide the amount of already-queried results and only return the limited quantity needed.