watchFragment<TData, TVars> method Null safety

Stream<TData?> watchFragment<TData, TVars>(
  1. FragmentRequest<TData, TVars> request,
  2. {bool optimistic = true}
)

Watches for changes to data in the Cache for the given fragment.

Implementation

Stream<TData?> watchFragment<TData, TVars>(
  FragmentRequest<TData, TVars> request, {
  bool optimistic = true,
}) =>
    _watch(
      getChangeStream: () => fragmentDataChangeStream(
        request,
        optimistic,
        optimisticPatchesStream,
        optimisticReader,
        store,
        typePolicies,
        addTypename,
        dataIdFromObject,
        possibleTypes,
      ),
      getData: () => readFragment(request, optimistic: optimistic),
    );