React query Refetching on page change

let { data: orders, isLoading, isFetching, isError, error, refetch } = trpc.order.getallcart.useQuery(undefined, { retry: 1 });


I am using this code ( react query + trpc) , i want whenever i change links , router , the query should rerun and new data should come from the database but it is not happening , i tried various refetching methods but none of them worked , anyone who can suggest something
Was this page helpful?