0

All of mine queries showing the 'paused' status.

Even though the 'enable' flag is true.

Here is the screen of how devtools look like

and the hook that calling the query

import { useQuery } from "@tanstack/react-query";

const getWordInfo = async (word: string) => {
  const res = await fetch(`${import.meta.env.VITE_API}/api/conjugations/${word.trim()}`);
  const data = await res.json();

  if (!data.isSuccess) throw Error(data.message || "Server Error");

  return data;
};

export const useConjugation = (word: string) => {
  const {
    data: wordInfo,
    isFetching,
    isError,
    isSuccess
  } = useQuery<any>(["conjugations", word], async () => await getWordInfo(word), {
    enabled: !!word,
    retry: true,
    refetchOnWindowFocus: false
  });

  return { data: wordInfo, isSuccess, isFetching, isError };
};

backend working properly, tested it with postman. 'word' argument is passing properly, so the 'enable' flag is true (also seen at the screenshot)

Tried to play around the enabled flag, but that doesn't help. Also updated the package to the latest stable, also no luck

1 Answers1

0

According to the docs, this is because you do not have a network connection.

Anton
  • 1,045
  • 1
  • 7
  • 16