watch

Gets initial response(s) then observes the cache for any changes.

There is a guarantee that the cache is subscribed before the initial response(s) finish emitting. Any update to the cache done after the initial response(s) are received will be received.

fetchPolicy controls how the result is first queried, while refetchPolicy will control the subsequent fetches.

See also


fun <D : Query.Data> ApolloCall<D>.watch(data: D?): Flow<ApolloResponse<D>>

Observes the cache for the given data. Unlike watch, no initial request is executed on the network. The fetch policy set by fetchPolicy will be used.


Deprecated (with error)

Exceptions no longer throw

Replace with

watch()