How to refetch useQuery with different input
Hi!
I have a query run with useQuery in a parent component, and in a child component which just contains a react-hook-form with some options for filtering. The tRPC endpoint has some optional inputs for filtering the query, the thing is I want to handle the submit of the filter form in the child component and re run the query but with new inputs added, how can I do that?
I tried using the utils from the api.context and using the refetch, but that didn't make my data refresh. Maybe is worth noting that my parent component useQuery is using this flags:
refetchOnMount: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
2 Replies