Docs
Launch GraphOS 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)

Creates a client with the specified network transport and store.

  • Parameters:
    • networkTransport: A network transport used to send 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:)

public convenience init(url: URL)

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

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

Parameters

NameDescription
urlThe URL of a GraphQL server to connect to.
Next
Introduction
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company