writeOperation
suspend fun <D : Operation.Data> writeOperation(operation: Operation<D>, data: D, errors: List<Error>? = null, cacheHeaders: CacheHeaders = CacheHeaders.NONE, publish: Boolean = false): Set<String>
Writes an operation to the store.
Pass publish = true or call ApolloStore.publish with the returned keys to notify any watchers.
Return
the changed field keys
Parameters
operation
the operation to write
data
the operation data to write
errors
the operation errors to write
publish
whether to notify watchers of the changes
See also
suspend fun <D : Operation.Data> writeOperation(operation: Operation<D>, dataWithErrors: DataWithErrors, cacheHeaders: CacheHeaders = CacheHeaders.NONE, publish: Boolean = false): Set<String>
Writes an operation to the store.
Pass publish = true or call ApolloStore.publish with the returned keys to notify any watchers.
Return
the changed field keys
Parameters
operation
the operation to write
dataWithErrors
the operation data to write as a DataWithErrors object
publish
whether to notify watchers of the changes