TanStackT
TanStack3y ago
5 replies
verbal-lime

Refetch all the queries on mutation

I am wondering how should I make this work
 const { data: employeeDetails } = api.employee.getEmployee.useQuery();
  const { mutate: signOut, isSuccess } = api.user.signOut.useMutation();
  const { data: offersReceived } = api.employee.getOffers.useQuery();
  const { data: latestPostedJobs } = api.post.getPosts.useQuery({
    latest: true,
  });
  const { data: jobsAppliedTo } = api.post.postsAppliedTo.useQuery();
  const { data: activeJobs } = api.employee.hiredTo.useQuery();

I wanna basically refetch all these queries after my mutation completes (for all)
Was this page helpful?