aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers/timeline.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-08-12 16:12:14 +0200
committerMichael Muré <batolettre@gmail.com>2019-08-12 16:12:14 +0200
commit99b5c58d43137bd9f6503788a55484327b0c531f (patch)
tree08ecc0f923b5f1fb4e8a7627aeabccb335d92ad1 /graphql/resolvers/timeline.go
parent67a3752e176790e82a48706236f889cab4f8913d (diff)
downloadgit-bug-99b5c58d43137bd9f6503788a55484327b0c531f.tar.gz
finish the refactoring for the dedicated identifier type
Diffstat (limited to 'graphql/resolvers/timeline.go')
-rw-r--r--graphql/resolvers/timeline.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/graphql/resolvers/timeline.go b/graphql/resolvers/timeline.go
index 27f799ba..b206f898 100644
--- a/graphql/resolvers/timeline.go
+++ b/graphql/resolvers/timeline.go
@@ -5,9 +5,12 @@ import (
"time"
"github.com/MichaelMure/git-bug/bug"
+ "github.com/MichaelMure/git-bug/graphql/graph"
"github.com/MichaelMure/git-bug/graphql/models"
)
+var _ graph.CommentHistoryStepResolver = commentHistoryStepResolver{}
+
type commentHistoryStepResolver struct{}
func (commentHistoryStepResolver) Date(ctx context.Context, obj *bug.CommentHistoryStep) (*time.Time, error) {
@@ -15,8 +18,14 @@ func (commentHistoryStepResolver) Date(ctx context.Context, obj *bug.CommentHist
return &t, nil
}
+var _ graph.AddCommentTimelineItemResolver = addCommentTimelineItemResolver{}
+
type addCommentTimelineItemResolver struct{}
+func (addCommentTimelineItemResolver) ID(ctx context.Context, obj *bug.AddCommentTimelineItem) (string, error) {
+ return obj.Id().String(), nil
+}
+
func (addCommentTimelineItemResolver) CreatedAt(ctx context.Context, obj *bug.AddCommentTimelineItem) (*time.Time, error) {
t := obj.CreatedAt.Time()
return &t, nil
@@ -27,8 +36,14 @@ func (addCommentTimelineItemResolver) LastEdit(ctx context.Context, obj *bug.Add
return &t, nil
}
+var _ graph.CreateTimelineItemResolver = createTimelineItemResolver{}
+
type createTimelineItemResolver struct{}
+func (createTimelineItemResolver) ID(ctx context.Context, obj *bug.CreateTimelineItem) (string, error) {
+ return obj.Id().String(), nil
+}
+
func (createTimelineItemResolver) CreatedAt(ctx context.Context, obj *bug.CreateTimelineItem) (*time.Time, error) {
t := obj.CreatedAt.Time()
return &t, nil
@@ -39,15 +54,27 @@ func (createTimelineItemResolver) LastEdit(ctx context.Context, obj *bug.CreateT
return &t, nil
}
+var _ graph.LabelChangeTimelineItemResolver = labelChangeTimelineItem{}
+
type labelChangeTimelineItem struct{}
+func (labelChangeTimelineItem) ID(ctx context.Context, obj *bug.LabelChangeTimelineItem) (string, error) {
+ return obj.Id().String(), nil
+}
+
func (labelChangeTimelineItem) Date(ctx context.Context, obj *bug.LabelChangeTimelineItem) (*time.Time, error) {
t := obj.UnixTime.Time()
return &t, nil
}
+var _ graph.SetStatusTimelineItemResolver = setStatusTimelineItem{}
+
type setStatusTimelineItem struct{}
+func (setStatusTimelineItem) ID(ctx context.Context, obj *bug.SetStatusTimelineItem) (string, error) {
+ return obj.Id().String(), nil
+}
+
func (setStatusTimelineItem) Date(ctx context.Context, obj *bug.SetStatusTimelineItem) (*time.Time, error) {
t := obj.UnixTime.Time()
return &t, nil
@@ -57,8 +84,14 @@ func (setStatusTimelineItem) Status(ctx context.Context, obj *bug.SetStatusTimel
return convertStatus(obj.Status)
}
+var _ graph.SetTitleTimelineItemResolver = setTitleTimelineItem{}
+
type setTitleTimelineItem struct{}
+func (setTitleTimelineItem) ID(ctx context.Context, obj *bug.SetTitleTimelineItem) (string, error) {
+ return obj.Id().String(), nil
+}
+
func (setTitleTimelineItem) Date(ctx context.Context, obj *bug.SetTitleTimelineItem) (*time.Time, error) {
t := obj.UnixTime.Time()
return &t, nil