onMutateEffect

open fun onMutateEffect(variable: S, data: T): Effect?

Function to handle side effects after the mutation is executed.

This is often referred to as "Pessimistic Updates".

override fun onMutateEffect(variable: PostForm, data: Post): Effect = {
queryClient.invalidateQueriesBy(GetPostsKey.Id())
}

Parameters

variable

The variable to be mutated.

data

The data returned by the mutation.