Invalidating queryKey with variable doesn't work
Hi guys,
I'm encountering issues when trying to invalidate queries with a variable in the query key during the onSettled of a useMutation.
Basically trying something like this (with version
When I hardcode the id into the key directly, it works fine, but not when using the variable. Is this a bug or is that simply not possible?
Is there some other way I can achieve the same effect?
I'm encountering issues when trying to invalidate queries with a variable in the query key during the onSettled of a useMutation.
Basically trying something like this (with version
5.84.1):Something has a prop id, when logging the variables in onSettled I do get a result.When I hardcode the id into the key directly, it works fine, but not when using the variable. Is this a bug or is that simply not possible?
Is there some other way I can achieve the same effect?