acronie
acronie2y ago

Requests running multiple times after it's failing

Solution:
Query Retries | TanStack Query Docs
When a useQuery query fails (the query function throws an error), TanStack Query will automatically retry the query if that query's request has not reached the max number of consecutive retries (defaults to 3) or a function is provided to determine if a retry is allowed. You can configure retries both on a global level and an individual query ...
Jump to solution
3 Replies
acronie
acronieOP2y ago
I am not sure why this is happening? this is where my request lies
export function Sidebar() {
const [isHovering, setIsHovering] = useState(false);
const { data: user } = api.user.me.useQuery();
export function Sidebar() {
const [isHovering, setIsHovering] = useState(false);
const { data: user } = api.user.me.useQuery();
Solution
Alex / KATT 🐱
Query Retries | TanStack Query Docs
When a useQuery query fails (the query function throws an error), TanStack Query will automatically retry the query if that query's request has not reached the max number of consecutive retries (defaults to 3) or a function is provided to determine if a retry is allowed. You can configure retries both on a global level and an individual query ...
acronie
acronieOP2y ago
Ah ha Got it

Did you find this page helpful?