Introduction to Apollo iOS

A strongly-typed, caching GraphQL client for iOS, written in Swift


Apollo iOS is an open-source GraphQL client for native iOS apps, written in Swift. It enables you to execute queries and mutations against a GraphQL server and returns results as operation-specific Swift types.

Start the tutorialInstallation

Benefits

Strong typing with codegen

Thanks to strong typing in Apollo iOS, you don't need to deal with parsing JSON responses or passing around dictionaries of values that require manual casting. You also don't need to write model types yourself, because models are generated from the GraphQL operations your UI defines.

Because generated types are operation-specific, they include properties only for the GraphQL fields included in their corresponding operation. This means you can rely on the Swift type checker to flag data access errors at compile time.

Apollo's Xcode integration enables you to work with your UI code and corresponding GraphQL definitions side by side. It even validates your query documents, showing errors inline.

Normalized caching

Apollo iOS normalizes operation results to build a client-side cache of your data, which is updated with every operation you execute. This means your UI is always internally consistent, and it can stay up to date with your backend with as few operation as possible.

Learn more about caching.

Apollo Kotlin is a GraphQL client for native Android apps written in Java and Kotlin. It offers Kotlin Multi-Platform integration as well.

Apollo Client for JavaScript's React integration works with React Native on both iOS and Android.

Feedback

Edit on GitHub

Forums