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

Switch to the latest stable version.

ApolloCLI


STRUCT

ApolloCLI

Swift
1public struct ApolloCLI

Wrapper for calling the bundled node-based Apollo CLI.

Properties

binaryFolderURL

Swift
1public let binaryFolderURL: URL

Methods

createCLI(cliFolderURL:timeout:)

Swift
1public static func createCLI(cliFolderURL: URL, timeout: Double) throws -> ApolloCLI

Creates an instance of ApolloCLI, downloading and extracting if needed

  • Parameters:

    • cliFolderURL: The URL to the folder which contains the zip file with the CLI.

    • timeout: The maximum time to wait before indicating that the download timed out, in seconds.

Parameters

NameDescription
cliFolderURLThe URL to the folder which contains the zip file with the CLI.
timeoutThe maximum time to wait before indicating that the download timed out, in seconds.

init(binaryFolderURL:)

Swift
1public init(binaryFolderURL: URL)

Designated initializer

  • Parameter binaryFolderURL: The folder where the extracted binary files live.

Parameters

NameDescription
binaryFolderURLThe folder where the extracted binary files live.

runApollo(with:from:)

Swift
1public func runApollo(with arguments: [String],
2                      from folder: URL? = nil) throws -> String

Runs a command with the bundled Apollo CLI

NOTE: Will always run the --version command first for debugging purposes.

  • Parameter arguments: The arguments to hand to the CLI

  • Parameter folder: The folder to run the command from.

Parameters

NameDescription
argumentsThe arguments to hand to the CLI
folderThe folder to run the command from.
Feedback

Edit on GitHub

Forums