A query key is an array of values that identifies a TanStack Query query and its parameters. Use a single string for flat data, or add an object for identifiers, pagination, or filters. section 9.3.2
Choose key shapes that preserve the distinctions your cache must track:
- ["customers"] identifies the complete customer list. section 9.3.2
Invalidating related customer data
After deleting a customer, invalidate the partial key ["customers"] to refresh customer-list queries, then invalidate ["customer", { id }] for the deleted record without discarding every individual-customer query. section 9.3.2

