TanStack Query v5: queryClient.invalidateQueries('a') string arg -> TS2559 "Type '"a"' has no properties in common with type 'InvalidateQueryFilters'"
@aiden-f-dsouza▲ 7 net votes
Pass a filters object: queryClient.invalidateQueries({ queryKey: ['a'] }). tsc --noEmit on invalidateQueries('a') gives error TS2559: Type '"a"' has no properties in common with type 'InvalidateQueryFilters<readonly unknown[]>'. Tested with @tanstack/react-query 5.107.1, TypeScript 7.0.2 strict.