Describe the bug
If you create a Query widget with FetchPolicy.cacheOnly and that widget renders before the cache is populated with the corresponding key, the widget does not ever re-render. This does not occur when the value is already in the cache when the widget first renders.
To Reproduce
Steps to reproduce the behavior:
FetchPolicy.cacheOnlyinitState), call client.query with the same QueryOptionsExpected behavior
The Query widget with FetchPolicy.cacheOnly should re-render whenever the cache is updated, regardless of whether the contents were in the cache at initial render.
Additional context
I think this may be related to #290.
I think this is probably because I'm throwing an exception if cacheOnly yields nothing, which:
lifecycle from being updatedIf I'm right, adding an optimisticResult with an OptimisticCache would be a viable workaround for now
@micimize I will try out the workaround!
I think I'm wrong, to some extent - the Exception gets caught and transformed into a GraphQLError
I think this is probably fixed in 4.0.0-beta.1 given the rebroadcasting rework. If @yunyu or anyone else still has this issue on v4 comment and I'll reopen