Skip to content

Commit 9451b35

Browse files
Merge pull request #599 from apollographql/update/get-as-option
GET as a transport option instead of a parameter + ErrorCancellable
2 parents 86e7af2 + 94d7bd7 commit 9451b35

26 files changed

Lines changed: 242 additions & 447 deletions

Apollo.xcodeproj/project.pbxproj

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
/* Begin PBXBuildFile section */
1010
54DDB0921EA045870009DD99 /* InMemoryNormalizedCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54DDB0911EA045870009DD99 /* InMemoryNormalizedCache.swift */; };
11-
5AC6CA4322AAF7B200B7C94D /* FetchHTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AC6CA4222AAF7B200B7C94D /* FetchHTTPMethod.swift */; };
11+
5AC6CA4322AAF7B200B7C94D /* GraphQLHTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AC6CA4222AAF7B200B7C94D /* GraphQLHTTPMethod.swift */; };
12+
9BDE43D122C6655300FD7C7F /* Cancellable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BDE43D022C6655200FD7C7F /* Cancellable.swift */; };
13+
9BDE43DD22C6705300FD7C7F /* GraphQLHTTPResponseError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BDE43DC22C6705300FD7C7F /* GraphQLHTTPResponseError.swift */; };
14+
9BDE43DF22C6708600FD7C7F /* GraphQLHTTPRequestError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BDE43DE22C6708600FD7C7F /* GraphQLHTTPRequestError.swift */; };
1215
9F0CA4451EE7F9E90032DD39 /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
1316
9F0CA4461EE7F9E90032DD39 /* ApolloTestSupport.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1417
9F10A51E1EC1BA0F0045E62B /* MockNetworkTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F10A51D1EC1BA0F0045E62B /* MockNetworkTransport.swift */; };
@@ -233,7 +236,7 @@
233236

234237
/* Begin PBXFileReference section */
235238
54DDB0911EA045870009DD99 /* InMemoryNormalizedCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InMemoryNormalizedCache.swift; sourceTree = "<group>"; };
236-
5AC6CA4222AAF7B200B7C94D /* FetchHTTPMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchHTTPMethod.swift; sourceTree = "<group>"; };
239+
5AC6CA4222AAF7B200B7C94D /* GraphQLHTTPMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphQLHTTPMethod.swift; sourceTree = "<group>"; };
237240
90690D05224333DA00FC2E54 /* Apollo-Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Project-Debug.xcconfig"; sourceTree = "<group>"; };
238241
90690D06224333DA00FC2E54 /* Apollo-Target-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-Framework.xcconfig"; sourceTree = "<group>"; };
239242
90690D07224333DA00FC2E54 /* Apollo-Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Project-Release.xcconfig"; sourceTree = "<group>"; };
@@ -245,6 +248,9 @@
245248
90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-CacheDependentTests.xcconfig"; sourceTree = "<group>"; };
246249
90690D2422433C8000FC2E54 /* Apollo-Target-PerformanceTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-PerformanceTests.xcconfig"; sourceTree = "<group>"; };
247250
90690D2522433CAF00FC2E54 /* Apollo-Target-TestSupport.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-TestSupport.xcconfig"; sourceTree = "<group>"; };
251+
9BDE43D022C6655200FD7C7F /* Cancellable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cancellable.swift; sourceTree = "<group>"; };
252+
9BDE43DC22C6705300FD7C7F /* GraphQLHTTPResponseError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQLHTTPResponseError.swift; sourceTree = "<group>"; };
253+
9BDE43DE22C6708600FD7C7F /* GraphQLHTTPRequestError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQLHTTPRequestError.swift; sourceTree = "<group>"; };
248254
9F10A51D1EC1BA0F0045E62B /* MockNetworkTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockNetworkTransport.swift; sourceTree = "<group>"; };
249255
9F19D8431EED568200C57247 /* ResultOrPromise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultOrPromise.swift; sourceTree = "<group>"; };
250256
9F19D8451EED8D3B00C57247 /* ResultOrPromiseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultOrPromiseTests.swift; sourceTree = "<group>"; };
@@ -438,6 +444,14 @@
438444
path = Configuration/Apollo;
439445
sourceTree = "<group>";
440446
};
447+
9BDE43D222C6658D00FD7C7F /* Protocols */ = {
448+
isa = PBXGroup;
449+
children = (
450+
9BDE43D022C6655200FD7C7F /* Cancellable.swift */,
451+
);
452+
name = Protocols;
453+
sourceTree = "<group>";
454+
};
441455
9F27D4601D40363A00715680 /* Execution */ = {
442456
isa = PBXGroup;
443457
children = (
@@ -522,7 +536,9 @@
522536
90690D04224333DA00FC2E54 /* Configuration */,
523537
9FC750451D2A532C00458D91 /* Products */,
524538
);
539+
indentWidth = 2;
525540
sourceTree = "<group>";
541+
tabWidth = 2;
526542
};
527543
9FC750451D2A532C00458D91 /* Products */ = {
528544
isa = PBXGroup;
@@ -543,11 +559,11 @@
543559
isa = PBXGroup;
544560
children = (
545561
9FC750621D2A59F600458D91 /* ApolloClient.swift */,
546-
5AC6CA4222AAF7B200B7C94D /* FetchHTTPMethod.swift */,
547562
9FC750601D2A59C300458D91 /* GraphQLOperation.swift */,
548563
9FC9A9BE1E2C27FB0023C4D5 /* GraphQLResult.swift */,
549564
9FC9A9D21E2FD48B0023C4D5 /* GraphQLError.swift */,
550565
9FCDFD281E33D0CE007519DC /* GraphQLQueryWatcher.swift */,
566+
9BDE43D222C6658D00FD7C7F /* Protocols */,
551567
9FC9A9CE1E2FD0CC0023C4D5 /* Network */,
552568
9FC9A9CA1E2FD05C0023C4D5 /* Store */,
553569
9F27D4601D40363A00715680 /* Execution */,
@@ -598,6 +614,9 @@
598614
children = (
599615
9F69FFA81D42855900E000B1 /* NetworkTransport.swift */,
600616
9F4DAF2D1E48B84B00EBFF0B /* HTTPNetworkTransport.swift */,
617+
5AC6CA4222AAF7B200B7C94D /* GraphQLHTTPMethod.swift */,
618+
9BDE43DC22C6705300FD7C7F /* GraphQLHTTPResponseError.swift */,
619+
9BDE43DE22C6708600FD7C7F /* GraphQLHTTPRequestError.swift */,
601620
9FF90A5B1DDDEB100034C3B6 /* GraphQLResponse.swift */,
602621
);
603622
name = Network;
@@ -1078,6 +1097,7 @@
10781097
9F295E381E277B2A00A24949 /* GraphQLResultNormalizer.swift in Sources */,
10791098
9F86B68B1E6438D700B885FF /* GraphQLSelectionSetMapper.swift in Sources */,
10801099
9F55347B1DE1DB2100E54264 /* ApolloStore.swift in Sources */,
1100+
9BDE43D122C6655300FD7C7F /* Cancellable.swift in Sources */,
10811101
9F69FFA91D42855900E000B1 /* NetworkTransport.swift in Sources */,
10821102
9FCDFD291E33D0CE007519DC /* GraphQLQueryWatcher.swift in Sources */,
10831103
9FC2333D1E66BBF7001E4541 /* GraphQLDependencyTracker.swift in Sources */,
@@ -1087,6 +1107,7 @@
10871107
9FEB050D1DB5732300DA3B44 /* JSONSerializationFormat.swift in Sources */,
10881108
54DDB0921EA045870009DD99 /* InMemoryNormalizedCache.swift in Sources */,
10891109
9FC9A9C51E2D6CE70023C4D5 /* GraphQLSelectionSet.swift in Sources */,
1110+
9BDE43DD22C6705300FD7C7F /* GraphQLHTTPResponseError.swift in Sources */,
10901111
9FCDFD231E33A0D8007519DC /* AsynchronousOperation.swift in Sources */,
10911112
9FC9A9CC1E2FD0760023C4D5 /* Record.swift in Sources */,
10921113
9FC4B9201D2A6F8D0046A641 /* JSON.swift in Sources */,
@@ -1101,7 +1122,8 @@
11011122
9FA6F3681E65DF4700BF8D73 /* GraphQLResultAccumulator.swift in Sources */,
11021123
9FF90A651DDDEB100034C3B6 /* GraphQLExecutor.swift in Sources */,
11031124
9FC750611D2A59C300458D91 /* GraphQLOperation.swift in Sources */,
1104-
5AC6CA4322AAF7B200B7C94D /* FetchHTTPMethod.swift in Sources */,
1125+
9BDE43DF22C6708600FD7C7F /* GraphQLHTTPRequestError.swift in Sources */,
1126+
5AC6CA4322AAF7B200B7C94D /* GraphQLHTTPMethod.swift in Sources */,
11051127
9FE941D01E62C771007CDD89 /* Promise.swift in Sources */,
11061128
9FC750631D2A59F600458D91 /* ApolloClient.swift in Sources */,
11071129
9F86B6901E65533D00B885FF /* GraphQLResponseGenerator.swift in Sources */,

Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
codeCoverageEnabled = "YES"
30+
onlyGenerateCoverageForSpecifiedTargets = "YES"
2931
shouldUseLaunchSchemeArgsEnv = "NO">
32+
<CodeCoverageTargets>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "9FC750431D2A532C00458D91"
36+
BuildableName = "Apollo.framework"
37+
BlueprintName = "Apollo"
38+
ReferencedContainer = "container:Apollo.xcodeproj">
39+
</BuildableReference>
40+
</CodeCoverageTargets>
3041
<Testables>
3142
<TestableReference
3243
skipped = "NO">

ApolloSQLite.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@
154154
9FA86C581EA7B6780073E1ED /* Frameworks */,
155155
54DDB0BF1EA1523E0009DD99 /* Products */,
156156
);
157+
indentWidth = 2;
157158
sourceTree = "<group>";
159+
tabWidth = 2;
158160
};
159161
54DDB0BF1EA1523E0009DD99 /* Products */ = {
160162
isa = PBXGroup;

ApolloSQLite.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
codeCoverageEnabled = "YES"
30+
onlyGenerateCoverageForSpecifiedTargets = "YES"
2931
shouldUseLaunchSchemeArgsEnv = "NO">
32+
<CodeCoverageTargets>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "54DDB0BD1EA1523E0009DD99"
36+
BuildableName = "ApolloSQLite.framework"
37+
BlueprintName = "ApolloSQLite"
38+
ReferencedContainer = "container:ApolloSQLite.xcodeproj">
39+
</BuildableReference>
40+
</CodeCoverageTargets>
3041
<Testables>
3142
<TestableReference
3243
skipped = "NO">

ApolloWebSocket.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@
9797
720F147A206AB52F00D061DB /* Frameworks */,
9898
720160CC206AB3D30052B2EE /* Products */,
9999
);
100+
indentWidth = 2;
100101
sourceTree = "<group>";
102+
tabWidth = 2;
101103
};
102104
720160CC206AB3D30052B2EE /* Products */ = {
103105
isa = PBXGroup;

ApolloWebSocket.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
codeCoverageEnabled = "YES"
30+
onlyGenerateCoverageForSpecifiedTargets = "YES"
2931
shouldUseLaunchSchemeArgsEnv = "NO">
32+
<CodeCoverageTargets>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "720160CA206AB3D30052B2EE"
36+
BuildableName = "ApolloWebSocket.framework"
37+
BlueprintName = "ApolloWebSocket"
38+
ReferencedContainer = "container:ApolloWebSocket.xcodeproj">
39+
</BuildableReference>
40+
</CodeCoverageTargets>
3041
<Testables>
3142
<TestableReference
3243
skipped = "NO">

Sources/Apollo/ApolloClient.swift

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import Foundation
22
import Dispatch
33

4-
/// An object that can be used to cancel an in progress action.
5-
public protocol Cancellable: class {
6-
/// Cancel an in progress action.
7-
func cancel()
8-
}
9-
104
/// A cache policy that specifies whether results should be fetched from the server or loaded from the local cache.
115
public enum CachePolicy {
126
/// Return data from the cache if available, else fetch results from the server.
@@ -82,20 +76,19 @@ public class ApolloClient {
8276
///
8377
/// - Parameters:
8478
/// - query: The query to fetch.
85-
/// - fetchHTTPMethod: The HTTP Method to be used.
8679
/// - cachePolicy: A cache policy that specifies when results should be fetched from the server and when data should be loaded from the local cache.
8780
/// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue.
8881
/// - resultHandler: An optional closure that is called when query results are available or when an error occurs.
8982
/// - Returns: An object that can be used to cancel an in progress fetch.
90-
@discardableResult public func fetch<Query: GraphQLQuery>(query: Query, fetchHTTPMethod: FetchHTTPMethod = .POST, cachePolicy: CachePolicy = .returnCacheDataElseFetch, context: UnsafeMutableRawPointer? = nil, queue: DispatchQueue = DispatchQueue.main, resultHandler: GraphQLResultHandler<Query.Data>? = nil) -> Cancellable {
83+
@discardableResult public func fetch<Query: GraphQLQuery>(query: Query, cachePolicy: CachePolicy = .returnCacheDataElseFetch, context: UnsafeMutableRawPointer? = nil, queue: DispatchQueue = DispatchQueue.main, resultHandler: GraphQLResultHandler<Query.Data>? = nil) -> Cancellable {
9184
let resultHandler = wrapResultHandler(resultHandler, queue: queue)
9285

9386
// If we don't have to go through the cache, there is no need to create an operation
9487
// and we can return a network task directly
9588
if cachePolicy == .fetchIgnoringCacheData || cachePolicy == .fetchIgnoringCacheCompletely {
96-
return send(operation: query, fetchHTTPMethod: fetchHTTPMethod, shouldPublishResultToStore: cachePolicy != .fetchIgnoringCacheCompletely, context: context, resultHandler: resultHandler)
89+
return send(operation: query, shouldPublishResultToStore: cachePolicy != .fetchIgnoringCacheCompletely, context: context, resultHandler: resultHandler)
9790
} else {
98-
let operation = FetchQueryOperation(client: self, query: query, fetchHTTPMethod: fetchHTTPMethod, cachePolicy: cachePolicy, context: context, resultHandler: resultHandler)
91+
let operation = FetchQueryOperation(client: self, query: query, cachePolicy: cachePolicy, context: context, resultHandler: resultHandler)
9992
operationQueue.addOperation(operation)
10093
return operation
10194
}
@@ -110,8 +103,9 @@ public class ApolloClient {
110103
/// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue.
111104
/// - resultHandler: An optional closure that is called when query results are available or when an error occurs.
112105
/// - Returns: A query watcher object that can be used to control the watching behavior.
113-
public func watch<Query: GraphQLQuery>(query: Query, fetchHTTPMethod: FetchHTTPMethod = .POST, cachePolicy: CachePolicy = .returnCacheDataElseFetch, queue: DispatchQueue = DispatchQueue.main, resultHandler: @escaping GraphQLResultHandler<Query.Data>) -> GraphQLQueryWatcher<Query> {
114-
let watcher = GraphQLQueryWatcher(client: self, query: query, fetchHTTPMethod: fetchHTTPMethod, resultHandler: wrapResultHandler(resultHandler, queue: queue))
106+
107+
public func watch<Query: GraphQLQuery>(query: Query, cachePolicy: CachePolicy = .returnCacheDataElseFetch, queue: DispatchQueue = DispatchQueue.main, resultHandler: @escaping GraphQLResultHandler<Query.Data>) -> GraphQLQueryWatcher<Query> {
108+
let watcher = GraphQLQueryWatcher(client: self, query: query, resultHandler: wrapResultHandler(resultHandler, queue: queue))
115109
watcher.fetch(cachePolicy: cachePolicy)
116110
return watcher
117111
}
@@ -124,8 +118,8 @@ public class ApolloClient {
124118
/// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue.
125119
/// - resultHandler: An optional closure that is called when mutation results are available or when an error occurs.
126120
/// - Returns: An object that can be used to cancel an in progress mutation.
127-
@discardableResult public func perform<Mutation: GraphQLMutation>(mutation: Mutation, fetchHTTPMethod: FetchHTTPMethod = .POST, context: UnsafeMutableRawPointer? = nil, queue: DispatchQueue = DispatchQueue.main, resultHandler: GraphQLResultHandler<Mutation.Data>? = nil) -> Cancellable {
128-
return send(operation: mutation, fetchHTTPMethod: fetchHTTPMethod, shouldPublishResultToStore: true, context: context, resultHandler: wrapResultHandler(resultHandler, queue: queue))
121+
@discardableResult public func perform<Mutation: GraphQLMutation>(mutation: Mutation, context: UnsafeMutableRawPointer? = nil, queue: DispatchQueue = DispatchQueue.main, resultHandler: GraphQLResultHandler<Mutation.Data>? = nil) -> Cancellable {
122+
return send(operation: mutation, shouldPublishResultToStore: true, context: context, resultHandler: wrapResultHandler(resultHandler, queue: queue))
129123
}
130124

131125
/// Subscribe to a subscription
@@ -136,12 +130,12 @@ public class ApolloClient {
136130
/// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue.
137131
/// - resultHandler: An optional closure that is called when mutation results are available or when an error occurs.
138132
/// - Returns: An object that can be used to cancel an in progress subscription.
139-
@discardableResult public func subscribe<Subscription: GraphQLSubscription>(subscription: Subscription, fetchHTTPMethod: FetchHTTPMethod = .POST, queue: DispatchQueue = DispatchQueue.main, resultHandler: @escaping GraphQLResultHandler<Subscription.Data>) -> Cancellable {
140-
return send(operation: subscription, fetchHTTPMethod: fetchHTTPMethod, shouldPublishResultToStore: true, context: nil, resultHandler: wrapResultHandler(resultHandler, queue: queue))
133+
@discardableResult public func subscribe<Subscription: GraphQLSubscription>(subscription: Subscription, queue: DispatchQueue = DispatchQueue.main, resultHandler: @escaping GraphQLResultHandler<Subscription.Data>) -> Cancellable {
134+
return send(operation: subscription, shouldPublishResultToStore: true, context: nil, resultHandler: wrapResultHandler(resultHandler, queue: queue))
141135
}
142136

143-
fileprivate func send<Operation: GraphQLOperation>(operation: Operation, fetchHTTPMethod: FetchHTTPMethod, shouldPublishResultToStore: Bool, context: UnsafeMutableRawPointer?, resultHandler: @escaping GraphQLResultHandler<Operation.Data>) -> Cancellable {
144-
return networkTransport.send(operation: operation, fetchHTTPMethod: fetchHTTPMethod) { (response, error) in
137+
fileprivate func send<Operation: GraphQLOperation>(operation: Operation, shouldPublishResultToStore: Bool, context: UnsafeMutableRawPointer?, resultHandler: @escaping GraphQLResultHandler<Operation.Data>) -> Cancellable {
138+
return networkTransport.send(operation: operation) { (response, error) in
145139
guard let response = response else {
146140
resultHandler(nil, error)
147141
return
@@ -189,17 +183,15 @@ private func wrapResultHandler<Data>(_ resultHandler: GraphQLResultHandler<Data>
189183
private final class FetchQueryOperation<Query: GraphQLQuery>: AsynchronousOperation, Cancellable {
190184
let client: ApolloClient
191185
let query: Query
192-
let fetchHTTPMethod: FetchHTTPMethod
193186
let cachePolicy: CachePolicy
194187
let context: UnsafeMutableRawPointer?
195188
let resultHandler: GraphQLResultHandler<Query.Data>
196189

197190
private var networkTask: Cancellable?
198191

199-
init(client: ApolloClient, query: Query, fetchHTTPMethod: FetchHTTPMethod, cachePolicy: CachePolicy, context: UnsafeMutableRawPointer?, resultHandler: @escaping GraphQLResultHandler<Query.Data>) {
192+
init(client: ApolloClient, query: Query, cachePolicy: CachePolicy, context: UnsafeMutableRawPointer?, resultHandler: @escaping GraphQLResultHandler<Query.Data>) {
200193
self.client = client
201194
self.query = query
202-
self.fetchHTTPMethod = fetchHTTPMethod
203195
self.cachePolicy = cachePolicy
204196
self.context = context
205197
self.resultHandler = resultHandler
@@ -244,7 +236,7 @@ private final class FetchQueryOperation<Query: GraphQLQuery>: AsynchronousOperat
244236
}
245237

246238
func fetchFromNetwork() {
247-
networkTask = client.send(operation: query, fetchHTTPMethod: fetchHTTPMethod, shouldPublishResultToStore: true, context: context) { (result, error) in
239+
networkTask = client.send(operation: query, shouldPublishResultToStore: true, context: context) { (result, error) in
248240
self.resultHandler(result, error)
249241
self.state = .finished
250242
return

0 commit comments

Comments
 (0)