executeFetch method

  1. @protected
Future<void> executeFetch({
  1. bool cancelRefetch = false,
  2. Object? meta,
})

Runs the query's fetch with this observer's options; the error, if any, lands in the query's state and is never rethrown.

cancelRefetch defaults to false: only an explicit refetch cancels a fetch that is already running.

meta rides along into QueryState.fetchMeta; infinite queries put the page direction there.

Implementation

@protected
Future<void> executeFetch({bool cancelRefetch = false, Object? meta}) async {
  _updateQuery();
  try {
    await _currentQuery.fetch(
      options: _options.queryOptions,
      fetchOptions: FetchOptions(
        cancelRefetch: cancelRefetch,
        meta: meta,
      ),
    );
  } catch (_) {
    // The error is in the query's state; an observer never rethrows it.
  }
}