TL;DR;
Is there a way to access mutation response before it is written to cache?
The actual use case is a mutation that creates a client object and returns the new client ID and secret. I want to be able to show the secret during the creation flow, but I don’t want to store it in the cache.
I could use merge()
function to strip the secret to guarantee it will never be cached, but then the data object from the mutation response that is available to the caller component will not contain the secret either.
The only solution I see is to use the data object as is, pick client secret and remove it from the original object, then update the cache manually.
Are there any better options?