Latest 0.9.5
Homepage https://github.com/apollographql/apollo-ios
License MIT
Platforms ios 9.0, osx 10.10, tvos 9.1, watchos 3.0, requires ARC

Apollo iOS

GitHub license Carthage compatible CocoaPods Get on Slack

Apollo iOS is a strongly-typed, caching GraphQL client for iOS, written in Swift.

It allows you to execute queries and mutations against a GraphQL server, and returns results as query-specific Swift types. This means you don’t have to deal with parsing JSON, or passing around dictionaries and making clients cast values to the right type manually. You also don’t have to write model types yourself, because these are generated from the GraphQL definitions your UI uses.

As the generated types are query-specific, you’re only able to access data you actually specify as part of a query. If you don’t ask for a field, you won’t be able to access the corresponding property. In effect, this means you can now rely on the Swift type checker to make sure errors in data access show up at compile time. With our Xcode integration, you can conveniently work with your UI code and corresponding GraphQL definitions side by side, and it will even validate your query documents, and show errors inline.

Apollo iOS does more than simply run your queries against a GraphQL server however. It normalizes query results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run. This means your UI is always internally consistent, and can be kept fully up-to-date with the state on the server with the minimum number of queries required.

This combination of models with value semantics, one way data flow, and automatic consistency management, leads to a very powerful and elegant programming model that allows you to eliminate common glue code and greatly simplifies app development.

Documentation

Read the full docs at apollographql.com/docs/ios/

Changelog

Read about the latest changes to the library

Contributing

Build status

This project is being developed using Xcode 9 and Swift 4.

If you open Apollo.xcodeproj, you should be able to run the tests of the Apollo target.

Some of the tests run against a simple GraphQL server serving the Star Wars example schema (see installation instructions there).

If you’d like to contribute, please refer to the Apollo Contributor Guide.

Latest podspec

{
    "name": "Apollo",
    "version": "0.9.5",
    "authors": "Meteor Development Group",
    "homepage": "https://github.com/apollographql/apollo-ios",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "A GraphQL client for iOS, written in Swift.",
    "source": {
        "git": "https://github.com/apollographql/apollo-ios.git",
        "tag": "0.9.5"
    },
    "requires_arc": true,
    "swift_version": "4.0",
    "default_subspecs": "Core",
    "platforms": {
        "ios": "9.0",
        "osx": "10.10",
        "tvos": "9.1",
        "watchos": "3.0"
    },
    "subspecs": [
        {
            "name": "Core",
            "source_files": "Sources/Apollo/*.swift",
            "resources": [
                "scripts/check-and-run-apollo-cli.sh",
                "scripts/check-and-run-apollo-codegen.sh"
            ]
        },
        {
            "name": "SQLite",
            "source_files": "Sources/ApolloSQLite/*.swift",
            "dependencies": {
                "Apollo/Core": [],
                "SQLite.swift": [
                    "~> 0.11.4"
                ]
            }
        },
        {
            "name": "WebSocket",
            "source_files": "Sources/ApolloWebSocket/*.swift",
            "dependencies": {
                "Apollo/Core": [],
                "Starscream": [
                    "~> 3.0.2"
                ]
            }
        }
    ]
}

Pin It on Pinterest

Share This