+- React Query uses query key generation, query variables, and implicit query groups. The query key and variables that are passed to a query are less URL-based by nature and much more flexible. Both the key (todos) and any variables ({ status: 'done' }) are used to compute the unique key for a query (and it's done in a very stable, deterministic way). This also allows you to use query "groups" when defining query refetching configs, eg. you can refetch every query that has a `todos` key, regardless of variables, or you can target specific queries with (or without) variables. This architecture is much more robust and forgiving especially for larger apps.
0 commit comments