Apollo iOS SDK components


Apollo iOS SDK components

For Cocoapods users:

Cocoapods combines subspecs into a single target. This means that:

Libraries that compose the Apollo iOS package:

Description Usage

Apollo

The core Apollo client library.

Includes the networking and caching APIs, including ApolloClient and ApolloStore.

Any targets that need to access these core components directly should be linked against Apollo.

ApolloAPI

Includes the common components that generated models use for your project.

Any targets that include your generated models should be linked to ApolloAPI.

The Apollo library has a dependency on this target, so any target that links to Apollo doesn't need to link to ApolloAPI directly.

Because generated models export the ApolloAPI library's interface, targets that consume generated models but don't contain them don't need to link to ApolloAPI directly.

ApolloSQLite

Provides a NormalizedCache implementation backed by a SQLite database.

Use this library if you'd like to persist cache data across application lifecycles. This library only needs to be linked to your targets that configure the SQLiteNormalizedCache and pass it to the ApolloStore.

For more information on setting up a persistent SQLite cache, seeSQLiteNormalizedCache.

ApolloWebSocket

Provides a web socket transport implementation that supports GraphQLSubscription operations.

If your project uses GraphQL subscriptions, you must include this library. This library only needs to be linked to your targets that configure the WebSocketTransport and pass it to the ApolloClient.

For more information, see Enabling GraphQL subscription support.

ApolloTestSupport

Includes the APIs for creating test mocks for your generated models

Link this library to unit test targets that need to create mocks of generated models.

ApolloCodegenLib

Includes the code generation engine for generating GraphQL models.

For most projects, we strongly recommend using the Codegen CLI instead of using ApolloCodegenLib directly.

Use this library if you want to run the code generation engine from your own Swift executable targets.

Link this library to development tools that want to use the Apollo code generation engine. This library only supports macOS.

ApolloCodegenLib shouldn't be linked to your application targets.

Feedback

Edit on GitHub

Forums