Should data from useQuery ever be undefined for cache-hit in react? #2329
-
Hello, I have a question about how graphcache operates with react. Using debugger, I see the flow of a useQuery hook with a cacheHit go something like this: initial render -> data: undefined, fetching: true This same flow repeats each time I render the view. The expected behavior I have for a cache hit would be: Is the first scenario I described expected, or am I missing something? My assumption would be that the cache is read synchronously, and the data always defined if there is a cache hit. Thanks in advance for any comments, and for the continued work on this fantastic library 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hmm this should only occur if you have an asynchronous exchange in front of your cacheExchange |
Beta Was this translation helpful? Give feedback.
Hmm this should only occur if you have an asynchronous exchange in front of your cacheExchange