Tanstack Query pattern: 1


Tanstack Query pattern:
1. Colocate related queries and mutations
2. Centralize queryKeys

If a query sets a key, and a mutation invalidates the same key, they probably belong in the same file.

Example: This contains related queries and mutations and centralizes queryKeys.

View original on X