-
Currently when dehydrating a query store, stale time is not part of the state so it's not included. So if there's a query with longer stale time than the default, it will actually refetch earlier than intended, depending on whether it was fetched on the server or not. A solution could be adding serializeOptions and deserializeOptions in dehydrate/hydrate. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
those already exist as |
Beta Was this translation helpful? Give feedback.
it’s an extra option on
fetchQuery
to indicate that you only want to execute a fetch when data is older than the passedstaleTime
. In that sense,fetchQuery
might not trigger thequeryFn
(ironic, I know) but it can just return cached data.That’s what
staleTime
of 5 minutes onfetchQuery
should achieve ...again, staleTime doesn’t matter until data gets observed, so this shouldn’t ma…