apollo-ios

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

Github星跟踪图

Apollo iOS

CircleCI GitHub license Swift 5 Supported Carthage compatible CocoaPods Join the community on Spectrum

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: 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

This project is being developed using Xcode 11 and Swift 5.0.

If you open Apollo.xcworkspace, you should be able to run the tests of the Apollo, ApolloSQLite, and ApolloWebSocket frameworks on your Mac or an iOS Simulator.

NOTE: Due to a change in behavior in Xcode 11's git integration, if you check this repo out using Xcode, please close the window Xcode automatically opens using the Swift Package manager structure, and open the Apollo.xcworkspace file instead.

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.

主要指标

概览
名称与所有者apollographql/apollo-ios
主编程语言Swift
编程语言Objective-C (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2016-07-26 00:24:04
推送于2025-04-16 20:18:25
最后一次提交
发布数186
最新版本名称1.20.0 (发布于 )
第一版名称0.1.0 (发布于 )
用户参与
星数3.9k
关注者数89
派生数746
提交数3.7k
已启用问题?
问题数1792
打开的问题数132
拉请求数1355
打开的拉请求数0
关闭的拉请求数242
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?