FetchQuery with "network-only" is not ephemeral.
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hi team,
I was wondering if you could help me with an issue that I have with `fetchQuery`
We have a very custom component that uses fetchQuery to get the data from the server, and then we manually take the connection edgess and update different connection. (There is some reason for this madness, we are implementing quite complicated component that tries to paginate and expand/collapse tree - imagine file system with folders).
I use the fetchQuery with cache-config parameter "network-only". When this query is fetched for the first time, everything works. When I fetch it for the second time (with the same parameters), it however reaches out to cache and tries to reconcile data with the previous request.
When I try to debug things, what I see is that the `update` on the ConnectionHandler is behaving differently for the first call and for the second one:

In the first run, the clientConnection is undefined, but for the second time, it is already defined. That is quite surprising, because I would expect that the first request is ephemeral and calling the same query multiple times will always behave like it was called for the first time.
I even set the gcReleaseBufferSize to 0 with hope it will be garbage collected, but for some reason it keeps hanging around.
Do you have any tips how to get the store to the state before the request was made so that relay thinks when I call it again, it's being called for the first time?
Contributor guide
Assessment
This issue has not been assessed yet.