You are viewing documentation for a previous version of this software.

Switch to the latest stable version.

UploadingNetworkTransport


PROTOCOL

UploadingNetworkTransport

Swift
1public protocol UploadingNetworkTransport: NetworkTransport

A network transport which can also handle uploads of files.

Methods

upload(operation:files:callbackQueue:completionHandler:)

Swift
1func upload<Operation: GraphQLOperation>(
2  operation: Operation,
3  files: [GraphQLFile],
4  callbackQueue: DispatchQueue,
5  completionHandler: @escaping (Result<GraphQLResult<Operation.Data>,Error>) -> Void) -> Cancellable

Uploads the given files with the given operation.

  • Parameters:

    • operation: The operation to send

    • files: An array of GraphQLFile objects to send.

    • callbackQueue: The queue to call back on with the results. Should default to .main.

    • completionHandler: The completion handler to execute when the request completes or errors

  • Returns: An object that can be used to cancel an in progress request.

Parameters

NameDescription
operationThe operation to send
filesAn array of GraphQLFile objects to send.
callbackQueueThe queue to call back on with the results. Should default to .main.
completionHandlerThe completion handler to execute when the request completes or errors
Feedback

Edit on GitHub

Forums