writeFragment

suspend fun <D : Fragment.Data> writeFragment(fragment: Fragment<D>, cacheKey: CacheKey, data: D, cacheHeaders: CacheHeaders = CacheHeaders.NONE, publish: Boolean = false): Set<String>

Writes a fragment to the store.

Pass publish = true or call ApolloStore.publish with the returned keys to notify any watchers.

Return

the changed field keys

Parameters

fragment

the fragment to write

cacheKey

the root where to write the fragment data to

data

the fragment data to write

publish

whether to notify watchers of the changes

See also