Mutating a state within onComplete callback

I am using useLazyQuery, and i am mutating a state within onComplete callback, it does not mutate the state.

To be more precise, it does not mutate the state, when the query result is already in the cache. (the state is mutated when the data request is not yet saved in the cache).

onComplete does indeed bring the right data within the callback, but useStateAction does not mutate the state.

When i added to the params "fetchPolicy: “network-only”… the state now is mutating correctly.

I also could solve the issue with async/await approach. there is some issue with onComplete callback.