Skip to content

Commit 2670c15

Browse files
committed
📝 Clarify that updateQueryData does not create new cache entries
1 parent 8509dcd commit 2670c15

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/rtk-query/usage/manual-cache-updates.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ Use cases for manual cache updates include:
3636
- Debouncing a large number of mutations with immediate feedback as though they are being
3737
applied, followed by a single request sent to the server to update the debounced attempts
3838

39+
:::note
40+
`updateQueryData` is strictly intended to perform _updates_ to existing cache entries,
41+
not create new entries. If an `updateQueryData` thunk action is dispatched that corresponds to
42+
no existing cache entry for the provided `endpointName` + `args` combination, the provided `recipe`
43+
will not be called, and no `patches` or `inversePatches` will be returned.
44+
:::
45+
3946
## Recipes
4047

4148
### Optimistic Updates

0 commit comments

Comments
 (0)