From 6e8496f4c1767ca8a8b95716a04f1b492bef7397 Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Tue, 9 Apr 2019 17:43:17 +0200 Subject: Support gqlgen v0.8.3 --- graphql/models/gen_models.go | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'graphql/models') 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: -- cgit