Closed
Description
Proposed solution
- useQuery(key, fn, options)
+ useQuery({ querykey, queryFn, ...options })
- queryClient.invalidateQueries(key, filters, options)
+ queryClient.invalidateQueries(filters, options) // queryKey is part of `filters`
Also, provide a codemod to help with the transition
queryKey
should then also be required in the options
We also want to change the useQueries api (see #2923) for the full discussion. I'm moving the api change here because it should be part of the codemod, too:
- useQueries([ query1, query2 ])
+ useQueries({ queries: [ query1, query2 ] })