diff --git a/ApolloCombine.podspec b/ApolloCombine.podspec index 6a0c101..5af9cbc 100644 --- a/ApolloCombine.podspec +++ b/ApolloCombine.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.source_files = 'Sources/ApolloCombine/*.swift' s.weak_frameworks = 'SwiftUI', 'Combine' - s.dependency 'Apollo/Core', '~> 1.5' + s.dependency 'Apollo/Core', '~> 1.9' s.swift_version = '5.6' end diff --git a/Package.swift b/Package.swift index b778757..bcc2249 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( .library(name: "ApolloCombine",targets: ["ApolloCombine"]), ], dependencies: [ - .package(url: "https://github.com/apollographql/apollo-ios.git", .upToNextMajor(from: "1.5.0")) + .package(url: "https://github.com/apollographql/apollo-ios.git", .upToNextMajor(from: "1.9.0")) ], targets: [ .target(name: "ApolloCombine", dependencies: [.product(name: "Apollo", package: "apollo-ios")]) diff --git a/Sources/ApolloCombine/ApolloClientExtensions.swift b/Sources/ApolloCombine/ApolloClientExtensions.swift index 9e5b623..d84e0bf 100644 --- a/Sources/ApolloCombine/ApolloClientExtensions.swift +++ b/Sources/ApolloCombine/ApolloClientExtensions.swift @@ -13,7 +13,7 @@ public extension ApolloClientProtocol { /// - Parameters: /// - query: The query to fetch. /// - cachePolicy: A cache policy that specifies when results should be fetched from the server and when data should be loaded from the local cache. Defaults to ``.default`. - /// - contextIdentifier: [optional] A unique identifier for this request, to help with deduping cache hits for watchers. Defaults to `nil`. + /// - contextIdentifier: [optional] A unique identifier for this request, to help with deduping cache hits for watchers. Should default to `nil`. /// - context: [optional] A context that is being passed through the request chain. Defaults to `nil`. /// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue. /// - Returns: A publisher that delivers results from the fetch operation. @@ -36,16 +36,19 @@ public extension ApolloClientProtocol { /// - Parameters: /// - mutation: The mutation to perform. /// - publishResultToStore: If `true`, this will publish the result returned from the operation to the cache store. Defaults to `true`. + /// - contextIdentifier: [optional] A unique identifier for this request, to help with deduping cache hits for watchers. Should default to `nil`. /// - context: [optional] A context that is being passed through the request chain. Defaults to `nil`. /// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue. /// - Returns: A publisher that delivers results from the perform operation. func performPublisher(mutation: Mutation, publishResultToStore: Bool = true, + contextIdentifier: UUID? = nil, context: RequestContext? = nil, queue: DispatchQueue = .main) -> Publishers.ApolloPerform { let config = Publishers.ApolloPerformConfiguration(client: self, mutation: mutation, publishResultToStore: publishResultToStore, + contextIdentifier: contextIdentifier, context: context, queue: queue) return Publishers.ApolloPerform(with: config) diff --git a/Sources/ApolloCombine/PublishersExtensions.swift b/Sources/ApolloCombine/PublishersExtensions.swift index d2c3e7c..5261c64 100644 --- a/Sources/ApolloCombine/PublishersExtensions.swift +++ b/Sources/ApolloCombine/PublishersExtensions.swift @@ -100,6 +100,7 @@ public extension Publishers { let client: ApolloClientProtocol let mutation: Mutation let publishResultToStore: Bool + let contextIdentifier: UUID? let context: RequestContext? let queue: DispatchQueue } @@ -118,6 +119,7 @@ public extension Publishers { func request(_ demand: Subscribers.Demand) { task = configuration.client.perform(mutation: configuration.mutation, publishResultToStore: configuration.publishResultToStore, + contextIdentifier: configuration.contextIdentifier, context: configuration.context, queue: configuration.queue) { [weak self] result in