Refetch polling with large amounts of data in the response
One of my endpoints returns a large amount of data. I want to occasionally poll it for changes, but I don't like how I get ALL of the data even when nothing has changed.
I've been thinking about redesigning so that I use 2 queries, one for the polling which would watch for a change state return (small payload) which would then trigger a full pull. But this doesn't seem like an ideal practice.
I don't have a lot of control over the endpoints, so I can't really redesign the API to send less data without causing lots of drama.
Is there any recommendation for this? I would love to see a param in
useQuery
that would let me sepcify the queryFn
separate from the pollFn
Maybe I could combine the logic into a single queryFn? Unsure if that's wise...0 Replies