Return previous state if no data

Hi,

I want to return the previous state if theres a network error. Can I do that by overriding the root operation type in my cache object?

if (loading) { 
  const data = prevState() // or something  

  return (
    ...
  )
} 

@endymion1818 if you’re using something like useQuery, the returned result object has a previousData property.

1 Like