Partial matching of key in setQueryData #394
-
Hi there, I've just bumped into a weird behavior. I don't know if it's by design and expected. Here's a minimal example https://codesandbox.io/s/sweet-goldwasser-62fhv?file=/src/App.js We have three
If you click on So my question here - is partial matching by default is a feature or a bug? In my real code when I bumped into this was that I misspelled the name of the variable |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Partial matching is a feature that is baked into all of the queryCache functions that search the cache to find queries. though it may not make much sense for The fact that this came by surprise to you is a good indicator that we should probably not make |
Beta Was this translation helpful? Give feedback.
-
@tannerlinsley Hey, you're about to release v2 soon. Let me remind you about this topic. Did you change the partial matching queries? |
Beta Was this translation helpful? Give feedback.
-
I will fix set query data to be exact by default in the next release. |
Beta Was this translation helpful? Give feedback.
Partial matching is a feature that is baked into all of the queryCache functions that search the cache to find queries. though it may not make much sense for
setQueryData
, it does for things likerefetchQueries
.The fact that this came by surprise to you is a good indicator that we should probably not make
setQueryData
a partial matching function.