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

380
Visualizações
Will my combined graphql queries in apollo-client cache correctly? And if not, how can I make it possible?

My page requests json files from my backend. Often more than 10 files are queried at the same moment. My current setup uses a query that looks like this:

query
{
  someFiles(ids: [ 'id1', 'id2', 'id3', '...' ]
  {
    data
  }
}

My page would greatly benefit from caching these requests. However, I'm not sure if the resulting files will be cached correctly if I request new data with e.g. a different order of ID's. How can I request multiple files at once and still benefit from client side caching of each seperate file/id combination?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When reading/writing to Apollo Client cache you can use GraphQL fragments to use a more "random access" to your cached data than readQuery/writeQuery, the Apollo doc on Reading and writing data to the cache has more info on readFragment/writeFragment.

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