-
Just like with The use case is I want to disable refetching when the query fails and I want to be able to do this by setting the QueryClient defaults. I want previously successful queries to (by default) refetch on focus. I have no interest in queries that previously failed being refetched every time the user comes back to my window and trigger the exact same error. The only way to accomplish this today is to |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
yeah I think that makes sense. I can look into making more options accept a function, or do you want to? For the use-case you are describing, error boundaries also seem like they could do the job nicely, as they will actually unmount the query and thus it will not be refetched. Once the user resets the error boundary, it would start fetching again. Maybe the first thing to look at would be the |
Beta Was this translation helpful? Give feedback.
-
@jcready I would be okay to do this now. what would be the best API in your opinion. I'm currently leaning towards:
so passing only data and query in, and I'm just a bit worried here that every function that we do has a slightly different interface. What do you think? |
Beta Was this translation helpful? Give feedback.
-
it's done: https://github.com/tannerlinsley/react-query/releases/tag/v3.37.0 |
Beta Was this translation helpful? Give feedback.
it's done: https://github.com/tannerlinsley/react-query/releases/tag/v3.37.0