Is it a bad approach to update query state directly? #7166
-
Hello, To give more context: I have a query which uses a I have a mutation which runs a function to update the explained queries cache in onMutate callback. Now, up until this point everything is fine. For now my workaround is the following: const result = queryClient.getQueryCache().find({
queryKey: ['cart'],
exact: false,
})
result.setState(data) By setting data in the query state, I am able to re-trigger Is interacting with query state incorrect? Or should not be used? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Please show a reproduction because this should just work. |
Beta Was this translation helpful? Give feedback.
Please show a reproduction because this should just work.