aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github/import_query.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-10-02 13:02:16 +0200
committerMichael Muré <batolettre@gmail.com>2018-10-02 13:02:16 +0200
commit892c25aa25ef9f4c56b194963b4e942e6d8eebd7 (patch)
treebf1b1ca9fa9342f583bb3aa1a3ccc78a28548cb9 /bridge/github/import_query.go
parent8ec1dd092656aed5dae22a0301bd3f85b5dabb88 (diff)
downloadgit-bug-892c25aa25ef9f4c56b194963b4e942e6d8eebd7.tar.gz
github: incremental import of comments + editions
Diffstat (limited to 'bridge/github/import_query.go')
-rw-r--r--bridge/github/import_query.go32
1 files changed, 28 insertions, 4 deletions
diff --git a/bridge/github/import_query.go b/bridge/github/import_query.go
index 0eb8ad34..89eeb553 100644
--- a/bridge/github/import_query.go
+++ b/bridge/github/import_query.go
@@ -3,8 +3,10 @@ package github
import "github.com/shurcooL/githubv4"
type pageInfo struct {
- EndCursor githubv4.String
- HasNextPage bool
+ EndCursor githubv4.String
+ HasNextPage bool
+ StartCursor githubv4.String
+ HasPreviousPage bool
}
type actor struct {
@@ -43,7 +45,7 @@ type issueComment struct {
UserContentEdits struct {
Nodes []userContentEdit
PageInfo pageInfo
- } `graphql:"userContentEdits(first: $commentEditFirst, after: $commentEditAfter)"`
+ } `graphql:"userContentEdits(last: $commentEditLast, before: $commentEditBefore)"`
}
type timelineItem struct {
@@ -92,7 +94,10 @@ type issueTimeline struct {
Url githubv4.URI
Timeline struct {
- Nodes []timelineItem
+ Edges []struct {
+ Cursor githubv4.String
+ Node timelineItem
+ }
PageInfo pageInfo
} `graphql:"timeline(first: $timelineFirst, after: $timelineAfter)"`
@@ -126,3 +131,22 @@ type issueEditQuery struct {
} `graphql:"issues(first: $issueFirst, after: $issueAfter, orderBy: {field: CREATED_AT, direction: ASC})"`
} `graphql:"repository(owner: $owner, name: $name)"`
}
+
+type commentEditQuery struct {
+ Repository struct {
+ Issues struct {
+ Nodes []struct {
+ Timeline struct {
+ Nodes []struct {
+ IssueComment struct {
+ UserContentEdits struct {
+ Nodes []userContentEdit
+ PageInfo pageInfo
+ } `graphql:"userContentEdits(last: $commentEditLast, before: $commentEditBefore)"`
+ } `graphql:"... on IssueComment"`
+ }
+ } `graphql:"timeline(first: $timelineFirst, after: $timelineAfter)"`
+ }
+ } `graphql:"issues(first: $issueFirst, after: $issueAfter, orderBy: {field: CREATED_AT, direction: ASC})"`
+ } `graphql:"repository(owner: $owner, name: $name)"`
+}