Replies: 1 comment 2 replies
-
I would need to see a minimal, standalone reproduction please. feels like something is off. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're developing a React Native application, where we want to cache queries to be viewed offline. The queries are persisted nicely with
createAsyncStoragePersister
and are immediately available when the user opens the app. The problem is that when we navigate to a screen with an infinite query the cached data is displayed and thequeryFn
is called. If the data has changed since the user last fetched it I'd expectqueryFn
to overwrite the returned data, but that is not the case. I confirmed thatqueryFn
ran and returned the correct data but the cache and data was not updated. (Neither in the app nor in the devtools)My query looks something like this:
Even while switching screens or changing filters the queryFn runs but the data just does not update at all, neither does the persisted cache (if I force quit the app it still shows the previously cached data). It seems like only
refetch
can update the query cache. Is this expected behavior? I didn't experience this with normaluseQuery
calls, only with infinite queries. Here is the query client config:Beta Was this translation helpful? Give feedback.
All reactions