typedefT
tRPC3y ago
14 replies
typedef

useContext not Invalidating

What are the possible mistakes if useContext wont invalidate when doing the following:
const utils = trpc.useContext();
const user = trpc.user.getUser.useQuery();
const updateUser = trpc.user.updateUser.useMutation({
  onSuccess: () => {
    utils.user.getUser.invalidate();
  }
});


Used to work before but stopped working when I turned my entire repo to turborepo.
Was this page helpful?