As you can see here, I used useQuery() but I only want it to fetch once. Not sure if it is NextJS problem or react-query problem.
NextJS and react-query
1.2k Views Asked by Kai Sheng Tung At
2
There are 2 best solutions below
0
On
react-query does query retries out of the box. See the docs here. It is possible to disable it, passing { retry: false } as options to useQuery() hook.

Without code is hard to evaluate, but this works fines for me in NextJS. Probably the problem is where you're calling
useQueryhook