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.
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, Caching GraphQL client for iOS 🖼Nuke, Image loading and caching 🔗Ola, Check reachability of host 🦀DeepDiff Amazingly incredible extraordinary lightning fast diffing
Setting up for development, dependency repos are getting cloned to
../. Consider wrapping the project in its own directory if these would collide with existing directories of yours.
Swifters.xcodeproj and the dependency
.xcodeproj files, Apollo, Nuke, and Ola, to an Xcode Workspace.
Apollo iOS uses the Apollo command-line tool. Declared in
package.json, we can install this dependency with npm.
$ npm i
Let’s check if the Apollo CLI is accessible with npx, the npm package runner for executing CLI tools locally. Without npx we would have to install the apollo package globally.
$ npx apollo -v › Warning: apollo update available from 1.9.2 to 2.4.3 apollo/1.9.2 darwin-x64 node-v8.12.0
All right! That warning is fine.
Accessing GitHub GraphQL API v4
A personal access token is required to communicate with GitHub’s GraphQL server.
Swifters needs following scopes:
To configure the app with your token, do:
Building the App
Xcode needs access to the Node toolchain. If you’re having issues with Xcode not finding Node, try:
ln -s $(which node) /usr/local/bin/node
You might have to do the same for npm and npx.