Add GraphQL github issue query

Alexander Scharinger created

Change summary

bridge/github/import_query.go | 17 +++++++++++++++++
bridge/github/iterator.go     | 23 +++++++++++++++++++++++
2 files changed, 40 insertions(+)

Detailed changes

bridge/github/import_query.go 🔗

@@ -203,3 +203,20 @@ type loginQuery struct {
 		Login string `graphql:"login"`
 	} `graphql:"viewer"`
 }
+
+type issueQuery struct {
+        Repository struct {
+                Issues struct {
+                        Nodes    []issue
+                        PageInfo pageInfo
+                } `graphql:"issues(first: $issueFirst, after: $issueAfter, orderBy: {field: CREATED_AT, direction: ASC})"` //, filterBy: {since: $issueSince})"`
+        } `graphql:"repository(owner: $owner, name: $name)"`
+}
+
+type issue struct {
+        authorEvent
+        Title  string
+        Number githubv4.Int
+        Body   githubv4.String
+        Url    githubv4.URI
+}

bridge/github/iterator.go 🔗

@@ -8,6 +8,29 @@ import (
 	"github.com/shurcooL/githubv4"
 )
 
+type iterator_A struct {
+        gc        *githubv4.Client
+        since     time.Time
+        ctx       context.Context
+        err       error
+        issueIter issueIter
+}
+
+type issueIter struct {
+        iterVars
+        query         issueQuery
+        // issueEditIter []issueEditIter
+        // timelineIter  []timelineIter
+}
+
+type iterVars struct {
+        index     int
+        capacity  int
+        variables varmap
+}
+
+type varmap map[string]interface{}
+
 type indexer struct{ index int }
 
 type issueEditIterator struct {