Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda