From 7d08204bf8c2d4ab2f8dfd0182300e514ef9b0df Mon Sep 17 00:00:00 2001 From: Hesham Salman Date: Fri, 23 Jun 2023 12:16:49 -0400 Subject: [PATCH] Refetch --- Sources/Apollo/GraphQLPaginatedQueryWatcher.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Apollo/GraphQLPaginatedQueryWatcher.swift b/Sources/Apollo/GraphQLPaginatedQueryWatcher.swift index 55a1ae8692..74c1e5bec3 100644 --- a/Sources/Apollo/GraphQLPaginatedQueryWatcher.swift +++ b/Sources/Apollo/GraphQLPaginatedQueryWatcher.swift @@ -39,7 +39,7 @@ public final class GraphQLPaginatedQueryWatcher { /// Fetch the first page /// NOTE: Does not refresh subsequent pages nor remove them from the return value. public func fetch(cachePolicy: CachePolicy = .returnCacheDataAndFetch) { - watchers.first?.fetch(cachePolicy: cachePolicy) + watchers.first?.refetch(cachePolicy: cachePolicy) } /// Fetches the first page and purges all data from subsequent pages. @@ -87,7 +87,7 @@ public final class GraphQLPaginatedQueryWatcher { guard let index = strategy.pages.firstIndex(where: { $0 == page }), watchers.count > index else { return } - watchers[index].fetch(cachePolicy: cachePolicy) + watchers[index].refetch(cachePolicy: cachePolicy) } /// Cancel any in progress fetching operations and unsubscribe from the store.