Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
relayStylePagination in inMemoryCache problem when using the same Query multiple times Apollo3

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!