call<T> method

CachedCall<T> call<T>(
  1. String key,
  2. Future<T> fetch(), {
  3. required ApiCacheCodec<T> codec,
})

Wraps a read whose answer codec turns into text and back.

key identifies the request and must include everything that changes its answer: an operation name and its variables, a URL and its body.

Implementation

CachedCall<T> call<T>(
  String key,
  Future<T> Function() fetch, {
  required ApiCacheCodec<T> codec,
}) =>
    CachedCall((strategy) => _serve(key, fetch, codec, strategy));