diff options
author | Michael Muré <batolettre@gmail.com> | 2024-08-25 20:40:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-25 18:40:23 +0000 |
commit | 3a4b8805dfd794cc25f57e99c73ddec651805af1 (patch) | |
tree | b6af67c761c96b323400d061db22ceed73fb0bb0 /api/graphql/models | |
parent | c3ff05f95bdfad6c2ea4cb899024fd47ac503b5f (diff) | |
download | git-bug-3a4b8805dfd794cc25f57e99c73ddec651805af1.tar.gz |
core: make label a common type, in a similar fashion as for status (#1252)
This will be useful for Board, and likely code review support later
Diffstat (limited to 'api/graphql/models')
-rw-r--r-- | api/graphql/models/gen_models.go | 19 | ||||
-rw-r--r-- | api/graphql/models/lazy_bug.go | 6 |
2 files changed, 16 insertions, 9 deletions
diff --git a/api/graphql/models/gen_models.go b/api/graphql/models/gen_models.go index a63233a1..a09b36b4 100644 --- a/api/graphql/models/gen_models.go +++ b/api/graphql/models/gen_models.go @@ -4,6 +4,7 @@ package models import ( "github.com/git-bug/git-bug/entities/bug" + "github.com/git-bug/git-bug/entities/common" "github.com/git-bug/git-bug/entity/dag" "github.com/git-bug/git-bug/repository" ) @@ -191,15 +192,18 @@ type IdentityEdge struct { } type LabelConnection struct { - Edges []*LabelEdge `json:"edges"` - Nodes []bug.Label `json:"nodes"` - PageInfo *PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` + Edges []*LabelEdge `json:"edges"` + Nodes []common.Label `json:"nodes"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` } type LabelEdge struct { - Cursor string `json:"cursor"` - Node bug.Label `json:"node"` + Cursor string `json:"cursor"` + Node common.Label `json:"node"` +} + +type Mutation struct { } type NewBugInput struct { @@ -268,6 +272,9 @@ type PageInfo struct { EndCursor string `json:"endCursor"` } +type Query struct { +} + type SetTitleInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` diff --git a/api/graphql/models/lazy_bug.go b/api/graphql/models/lazy_bug.go index a843c97a..7570b4ea 100644 --- a/api/graphql/models/lazy_bug.go +++ b/api/graphql/models/lazy_bug.go @@ -20,7 +20,7 @@ type BugWrapper interface { Status() common.Status Title() string Comments() ([]bug.Comment, error) - Labels() []bug.Label + Labels() []common.Label Author() (IdentityWrapper, error) Actors() ([]IdentityWrapper, error) Participants() ([]IdentityWrapper, error) @@ -102,7 +102,7 @@ func (lb *lazyBug) Comments() ([]bug.Comment, error) { return lb.snap.Comments, nil } -func (lb *lazyBug) Labels() []bug.Label { +func (lb *lazyBug) Labels() []common.Label { return lb.excerpt.Labels } @@ -180,7 +180,7 @@ func (l *loadedBug) Comments() ([]bug.Comment, error) { return l.Snapshot.Comments, nil } -func (l *loadedBug) Labels() []bug.Label { +func (l *loadedBug) Labels() []common.Label { return l.Snapshot.Labels } |