Skip to content

Commit

Permalink
Merge pull request #19 from AF-cgi/maint/apollo-dependency
Browse files Browse the repository at this point in the history
Update to Apollo 1.9.x
  • Loading branch information
joel-perry authored Mar 7, 2024
2 parents c96e8cd + ed68249 commit 2c25460
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ApolloCombine.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")])
Expand Down
5 changes: 4 additions & 1 deletion Sources/ApolloCombine/ApolloClientExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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: GraphQLMutation>(mutation: Mutation,
publishResultToStore: Bool = true,
contextIdentifier: UUID? = nil,
context: RequestContext? = nil,
queue: DispatchQueue = .main) -> Publishers.ApolloPerform<Mutation> {
let config = Publishers.ApolloPerformConfiguration(client: self,
mutation: mutation,
publishResultToStore: publishResultToStore,
contextIdentifier: contextIdentifier,
context: context,
queue: queue)
return Publishers.ApolloPerform(with: config)
Expand Down
2 changes: 2 additions & 0 deletions Sources/ApolloCombine/PublishersExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 2c25460

Please sign in to comment.