

GitHub - apollographql/apollo-ios: ? A strongly-typed, caching GraphQL client fo...
source link: https://github.com/apollographql/apollo-ios
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
Apollo iOS
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
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.
Recommend
-
70
这篇文章主要介绍 GraphQL 在 Client 的使用,为了方便,本文会直接使用 React 创建一个 Web demo 去介绍 Apollo 在 React 中的使用方法,当然在 ReactNative 中用法几乎一模一样。 Apol...
-
31
README.md
-
188
README.md Apollo GraphQL Client for Android
-
42
README.md
-
12
JavaScript
-
4
Testing GraphQL Queries with Apollo ClientIn this blog post, we are going to learn how to test our GraphQL operations on an Apollo client in a React application.Quality means doing it right whe...
-
6
Apollo Client Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL. Documentation All Apollo...
-
9
How to Fire an Event-Driven GraphQL Query with Apollo Client for React If you’re building an application t...
-
6
Integrating third-party APIs into GraphQL with Apollo ClientTo add fast and feature-rich third-party APIs into any codebase, developers need to work within an ecosystem designed...
-
10
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK