Giter Site home page Giter Site logo

github-graphql-api-example's Introduction

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

  1. Copy config.default.js into a file called config.js, and replace xxx with your username and password
  2. Install dependencies with npm install
  3. Run 'npm run start' in terminal. For more, please check https://github.com/react-community/create-react-native-app.

Current features

  1. Sending a login token to GitHub API by attaching an Authorization header to the request
  2. Navigating between two views and loading different queries, with caching built into Apollo Client
  3. 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:

  1. Add real login, ideally with OAuth
  2. Add markdown rendering for comments
  3. Add a mutation to add reactions to comments, or post a new comment

github-graphql-api-example's People

Contributors

gengjiawen avatar samclaridge avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.