TanStackT
TanStack3y ago
5 replies
verbal-lime

InvalidateQueries of multiple keys

If I have a query such as this:

const todoListQuery = useQuery({
queryKey: ['todosFull', 'todoSpecific'],
queryFn: fetchTodoList,
})

and then I invalidate the query with queryClient.invalidateQueries({ queryKey: ['todoSpecific'] })

Should that work? or do I need to do queryClient.invalidateQueries({ queryKey: ['todosFull', 'todoSpecific'] }) for it
Was this page helpful?