Skip to content

Commit

Permalink
Request reactions data from GitHub (#839)
Browse files Browse the repository at this point in the history
This commit updates the GitHub graphql query to also fetch reactions.
We update the JSON typedefs to include this new information, add
continuations from comments, and update existing continuation and query
code. Also, I added a safety check when updating comments for issues
that was previously unnecessary but is now needed.

Test plan:
- `yarn test --full` passes.
- Setting the page limits to 1 and running on the example-github does
not error with unexhausted pages, and loads all the expected reactions.
- Running on a larger repository (go-ipfs) works as expected.
- I have written dependent code that consumes these reactions in the
RelationalView, and works as intended, which suggests that the type
signatures are correct.
  • Loading branch information
teamdandelion committed Sep 14, 2018
1 parent aecf64b commit a2ffdf5
Show file tree
Hide file tree
Showing 5 changed files with 605 additions and 4 deletions.
27 changes: 26 additions & 1 deletion src/plugins/github/__snapshots__/graphql.test.js.snap
Expand Up @@ -259,6 +259,9 @@ fragment issues on IssueConnection {
comments(first: 20) {
...comments
}
reactions(first: 5) {
...reactions
}
}
}
fragment pulls on PullRequestConnection {
Expand All @@ -283,9 +286,12 @@ fragment pulls on PullRequestConnection {
comments(first: 20) {
...comments
}
reviews(first: 10) {
reviews(first: 5) {
...reviews
}
reactions(first: 5) {
...reactions
}
}
}
fragment comments on IssueCommentConnection {
Expand All @@ -300,6 +306,9 @@ fragment comments on IssueCommentConnection {
...whoami
}
body
reactions(first: 5) {
...reactions
}
}
}
fragment reviews on PullRequestReviewConnection {
Expand Down Expand Up @@ -332,6 +341,9 @@ fragment reviewComments on PullRequestReviewCommentConnection {
author {
...whoami
}
reactions(first: 5) {
...reactions
}
}
}
fragment commitHistory on CommitHistoryConnection {
Expand All @@ -353,5 +365,18 @@ fragment commit on Commit {
...whoami
}
}
}
fragment reactions on ReactionConnection {
pageInfo {
hasNextPage
endCursor
}
nodes {
id
content
user {
...whoami
}
}
}"
`;

0 comments on commit a2ffdf5

Please sign in to comment.