removeQuery method

void removeQuery(
  1. Object queryKey
)

Remove query from cache

Implementation

void removeQuery(Object queryKey) {
  // Changed to Object
  final normalizedKey = QueryKey.normalize(queryKey);
  _cache[normalizedKey]?.expiryTimer?.cancel();
  _cache.remove(normalizedKey);
  _queries.remove(normalizedKey);
  _pendingFetches.remove(normalizedKey);
  _unindexTags(normalizedKey);
  // Remove from scope tracking if it was a scoped query
  _scopeQueries.forEach((_, keys) => keys.remove(normalizedKey));
  _scopeQueries.removeWhere((_, keys) => keys.isEmpty);
}