T
TanStack2y ago
stormy-gold

See if data came from the data persister or from server

Is there a way to see if the query data came from the data persister or the server? I would like to show a warning to the user if the data came from LocalStorage.
2 Replies
sharp-indigo
sharp-indigo2y ago
we don't differenciate where data comes from. In onSuccess of the PersistQueryClientProvider, you could amend all data in the cache with that information.
stormy-gold
stormy-goldOP2y ago
It would be difficult to get that to work with TypeScript wouldn't it? Don't believe there is a way to tell typescript that all data returned from the query client includes that information

Did you find this page helpful?