Skip to content

remove overloads #2918

Closed
Closed
@TkDodo

Description

@TkDodo

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 ] })

Metadata

Metadata

Labels

v4wontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions