TanStackT
TanStack3y ago
2 replies
wet-aqua

Proper way to invalidate multiple queries?

I'm looking to setup an invalidation of two queries when the data changes.

This is what I'm currently doing in my application and it works, but is there a way to combine this?
    onSettled: () => {
      queryClient.invalidateQueries({
        queryKey: ['get-sent-follow-requests'],
      });

      queryClient.invalidateQueries({
        queryKey: ['get-follow-requests'],
      });
    },
Was this page helpful?