title: Apollo Client delete Item from cache
body: <p>Hy I'm using the Apollo Client with React. I query the posts with many different variables. So I have one post in different &quot;caches&quot;. Now I want to delete a post. So I need to delete this specific post from all &quot;caches&quot;.</p>
  <pre><code>const client = new ApolloClient({
      link: errorLink.concat(authLink.concat(httpLink)),
      cache: new InMemoryCache()
  });
  </code></pre>
  <p>Postquery:</p>
  <pre><code>export const POSTS = gql`
      query posts(
          $after: String
          $orderBy: PostOrderByInput
          $tags: JSONObject
          $search: String
          $orderByTime: Int
      ) {
          posts(
              after: $after
              orderBy: $orderBy
              tags: $tags
              search: $search
              orderByTime: $orderByTime
          ) {
              id
              title
              ...
          }
      }
  `;
  </code></pre>
  <p>I tried it with the cache.modify(), which is undefined in my mutation([https://www.apollographql.com/docs/react/caching/cache-interaction/#cachemodify][1])</p>
  <pre><code>const [deletePost] = useMutation(DELETE_POST, {
          onError: (er) =&gt; {
              console.log(er);
          },
          update(cache, data) {
              console.log(cache.modify())//UNDEFINED!!!
              cache.modify({
                  id: cache.identify(thread), //identify is UNDEFINED + what is thread
                  fields: {
                      posts(existingPosts = []) {
                          return existingPosts.filter(
                              postRef =&gt; idToRemove !== readField('id', postRef)
                           );
                      }
                  }
              })
          }
      });
  </code></pre>
  <p>I also used the useApolloClient() with the same result.</p>
  <p>THX for any help.</p>