ApolloClient


CLASS

ApolloClient

Swift
1public class ApolloClient

The ApolloClient class implements the core API for Apollo by conforming to ApolloClientProtocol.

Properties

store

Swift
1public let store: ApolloStore

Methods

init(networkTransport:store:)

Swift
1public init(networkTransport: NetworkTransport, store: ApolloStore)

Creates a client with the specified network transport and store.

  • Parameters:

    • networkTransport: A network transport used to send operations to a server.

    • store: A store used as a local cache. Note that if the NetworkTransport or any of its dependencies takes a store, you should make sure the same store is passed here so that it can be cleared properly.

Parameters

NameDescription
networkTransportA network transport used to send operations to a server.
storeA store used as a local cache. Note that if the NetworkTransport or any of its dependencies takes a store, you should make sure the same store is passed here so that it can be cleared properly.

init(url:)

Swift
1public convenience init(url: URL)

Creates a client with a RequestChainNetworkTransport connecting to the specified URL.

  • Parameter url: The URL of a GraphQL server to connect to.

Parameters

NameDescription
urlThe URL of a GraphQL server to connect to.
Feedback

Edit on GitHub

Forums