onQueryUpdate

open fun onQueryUpdate(variable: S, data: T): QueryEffect?

Function to update the query cache after the mutation is executed.

This is often referred to as "Pessimistic Updates".

override fun onQueryUpdate(variable: PostForm, data: Post): QueryEffect = {
invalidateQueriesBy(GetPostsKey.Id())
}

Parameters

variable

The variable to be mutated.

data

The data returned by the mutation.