title: Remove query from cache without refetching react query
body: <p>I am using react query in my react app this way</p>
  <pre><code>    const { data, status } = useQuery(key, queryFunc, { staleTime: 1 * 60 * 1000 });
  </code></pre>
  <p>I want to be able to invalid a certain key in cache based on data value, basically when data is null, so I added an effect</p>
  <pre><code>useEffect(() =&gt; {
     if (data === null) {
       queryClient. invalidateQueries(key)
     }
  }, [data])
  </code></pre>
  <p>This approach will cause a request loop where an invalidated query will refetch, get null as response, effect executes and invalidates and so on so on...</p>
  <p>I want to be able to remove the key from cache without refetching, so I don't end up in this infinite requests loop, been digging into the react query docs but no luck. Anyway had a similar case with react query where key needs to be removed from cache without refetch?</p>