aboutsummaryrefslogtreecommitdiffstats
path: root/api/graphql
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-08-20 11:01:37 +0200
committerGitHub <noreply@github.com>2022-08-20 11:01:37 +0200
commit855684149740e2fb8eec21f3d97df2eba39b27c5 (patch)
treea3bd60a9f533fc6fc11a094038d095510210cd23 /api/graphql
parent58df94d38d754bff4dcca11e2ae4b99326a9a87e (diff)
parent8818d091e85087766d7f493b7dfaf1aedc3a4ab0 (diff)
downloadgit-bug-855684149740e2fb8eec21f3d97df2eba39b27c5.tar.gz
Merge pull request #856 from MichaelMure/common-status
move bug.Status in entities/common for reuse
Diffstat (limited to 'api/graphql')
-rw-r--r--api/graphql/gqlgen.yml1
-rw-r--r--api/graphql/graph/bug.generated.go11
-rw-r--r--api/graphql/graph/operations.generated.go5
-rw-r--r--api/graphql/graph/timeline.generated.go7
-rw-r--r--api/graphql/graph/types.generated.go2
-rw-r--r--api/graphql/models/lazy_bug.go7
6 files changed, 21 insertions, 12 deletions
diff --git a/api/graphql/gqlgen.yml b/api/graphql/gqlgen.yml
index 4c854426..fbb46db6 100644
--- a/api/graphql/gqlgen.yml
+++ b/api/graphql/gqlgen.yml
@@ -12,6 +12,7 @@ autobind:
- "github.com/MichaelMure/git-bug/api/graphql/models"
- "github.com/MichaelMure/git-bug/repository"
- "github.com/MichaelMure/git-bug/entity/dag"
+ - "github.com/MichaelMure/git-bug/entities/common"
- "github.com/MichaelMure/git-bug/entities/bug"
- "github.com/MichaelMure/git-bug/entities/identity"
diff --git a/api/graphql/graph/bug.generated.go b/api/graphql/graph/bug.generated.go
index 77f4fe0b..67af1933 100644
--- a/api/graphql/graph/bug.generated.go
+++ b/api/graphql/graph/bug.generated.go
@@ -14,6 +14,7 @@ import (
"github.com/99designs/gqlgen/graphql"
"github.com/MichaelMure/git-bug/api/graphql/models"
"github.com/MichaelMure/git-bug/entities/bug"
+ "github.com/MichaelMure/git-bug/entities/common"
"github.com/MichaelMure/git-bug/repository"
"github.com/vektah/gqlparser/v2/ast"
)
@@ -370,9 +371,9 @@ func (ec *executionContext) _Bug_status(ctx context.Context, field graphql.Colle
}
return graphql.Null
}
- res := resTmp.(bug.Status)
+ res := resTmp.(common.Status)
fc.Result = res
- return ec.marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋbugᚐStatus(ctx, field.Selections, res)
+ return ec.marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋcommonᚐStatus(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Bug_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
@@ -2425,13 +2426,13 @@ func (ec *executionContext) marshalNCommentEdge2ᚖgithubᚗcomᚋMichaelMureᚋ
return ec._CommentEdge(ctx, sel, v)
}
-func (ec *executionContext) unmarshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋbugᚐStatus(ctx context.Context, v interface{}) (bug.Status, error) {
- var res bug.Status
+func (ec *executionContext) unmarshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋcommonᚐStatus(ctx context.Context, v interface{}) (common.Status, error) {
+ var res common.Status
err := res.UnmarshalGQL(v)
return res, graphql.ErrorOnPath(ctx, err)
}
-func (ec *executionContext) marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋbugᚐStatus(ctx context.Context, sel ast.SelectionSet, v bug.Status) graphql.Marshaler {
+func (ec *executionContext) marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋcommonᚐStatus(ctx context.Context, sel ast.SelectionSet, v common.Status) graphql.Marshaler {
return v
}
diff --git a/api/graphql/graph/operations.generated.go b/api/graphql/graph/operations.generated.go
index d82fa5d4..39a216f4 100644
--- a/api/graphql/graph/operations.generated.go
+++ b/api/graphql/graph/operations.generated.go
@@ -14,6 +14,7 @@ import (
"github.com/99designs/gqlgen/graphql"
"github.com/MichaelMure/git-bug/api/graphql/models"
"github.com/MichaelMure/git-bug/entities/bug"
+ "github.com/MichaelMure/git-bug/entities/common"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
"github.com/vektah/gqlparser/v2/ast"
@@ -1573,9 +1574,9 @@ func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, fiel
}
return graphql.Null
}
- res := resTmp.(bug.Status)
+ res := resTmp.(common.Status)
fc.Result = res
- return ec.marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋbugᚐStatus(ctx, field.Selections, res)
+ return ec.marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋcommonᚐStatus(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_SetStatusOperation_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
diff --git a/api/graphql/graph/timeline.generated.go b/api/graphql/graph/timeline.generated.go
index 9d9b85b4..9ad32e0b 100644
--- a/api/graphql/graph/timeline.generated.go
+++ b/api/graphql/graph/timeline.generated.go
@@ -14,6 +14,7 @@ import (
"github.com/99designs/gqlgen/graphql"
"github.com/MichaelMure/git-bug/api/graphql/models"
"github.com/MichaelMure/git-bug/entities/bug"
+ "github.com/MichaelMure/git-bug/entities/common"
"github.com/MichaelMure/git-bug/repository"
"github.com/vektah/gqlparser/v2/ast"
)
@@ -1419,9 +1420,9 @@ func (ec *executionContext) _SetStatusTimelineItem_status(ctx context.Context, f
}
return graphql.Null
}
- res := resTmp.(bug.Status)
+ res := resTmp.(common.Status)
fc.Result = res
- return ec.marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋbugᚐStatus(ctx, field.Selections, res)
+ return ec.marshalNStatus2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentitiesᚋcommonᚐStatus(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_SetStatusTimelineItem_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
@@ -1991,6 +1992,8 @@ func (ec *executionContext) _TimelineItem(ctx context.Context, sel ast.Selection
return graphql.Null
}
return ec._SetStatusTimelineItem(ctx, sel, obj)
+ case bug.SetTitleTimelineItem:
+ return ec._SetTitleTimelineItem(ctx, sel, &obj)
case *bug.SetTitleTimelineItem:
if obj == nil {
return graphql.Null
diff --git a/api/graphql/graph/types.generated.go b/api/graphql/graph/types.generated.go
index d29004e1..9095c7ac 100644
--- a/api/graphql/graph/types.generated.go
+++ b/api/graphql/graph/types.generated.go
@@ -424,6 +424,8 @@ func (ec *executionContext) _Authored(ctx context.Context, sel ast.SelectionSet,
return graphql.Null
}
return ec._SetStatusTimelineItem(ctx, sel, obj)
+ case bug.SetTitleTimelineItem:
+ return ec._SetTitleTimelineItem(ctx, sel, &obj)
case *bug.SetTitleTimelineItem:
if obj == nil {
return graphql.Null
diff --git a/api/graphql/models/lazy_bug.go b/api/graphql/models/lazy_bug.go
index ea21a68d..318fdc99 100644
--- a/api/graphql/models/lazy_bug.go
+++ b/api/graphql/models/lazy_bug.go
@@ -6,6 +6,7 @@ import (
"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"
)
@@ -16,7 +17,7 @@ import (
type BugWrapper interface {
Id() entity.Id
LastEdit() time.Time
- Status() bug.Status
+ Status() common.Status
Title() string
Comments() ([]bug.Comment, error)
Labels() []bug.Label
@@ -85,7 +86,7 @@ func (lb *lazyBug) LastEdit() time.Time {
return lb.excerpt.EditTime()
}
-func (lb *lazyBug) Status() bug.Status {
+func (lb *lazyBug) Status() common.Status {
return lb.excerpt.Status
}
@@ -167,7 +168,7 @@ func (l *loadedBug) LastEdit() time.Time {
return l.Snapshot.EditTime()
}
-func (l *loadedBug) Status() bug.Status {
+func (l *loadedBug) Status() common.Status {
return l.Snapshot.Status
}