diff --git a/apollo-ios/Sources/Apollo/ApolloClient.swift b/apollo-ios/Sources/Apollo/ApolloClient.swift index e09bc65c9..f2f0df723 100644 --- a/apollo-ios/Sources/Apollo/ApolloClient.swift +++ b/apollo-ios/Sources/Apollo/ApolloClient.swift @@ -109,13 +109,14 @@ extension ApolloClient: ApolloClientProtocol { @discardableResult public func perform(mutation: Mutation, publishResultToStore: Bool = true, + contextIdentifier: UUID? = nil, context: RequestContext? = nil, queue: DispatchQueue = .main, resultHandler: GraphQLResultHandler? = nil) -> Cancellable { return self.networkTransport.send( operation: mutation, cachePolicy: publishResultToStore ? .default : .fetchIgnoringCacheCompletely, - contextIdentifier: nil, + contextIdentifier: contextIdentifier, context: context, callbackQueue: queue, completionHandler: { result in diff --git a/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift b/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift index 125cd950a..5c6180838 100644 --- a/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift +++ b/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift @@ -54,12 +54,14 @@ public protocol ApolloClientProtocol: AnyObject { /// - Parameters: /// - mutation: The mutation to perform. /// - publishResultToStore: If `true`, this will publish the result returned from the operation to the cache store. Default is `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. Should default to `nil`. /// - queue: A dispatch queue on which the result handler will be called. Should default to the main queue. /// - resultHandler: An optional closure that is called when mutation results are available or when an error occurs. /// - Returns: An object that can be used to cancel an in progress mutation. func perform(mutation: Mutation, publishResultToStore: Bool, + contextIdentifier: UUID?, context: RequestContext?, queue: DispatchQueue, resultHandler: GraphQLResultHandler?) -> Cancellable