From 5511c230b678a181cc596238bf6669428d1b1902 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 18 Aug 2022 23:34:05 +0200 Subject: move {bug,identity} to /entities, move input to /commands --- api/graphql/models/gen_models.go | 94 +--------------------------------------- 1 file changed, 1 insertion(+), 93 deletions(-) (limited to 'api/graphql/models/gen_models.go') diff --git a/api/graphql/models/gen_models.go b/api/graphql/models/gen_models.go index 5e2e1715..c4e40cba 100644 --- a/api/graphql/models/gen_models.go +++ b/api/graphql/models/gen_models.go @@ -3,11 +3,7 @@ package models import ( - "fmt" - "io" - "strconv" - - "github.com/MichaelMure/git-bug/bug" + "github.com/MichaelMure/git-bug/entities/bug" "github.com/MichaelMure/git-bug/entity/dag" "github.com/MichaelMure/git-bug/repository" ) @@ -307,91 +303,3 @@ type TimelineItemEdge struct { Cursor string `json:"cursor"` Node bug.TimelineItem `json:"node"` } - -type LabelChangeStatus string - -const ( - LabelChangeStatusAdded LabelChangeStatus = "ADDED" - LabelChangeStatusRemoved LabelChangeStatus = "REMOVED" - LabelChangeStatusDuplicateInOp LabelChangeStatus = "DUPLICATE_IN_OP" - LabelChangeStatusAlreadyExist LabelChangeStatus = "ALREADY_EXIST" - LabelChangeStatusDoesntExist LabelChangeStatus = "DOESNT_EXIST" -) - -var AllLabelChangeStatus = []LabelChangeStatus{ - LabelChangeStatusAdded, - LabelChangeStatusRemoved, - LabelChangeStatusDuplicateInOp, - LabelChangeStatusAlreadyExist, - LabelChangeStatusDoesntExist, -} - -func (e LabelChangeStatus) IsValid() bool { - switch e { - case LabelChangeStatusAdded, LabelChangeStatusRemoved, LabelChangeStatusDuplicateInOp, LabelChangeStatusAlreadyExist, LabelChangeStatusDoesntExist: - return true - } - return false -} - -func (e LabelChangeStatus) String() string { - return string(e) -} - -func (e *LabelChangeStatus) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = LabelChangeStatus(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid LabelChangeStatus", str) - } - return nil -} - -func (e LabelChangeStatus) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} - -type Status string - -const ( - StatusOpen Status = "OPEN" - StatusClosed Status = "CLOSED" -) - -var AllStatus = []Status{ - StatusOpen, - StatusClosed, -} - -func (e Status) IsValid() bool { - switch e { - case StatusOpen, StatusClosed: - return true - } - return false -} - -func (e Status) String() string { - return string(e) -} - -func (e *Status) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = Status(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid Status", str) - } - return nil -} - -func (e Status) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} -- cgit From 45b04351d8d02e53b3401b0ee23f7cbe750b63cd Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 3 May 2021 11:45:15 +0200 Subject: bug: have a type for combined ids, fix https://github.com/MichaelMure/git-bug/issues/653 --- api/graphql/models/gen_models.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'api/graphql/models/gen_models.go') diff --git a/api/graphql/models/gen_models.go b/api/graphql/models/gen_models.go index c4e40cba..d75b3d27 100644 --- a/api/graphql/models/gen_models.go +++ b/api/graphql/models/gen_models.go @@ -161,10 +161,8 @@ type EditCommentInput struct { ClientMutationID *string `json:"clientMutationId"` // The name of the repository. If not set, the default repository is used. RepoRef *string `json:"repoRef"` - // The bug ID's prefix. - Prefix string `json:"prefix"` - // The ID of the comment to be changed. - Target string `json:"target"` + // A prefix of the CombinedId of the comment to be changed. + TargetPrefix string `json:"targetPrefix"` // The new message to be set. Message string `json:"message"` // The collection of file's hash required for the first message. -- cgit