Open Paxol opened 2 months ago
I've somewhat considered this in the past, but I'm hesitant because it goes against the normal dataflow patterns in Blazor, React, etc. ("data down, actions up"). If there's a really compelling use-case I'd consider it, but can you achieve what you want using the existing Invalidate
/InvalidateAll
/InvalidateWhere
methods on Endpoint
?
Maybe the missing piece is something like the queryKey
in TanStack Query, that could be added to the QueryOptions
class.
Some type of "tag" could also be added in the query args, and than invalidate the query with InvalidateWhere
, but seams less elegant to me.
I think you can already do everything you could do with query keys just by using args here? IMO there's not much practical difference between adding a dummy arg in Phetch and adding an extra value to the query key in Tanstack - but I suspect InvalidateAll is actually what you'd want most of the time. Can you give a more specific example of the use case?
It would be useful to enable the parent component to refetch queries under specific conditions. This could be achieved by making the
UpdateQueries
method public, allowing the parent component to hold a reference toUseEndpointInfinite
(via@ref
) and trigger the update when needed.