Builds a query key array for an entire API group.
Use this with queryClient.invalidateQueries() to invalidate all cached queries belonging to a group at once.
queryClient.invalidateQueries()
The API group name (e.g. 'todos').
'todos'
A readonly query key array that is a prefix of all endpoint keys within the group.
buildGroupQueryKey('todos');// ['@cleverbrush', 'todos']// Invalidate all todo-related queries:queryClient.invalidateQueries({ queryKey: buildGroupQueryKey('todos') }); Copy
buildGroupQueryKey('todos');// ['@cleverbrush', 'todos']// Invalidate all todo-related queries:queryClient.invalidateQueries({ queryKey: buildGroupQueryKey('todos') });
Builds a query key array for an entire API group.
Use this with
queryClient.invalidateQueries()to invalidate all cached queries belonging to a group at once.