UseQueryOptions without providing a required `queryKey`
hello, is there a way to use UseQueryOptions without providing a required
queryKey? im upgrading to v5 and in v4 this was never required. I am using a custom hook with react query
3 Replies
extended-salmon•2y ago
Omit<UseQueryOptions<Group>, 'queryKey'>
but my advice is to not allow passing all options in, only the ones you really need. enabled is just a boolean so enabled: boolean will do
UseQueryOptions actually has 4 generics so you might get into other issues with that approachextended-salmonOP•2y ago
yeah I ended up using Omit
thanks
1 more quick question, we can just keep the optimistic updates as in 4 right? no need to change to the v5 ""way"?
as in onMutate, onError etc
extended-salmon•2y ago
yes