-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README and add some screenshots
- Loading branch information
1 parent
45401ab
commit f8a3384
Showing
4 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
# Apollo iOS [](https://raw.githubusercontent.com/apollostack/apollo-ios/master/LICENSE.md) [](https://github.com/Carthage/Carthage) [](https://cocoapods.org/pods/Apollo) | ||
# Apollo iOS | ||
|
||
[](https://raw.githubusercontent.com/apollostack/apollo-ios/master/LICENSE.md) | ||
[](https://github.com/Carthage/Carthage) | ||
[](https://cocoapods.org/pods/Apollo) | ||
[](http://www.apollostack.com/#slack) | ||
|
||
Apollo iOS is a GraphQL client for iOS, written in Swift. | ||
|
||
Although JSON responses are convenient to work with in dynamic languages like JavaScript, dealing with dictionaries and untyped values is a pain in statically typed languages such as 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 around dictionaries and making clients cast values to the right type manually. Instead, the structs returned allow you to access data and navigate relationships using the appropriate native types directly. This also gives you nice features like code completion: | ||
|
||
 | ||
|
||
The main design goal of the current version of Apollo iOS is therefore to return typed results for GraphQL queries. Instead of passing around dictionaries and making clients cast field values to the right type manually, the types returned allow you to access data and navigate relationships using the appropriate native types directly. | ||
Because 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: | ||
|
||
These result types are generated from a GraphQL schema and a set of query documents by [`apollo-codegen`](https://github.com/apollostack/apollo-codegen). It currently only generates code for a subset of GraphQL queries. Most importantly, fragments with polymorphic type conditions and mutations are not yet supported. | ||
 | ||
|
||
For more details on the proposed mapping from GraphQL results to Swift types, see the [design docs](DESIGN.md). | ||
As you can see, you can conveniently work with your UI code and corresponding GraphQL definitions side by side. Our Xcode integration will even validate your query documents and show errors inline: | ||
|
||
 | ||
|
||
## Getting Started | ||
|
||
[Apollo iOS Quickstart](https://github.com/apollostack/apollo-ios-quickstart) is a collection of sample Xcode projects that makes it easy to get started with Apollo iOS. | ||
[Front Page](https://github.com/apollostack/frontpage-ios-app) is the iOS version of the simple "Hello World" app that lives on our [developer site](http://dev.apollodata.com). | ||
|
||
[Apollo iOS Quickstart](https://github.com/apollostack/apollo-ios-quickstart) is a collection of sample Xcode projects that make it easy to get started with Apollo iOS. | ||
|
||
If you want the same syntax highlighting for your .graphql files showed in the screenshots above, you can install our [Xcode add-ons](https://github.com/apollostack/xcode-apollo). | ||
|
||
## Development | ||
|
||
This project is being developed using Xcode 8 and Swift 3. | ||
|
||
If you open `Apollo.xcodeproj`, you should be able to run the tests of the Apollo target. | ||
|
||
Some of the tests run against [an example GraphQL server](https://github.com/jahewson/graphql-starwars) (see installation instructions there) using the Star Wars data bundled with Facebook's reference implementation, [GraphQL.js](https://github.com/graphql/graphql-js). | ||
Some of the tests run against [an example GraphQL server](https://github.com/jahewson/graphql-starwars) (see installation instructions there). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.