Skip to content

Commit

Permalink
Refetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Iron-Ham committed Jun 23, 2023
1 parent 7fa6f54 commit 7d08204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Apollo/GraphQLPaginatedQueryWatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class GraphQLPaginatedQueryWatcher<Strategy: PaginationStrategy> {
/// 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.
Expand Down Expand Up @@ -87,7 +87,7 @@ public final class GraphQLPaginatedQueryWatcher<Strategy: PaginationStrategy> {
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.
Expand Down

0 comments on commit 7d08204

Please sign in to comment.