---
title: "Discussion on \"Fix: Cache data may be lost when replacing the getAllPosts field of a Query object in Apollo client.\" | Hashnode"
description: "Discussion on \"Fix: Cache data may be lost when replacing the getAllPosts field of a Query object in Apollo client.\". Supposing we have a getAllPosts query that returns all posts. When we  perform a delete operation using the recently released Apollo v3 and uses refetchQueries to update our UI, we are greeted with this warning:\nCache data may be lost when replacing ..."
url: "https://hashnode.com/posts/fix-cache-data-may-be-lost-when-replacing-the-getallposts-field-of-a-query-object-in-apollo-client/5f8d81b7d58df13bb29172fe"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Fix: Cache data may be lost when replacing the getAllPosts field of a Query object in Apollo client.](https://dera.hashnode.dev/fix-cache-data-may-be-lost-when-replacing-the-getallposts-field-of-a-query-object-in-apollo-client?utm_source=hashnode&utm_medium=feed)

Supposing we have a getAllPosts query that returns all posts. When we perform a delete operation using the recently released Apollo v3 and uses refetchQueries to update our UI, we are greeted with this warning: Cache data may be lost when replacing ...

Oct 19, 2020 · 2 min read · dera.hashnode.dev  
Updated Aug 16, 2021  
Read the article

-   [#apollo](https://hashnode.com/tag/apollo)
-   [#react-native](https://hashnode.com/tag/react-native)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#docapollo](https://hashnode.com/tag/docapollo)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Chidera Paul Ugwuanyi](https://hashnode.com/@chidera)

@chidera · Aba, Abia State, Nigeria

  
[View profile](https://hashnode.com/@chidera)

React Native Developer

React native Developer, Life long learner, Jesus Christ lover.

## Responses 1

Markdown supported · ⌘↵ to post

[Schalk](https://hashnode.com/@Heizen)

[Jul 5, 2021](https://hashnode.com/posts/fix-cache-data-may-be-lost-when-replacing-the-getallposts-field-of-a-query-object-in-apollo-client/5f8d81b7d58df13bb29172fe/comment/60e2c5c703707d644a5047b6)

Thanks, was looking for this solution for 2 days now. Works like a charm.

[Chidera Paul Ugwuanyi](https://hashnode.com/@chidera)

[Jul 7, 2021](https://hashnode.com/posts/fix-cache-data-may-be-lost-when-replacing-the-getallposts-field-of-a-query-object-in-apollo-client/5f8d81b7d58df13bb29172fe/comment/60e2c5c703707d644a5047b6#reply-60e5a8dee9aeb8301a6a9ca7)

Glad it helped
