IssueReader
On September 14, 2016, GitHub announced a preview of their new GraphQL API. Read our recap of the news here!.
This is a small app to demonstrate how to load and paginate some issues and comments from a repository, using Apollo Client with React Native.
Before getting started make sure you have registered to get access to the GitHub pre-release program.
Running
- Copy
config.default.js
into a file calledconfig.js
, and replacexxx
with your username and password - Install dependencies with
npm install
- Run 'npm run start' in terminal. For more, please check https://github.com/react-community/create-react-native-app.
Current features
- Sending a login token to GitHub API by attaching an
Authorization
header to the request - Navigating between two views and loading different queries, with caching built into Apollo Client
- Infinite scroll pagination using the GraphQL connections
Screenshot
The UI is pretty basic, with only the default styling. The first page is the list of issues for the Apollo Client repository, and if you tap you can see the comments for that issue on the second page. As you scroll down, the app eventually loads all of the issues and comments.
Contributing
Help make the app better! Some ideas:
- Add real login, ideally with OAuth
- Add markdown rendering for comments
- Add a mutation to add reactions to comments, or post a new comment