FetchPolicyTypedLink constructor

FetchPolicyTypedLink({
  1. required Link link,
  2. Cache? cache,
  3. Map<OperationType, FetchPolicy> defaultFetchPolicies = const {},
})

Implementation

FetchPolicyTypedLink({
  required Link link,
  Cache? cache,
  Map<OperationType, FetchPolicy> defaultFetchPolicies = const {},
}) : defaultFetchPolicies = {
        ..._defaultFetchPolicies,
        ...defaultFetchPolicies
      } {
  /// Set default cache if none is provided
  this.cache = cache ??= _defaultCache = Cache();

  _optimisticLinkTypedLink = TypedLink.from([
    const OptimisticTypedLink(),
    GqlTypedLink(link),
  ]);
  _cacheTypedLink = CacheTypedLink(this.cache);
}