diff options
Diffstat (limited to 'api/graphql/models')
-rw-r--r-- | api/graphql/models/edges.go | 4 | ||||
-rw-r--r-- | api/graphql/models/gen_models.go | 231 | ||||
-rw-r--r-- | api/graphql/models/lazy_bug.go | 16 | ||||
-rw-r--r-- | api/graphql/models/lazy_identity.go | 6 | ||||
-rw-r--r-- | api/graphql/models/models.go | 7 |
5 files changed, 133 insertions, 131 deletions
diff --git a/api/graphql/models/edges.go b/api/graphql/models/edges.go index 6a331e3e..95509970 100644 --- a/api/graphql/models/edges.go +++ b/api/graphql/models/edges.go @@ -11,12 +11,12 @@ func (e BugEdge) GetCursor() string { } // GetCursor return the cursor entry of an edge -func (e CommentEdge) GetCursor() string { +func (e BugCommentEdge) GetCursor() string { return e.Cursor } // GetCursor return the cursor entry of an edge -func (e TimelineItemEdge) GetCursor() string { +func (e BugTimelineItemEdge) GetCursor() string { return e.Cursor } diff --git a/api/graphql/models/gen_models.go b/api/graphql/models/gen_models.go index 000f4a10..36c68c0e 100644 --- a/api/graphql/models/gen_models.go +++ b/api/graphql/models/gen_models.go @@ -3,9 +3,10 @@ package models import ( - "github.com/MichaelMure/git-bug/entities/bug" - "github.com/MichaelMure/git-bug/entity/dag" - "github.com/MichaelMure/git-bug/repository" + "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" ) // An object that has an author. @@ -13,7 +14,7 @@ type Authored interface { IsAuthored() } -type AddCommentAndCloseBugInput struct { +type BugAddCommentAndCloseInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. @@ -26,7 +27,7 @@ type AddCommentAndCloseBugInput struct { Files []repository.Hash `json:"files,omitempty"` } -type AddCommentAndCloseBugPayload struct { +type BugAddCommentAndClosePayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The affected bug. @@ -37,7 +38,7 @@ type AddCommentAndCloseBugPayload struct { StatusOperation *bug.SetStatusOperation `json:"statusOperation"` } -type AddCommentAndReopenBugInput struct { +type BugAddCommentAndReopenInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. @@ -50,7 +51,7 @@ type AddCommentAndReopenBugInput struct { Files []repository.Hash `json:"files,omitempty"` } -type AddCommentAndReopenBugPayload struct { +type BugAddCommentAndReopenPayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The affected bug. @@ -61,7 +62,7 @@ type AddCommentAndReopenBugPayload struct { StatusOperation *bug.SetStatusOperation `json:"statusOperation"` } -type AddCommentInput struct { +type BugAddCommentInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. @@ -74,7 +75,7 @@ type AddCommentInput struct { Files []repository.Hash `json:"files,omitempty"` } -type AddCommentPayload struct { +type BugAddCommentPayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The affected bug. @@ -83,26 +84,7 @@ type AddCommentPayload struct { Operation *bug.AddCommentOperation `json:"operation"` } -// The connection type for Bug. -type BugConnection struct { - // A list of edges. - Edges []*BugEdge `json:"edges"` - Nodes []BugWrapper `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 { - // A cursor for use in pagination. - Cursor string `json:"cursor"` - // The item at the end of the edge. - Node BugWrapper `json:"node"` -} - -type ChangeLabelInput struct { +type BugChangeLabelInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. @@ -115,7 +97,7 @@ type ChangeLabelInput struct { Removed []string `json:"Removed,omitempty"` } -type ChangeLabelPayload struct { +type BugChangeLabelPayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The affected bug. @@ -126,37 +108,60 @@ type ChangeLabelPayload struct { Results []*bug.LabelChangeResult `json:"results"` } -type CloseBugInput struct { +type BugCommentConnection struct { + Edges []*BugCommentEdge `json:"edges"` + Nodes []*bug.Comment `json:"nodes"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type BugCommentEdge struct { + Cursor string `json:"cursor"` + Node *bug.Comment `json:"node"` +} + +// The connection type for Bug. +type BugConnection struct { + // A list of edges. + Edges []*BugEdge `json:"edges"` + Nodes []BugWrapper `json:"nodes"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int `json:"totalCount"` +} + +type BugCreateInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. RepoRef *string `json:"repoRef,omitempty"` - // The bug ID's prefix. - Prefix string `json:"prefix"` + // The title of the new bug. + Title string `json:"title"` + // The first message of the new bug. + Message string `json:"message"` + // The collection of file's hash required for the first message. + Files []repository.Hash `json:"files,omitempty"` } -type CloseBugPayload struct { +type BugCreatePayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` - // The affected bug. + // The created bug. Bug BugWrapper `json:"bug"` // The resulting operation. - Operation *bug.SetStatusOperation `json:"operation"` -} - -type CommentConnection struct { - Edges []*CommentEdge `json:"edges"` - Nodes []*bug.Comment `json:"nodes"` - PageInfo *PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` + Operation *bug.CreateOperation `json:"operation"` } -type CommentEdge struct { - Cursor string `json:"cursor"` - Node *bug.Comment `json:"node"` +// An edge in a connection. +type BugEdge struct { + // A cursor for use in pagination. + Cursor string `json:"cursor"` + // The item at the end of the edge. + Node BugWrapper `json:"node"` } -type EditCommentInput struct { +type BugEditCommentInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. @@ -169,7 +174,7 @@ type EditCommentInput struct { Files []repository.Hash `json:"files,omitempty"` } -type EditCommentPayload struct { +type BugEditCommentPayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The affected bug. @@ -178,53 +183,45 @@ type EditCommentPayload struct { Operation *bug.EditCommentOperation `json:"operation"` } -type IdentityConnection struct { - Edges []*IdentityEdge `json:"edges"` - Nodes []IdentityWrapper `json:"nodes"` - PageInfo *PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` -} - -type IdentityEdge struct { - Cursor string `json:"cursor"` - Node IdentityWrapper `json:"node"` -} - -type LabelConnection struct { - Edges []*LabelEdge `json:"edges"` - Nodes []bug.Label `json:"nodes"` - PageInfo *PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` +type BugSetTitleInput struct { + // A unique identifier for the client performing the mutation. + ClientMutationID *string `json:"clientMutationId,omitempty"` + // The name of the repository. If not set, the default repository is used. + RepoRef *string `json:"repoRef,omitempty"` + // The bug ID's prefix. + Prefix string `json:"prefix"` + // The new title. + Title string `json:"title"` } -type LabelEdge struct { - Cursor string `json:"cursor"` - Node bug.Label `json:"node"` +type BugSetTitlePayload struct { + // A unique identifier for the client performing the mutation. + ClientMutationID *string `json:"clientMutationId,omitempty"` + // The affected bug. + Bug BugWrapper `json:"bug"` + // The resulting operation + Operation *bug.SetTitleOperation `json:"operation"` } -type NewBugInput struct { +type BugStatusCloseInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. RepoRef *string `json:"repoRef,omitempty"` - // The title of the new bug. - Title string `json:"title"` - // The first message of the new bug. - Message string `json:"message"` - // The collection of file's hash required for the first message. - Files []repository.Hash `json:"files,omitempty"` + // The bug ID's prefix. + Prefix string `json:"prefix"` } -type NewBugPayload struct { +type BugStatusClosePayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` - // The created bug. + // The affected bug. Bug BugWrapper `json:"bug"` // The resulting operation. - Operation *bug.CreateOperation `json:"operation"` + Operation *bug.SetStatusOperation `json:"operation"` } -type OpenBugInput struct { +type BugStatusOpenInput struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The name of the repository. If not set, the default repository is used. @@ -233,7 +230,7 @@ type OpenBugInput struct { Prefix string `json:"prefix"` } -type OpenBugPayload struct { +type BugStatusOpenPayload struct { // A unique identifier for the client performing the mutation. ClientMutationID *string `json:"clientMutationId,omitempty"` // The affected bug. @@ -242,6 +239,47 @@ type OpenBugPayload struct { Operation *bug.SetStatusOperation `json:"operation"` } +// The connection type for TimelineItem +type BugTimelineItemConnection struct { + Edges []*BugTimelineItemEdge `json:"edges"` + Nodes []bug.TimelineItem `json:"nodes"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +// Represent a TimelineItem +type BugTimelineItemEdge struct { + Cursor string `json:"cursor"` + Node bug.TimelineItem `json:"node"` +} + +type IdentityConnection struct { + Edges []*IdentityEdge `json:"edges"` + Nodes []IdentityWrapper `json:"nodes"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type IdentityEdge struct { + Cursor string `json:"cursor"` + Node IdentityWrapper `json:"node"` +} + +type LabelConnection struct { + 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 common.Label `json:"node"` +} + +type Mutation struct { +} + // The connection type for an Operation type OperationConnection struct { Edges []*OperationEdge `json:"edges"` @@ -268,36 +306,5 @@ type PageInfo struct { EndCursor string `json:"endCursor"` } -type SetTitleInput struct { - // A unique identifier for the client performing the mutation. - ClientMutationID *string `json:"clientMutationId,omitempty"` - // The name of the repository. If not set, the default repository is used. - RepoRef *string `json:"repoRef,omitempty"` - // The bug ID's prefix. - Prefix string `json:"prefix"` - // The new title. - Title string `json:"title"` -} - -type SetTitlePayload struct { - // A unique identifier for the client performing the mutation. - ClientMutationID *string `json:"clientMutationId,omitempty"` - // The affected bug. - Bug BugWrapper `json:"bug"` - // The resulting operation - Operation *bug.SetTitleOperation `json:"operation"` -} - -// The connection type for TimelineItem -type TimelineItemConnection struct { - Edges []*TimelineItemEdge `json:"edges"` - Nodes []bug.TimelineItem `json:"nodes"` - PageInfo *PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` -} - -// Represent a TimelineItem -type TimelineItemEdge struct { - Cursor string `json:"cursor"` - Node bug.TimelineItem `json:"node"` +type Query struct { } diff --git a/api/graphql/models/lazy_bug.go b/api/graphql/models/lazy_bug.go index 4b0b598e..7570b4ea 100644 --- a/api/graphql/models/lazy_bug.go +++ b/api/graphql/models/lazy_bug.go @@ -4,11 +4,11 @@ import ( "sync" "time" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/entities/bug" - "github.com/MichaelMure/git-bug/entities/common" - "github.com/MichaelMure/git-bug/entity" - "github.com/MichaelMure/git-bug/entity/dag" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/entities/bug" + "github.com/git-bug/git-bug/entities/common" + "github.com/git-bug/git-bug/entity" + "github.com/git-bug/git-bug/entity/dag" ) // BugWrapper is an interface used by the GraphQL resolvers to handle a bug. @@ -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 } diff --git a/api/graphql/models/lazy_identity.go b/api/graphql/models/lazy_identity.go index c19d077b..a131d450 100644 --- a/api/graphql/models/lazy_identity.go +++ b/api/graphql/models/lazy_identity.go @@ -4,9 +4,9 @@ import ( "fmt" "sync" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/entities/identity" - "github.com/MichaelMure/git-bug/entity" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/entities/identity" + "github.com/git-bug/git-bug/entity" ) // IdentityWrapper is an interface used by the GraphQL resolvers to handle an identity. diff --git a/api/graphql/models/models.go b/api/graphql/models/models.go index 816a04a8..c54f4cf2 100644 --- a/api/graphql/models/models.go +++ b/api/graphql/models/models.go @@ -2,7 +2,7 @@ package models import ( - "github.com/MichaelMure/git-bug/cache" + "github.com/git-bug/git-bug/cache" ) type ConnectionInput struct { @@ -16,8 +16,3 @@ type Repository struct { Cache *cache.MultiRepoCache Repo *cache.RepoCache } - -type RepositoryMutation struct { - Cache *cache.MultiRepoCache - Repo *cache.RepoCache -} |