/
Launch Apollo Studio


CLASS

ApolloClient

public class ApolloClient

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

Properties

store

public let store: ApolloStore

Methods

init(networkTransport:store:)

public init(networkTransport: NetworkTransport, store: ApolloStore = ApolloStore(cache: InMemoryNormalizedCache()))

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. Should default to an empty store backed by an in-memory cache.

Parameters

NameDescription
networkTransportA network transport used to send operations to a server.
storeA store used as a local cache. Should default to an empty store backed by an in-memory cache.

init(url:)

public convenience init(url: URL)

Creates a client with an HTTP network transport 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.
Edit on GitHub