Stylianos Gakis05/17/2022, 1:41 PM
. To keep behavior unchanged, set a
on your watchers:” But the snippet directly under it shows
. Is this wrong in the sense that it should be
instead, or should the title of the section be
? I am kinda confused at that part of the document.
mbonnin05/17/2022, 6:32 PM
... Fix there: https://github.com/apollographql/apollo-kotlin/pull/4118/files
Stylianos Gakis05/18/2022, 6:31 AM
just do nothing?
mbonnin05/18/2022, 6:58 AM
Looking at the code, watch internally does a toFlow() and then emits the response directly.That's for the initial response only. If you follow the code, you'll see another lower level
that watches for changed keys in the store
if we had not configured any cache (http or normalized) would aIt would return thejust do nothing?
response once and that's it.
And only after that it does the copy() with the cache_only policy.Ah, sorry I missed that part. There are 2 things:
Stylianos Gakis05/18/2022, 7:03 AM
mbonnin05/18/2022, 7:03 AM
Stylianos Gakis05/18/2022, 7:05 AM
mbonnin05/18/2022, 7:07 AM
Stylianos Gakis05/18/2022, 7:15 AM
used in that function? Just looking at the function signature I assume you pass what the first emission of watch will return, and from then on it will return all cache changes, but I am not sure. And as a side note, In all the times I had to use a watch myself, I did in fact want the behavior of fetch once, and listen after, but I imagine there are other use-cases that don’t have the same requirements. But we’re not relying super much on caching in general, so there’s that.
mbonnin05/18/2022, 7:41 AM
is used to get the initial set of keys to watch for