aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/models
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-04-09 17:43:17 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-04-09 17:43:17 +0200
commit6e8496f4c1767ca8a8b95716a04f1b492bef7397 (patch)
treeb1fecc50675159ef48056166ce906ca7f38cb7ea /graphql/models
parent30efc99f4493f3a09e94bf322cbf8ef844beea13 (diff)
downloadgit-bug-6e8496f4c1767ca8a8b95716a04f1b492bef7397.tar.gz
Support gqlgen v0.8.3
Diffstat (limited to 'graphql/models')
-rw-r--r--graphql/models/gen_models.go34
1 files changed, 24 insertions, 10 deletions
diff --git a/graphql/models/gen_models.go b/graphql/models/gen_models.go
index 172fe033..64997104 100644
--- a/graphql/models/gen_models.go
+++ b/graphql/models/gen_models.go
@@ -18,16 +18,21 @@ type Authored interface {
// The connection type for Bug.
type BugConnection struct {
- Edges []BugEdge `json:"edges"`
- Nodes []bug.Snapshot `json:"nodes"`
- PageInfo PageInfo `json:"pageInfo"`
- TotalCount int `json:"totalCount"`
+ // A list of edges.
+ Edges []BugEdge `json:"edges"`
+ Nodes []bug.Snapshot `json:"nodes"`
+ // Information to aid in pagination.
+ PageInfo PageInfo `json:"pageInfo"`
+ // Identifies the total count of items in the connection.
+ TotalCount int `json:"totalCount"`
}
// An edge in a connection.
type BugEdge struct {
- Cursor string `json:"cursor"`
- Node bug.Snapshot `json:"node"`
+ // A cursor for use in pagination.
+ Cursor string `json:"cursor"`
+ // The item at the end of the edge.
+ Node bug.Snapshot `json:"node"`
}
type CommentConnection struct {
@@ -70,10 +75,14 @@ type OperationEdge struct {
// Information about pagination in a connection.
type PageInfo struct {
- HasNextPage bool `json:"hasNextPage"`
- HasPreviousPage bool `json:"hasPreviousPage"`
- StartCursor string `json:"startCursor"`
- EndCursor string `json:"endCursor"`
+ // When paginating forwards, are there more items?
+ HasNextPage bool `json:"hasNextPage"`
+ // When paginating backwards, are there more items?
+ HasPreviousPage bool `json:"hasPreviousPage"`
+ // When paginating backwards, the cursor to continue.
+ StartCursor string `json:"startCursor"`
+ // When paginating forwards, the cursor to continue.
+ EndCursor string `json:"endCursor"`
}
// The connection type for TimelineItem
@@ -97,6 +106,11 @@ const (
StatusClosed Status = "CLOSED"
)
+var AllStatus = []Status{
+ StatusOpen,
+ StatusClosed,
+}
+
func (e Status) IsValid() bool {
switch e {
case StatusOpen, StatusClosed: