The Swifters iOS app lets you browse Swift users on GitHub. Its purpose is to explore GraphQL with Apollo iOS, a strongly-typed, caching GraphQL client. Swifters queries GitHub’s GraphQL API v4. If your new to GraphQL, you might want to read my introduction.
The Swifters iOS app lets you browse Swift users on GitHub. Its purpose is to explore GraphQL with Apollo iOS, a strongly-typed, caching GraphQL client. Swifters queries GitHub’s GraphQL API v4.
Swifters progressively populates its cache, while users scroll a list of Swift developers on GitHub, loading two to three handfuls of Swifters at a time. Tapping a developer in the list shows details.
- Explore GraphQL building a modern application with Apollo and UICollectionView
- Compare the imperative and procedural REST approach to the declarative GraphQL
- Paginate with UICollectionViewDataSourcePrefetching
- Apollo iOS – A strongly-typed, caching GraphQL client
- DeepDiff – Amazingly incredible extraordinary lightning fast diffing
- Nuke – Image loading and caching
- Ola – Check reachability of host
Swifters needs a personal access token to communicate with GitHub’s GraphQL server.
These scopes are required:
read:user
user:email
$ GITHUB_TOKEN=<token> make
- Clone repositories of framework dependencies into
./deps
- Generate
./apollo.config.js
with your GitHub token - Copy
./apollo.config.js
to./Swifters/github/apollo.config.json
$ open Swifters.xcworkspace
- Select Swifters scheme
- Run ⌘R
🙌
If you want to modify GraphQL queries to develop this app further, you need code generation tooling. Apollo GraphQL tools are written in TypeScript and run on Node.js.
$ npm i -g apollo
After you have adjusted *.graphql
queries to your needs, you must generate the GraphQL related Swift source files. Apollo recommends adding a Run Script Phase to your Xcode target, but I find using the command line interface directly less opaque.
$ apollo client:codegen --target=swift ./Swifters/github