arojunior / awesome-feed

Stay up to date with what is happening and what the users who you follow are working on Github
https://awesomefeed.js.org
MIT License
57 stars 8 forks source link

Improve request for events #27

Closed arojunior closed 6 years ago

arojunior commented 7 years ago

Now it is fetching all events for all following list. We need to find a way to fetch just the lasts events and fetching more when user scroll the page.

Can we use GraphQL api? https://developer.github.com/v4/

arojunior commented 7 years ago

Just trying it out

query {
    user(login: "arojunior") {
        following(last: 5) {
            totalCount
            nodes {
                login
                issueComments(last: 3) {
                    nodes {
                        body
                    }
                }
                pullRequests(last: 3) {
                    nodes {
                        body
                    }
                }
                commitComments(last: 3) {
                    nodes {
                        body
                    }
                }
                starredRepositories(last: 3) {
                    nodes {
                        nameWithOwner
                    }
                }
            }
        }
    }
}
arojunior commented 6 years ago

Working on it in GraphQL branch