TanStackT
TanStack3y ago
3 replies
verbal-lime

Invalidating Queries doesn't send a request

I'm using TRPC, which is using react-query. For some reason getWebsites does not invalidate when invalidate is called. TRPC's invalidate is using queryClient.invalidateQueries

I have the following code snippet:
const websites = trpc.website.getWebsites.useQuery(undefined, {
    enabled: isAuthenticated,
  });
 const updateWebsite = trpc.website.updateWebsite.useMutation({
    onSuccess: async () => {
      await utils.website.getWebsites.invalidate();
      // this doesnt send a request for some reason, even if I removed the enabled option on websites
    },
  });
image.png
Was this page helpful?