Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ContextIdentifier for the mutate queries #281

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apollo-ios/Sources/Apollo/ApolloClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ extension ApolloClient: ApolloClientProtocol {
@discardableResult
public func perform<Mutation: GraphQLMutation>(mutation: Mutation,
publishResultToStore: Bool = true,
contextIdentifier: UUID? = nil,
context: RequestContext? = nil,
queue: DispatchQueue = .main,
resultHandler: GraphQLResultHandler<Mutation.Data>? = nil) -> Cancellable {
return self.networkTransport.send(
operation: mutation,
cachePolicy: publishResultToStore ? .default : .fetchIgnoringCacheCompletely,
contextIdentifier: nil,
contextIdentifier: contextIdentifier,
context: context,
callbackQueue: queue,
completionHandler: { result in
Expand Down
2 changes: 2 additions & 0 deletions apollo-ios/Sources/Apollo/ApolloClientProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: GraphQLMutation>(mutation: Mutation,
publishResultToStore: Bool,
contextIdentifier: UUID?,
AnthonyMDev marked this conversation as resolved.
Show resolved Hide resolved
context: RequestContext?,
queue: DispatchQueue,
resultHandler: GraphQLResultHandler<Mutation.Data>?) -> Cancellable
Expand Down
Loading