forked from apollographql/apollo-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetworkTransport.swift
More file actions
14 lines (13 loc) · 846 Bytes
/
NetworkTransport.swift
File metadata and controls
14 lines (13 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
/// A network transport is responsible for sending GraphQL operations to a server.
public protocol NetworkTransport {
/// Send a GraphQL operation to a server and return a response.
///
/// - Parameters:
/// - operation: The operation to send.
/// - fetchHTTPMethod: The HTTP Method to be used.
/// - completionHandler: A closure to call when a request completes.
/// - response: The response received from the server, or `nil` if an error occurred.
/// - error: An error that indicates why a request failed, or `nil` if the request was succesful.
/// - Returns: An object that can be used to cancel an in progress request.
func send<Operation>(operation: Operation, fetchHTTPMethod: FetchHTTPMethod, completionHandler: @escaping (_ response: GraphQLResponse<Operation>?, _ error: Error?) -> Void) -> Cancellable
}