Skip to content

Commit c95c5af

Browse files
authored
Allow different types of fetches on a watcher
Publicly exposing the fetch() function would allow us to make other kinds of fetches besides the `fetchIgnoringCacheData` exposed by `refetch()`. Our use case is that our custom version of `InMemoryNormalizedCache` has cache expiration, and we want to be able to hit the network only if the cache has become invalid. Alternately, we could manually check the cache, but this seems cleaner.
1 parent 9630b6e commit c95c5af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/Apollo/GraphQLQueryWatcher.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class GraphQLQueryWatcher<Query: GraphQLQuery>: Cancellable, Apollo
4343
fetch(cachePolicy: .fetchIgnoringCacheData)
4444
}
4545

46-
func fetch(cachePolicy: CachePolicy) {
46+
public func fetch(cachePolicy: CachePolicy) {
4747
fetching.mutate {
4848
// Cancel anything already in flight before starting a new fetch
4949
$0?.cancel()

0 commit comments

Comments
 (0)