aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers/timeline.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-30 11:00:39 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-30 11:03:42 +0200
commit037f5bf50b2bb2b020620413d186b6acf47a0b61 (patch)
tree6639ac6f8c53bcc4a27660ea92faff46974e98b2 /graphql/resolvers/timeline.go
parentd450c7a883876e0f5356fb5cb54109a0a2a77dfd (diff)
downloadgit-bug-037f5bf50b2bb2b020620413d186b6acf47a0b61.tar.gz
timeline: various minor improvements
Diffstat (limited to 'graphql/resolvers/timeline.go')
-rw-r--r--graphql/resolvers/timeline.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/graphql/resolvers/timeline.go b/graphql/resolvers/timeline.go
new file mode 100644
index 00000000..9b8262fe
--- /dev/null
+++ b/graphql/resolvers/timeline.go
@@ -0,0 +1,36 @@
+package resolvers
+
+import (
+ "context"
+ "time"
+
+ "github.com/MichaelMure/git-bug/bug"
+)
+
+type commentHistoryStepResolver struct{}
+
+func (commentHistoryStepResolver) Date(ctx context.Context, obj *bug.CommentHistoryStep) (time.Time, error) {
+ return obj.UnixTime.Time(), nil
+}
+
+type commentTimelineItemResolver struct{}
+
+func (commentTimelineItemResolver) CreatedAt(ctx context.Context, obj *bug.CommentTimelineItem) (time.Time, error) {
+ return obj.CreatedAt.Time(), nil
+}
+
+func (commentTimelineItemResolver) LastEdit(ctx context.Context, obj *bug.CommentTimelineItem) (time.Time, error) {
+ return obj.LastEdit.Time(), nil
+}
+
+type createTimelineItemResolver struct{}
+
+func (createTimelineItemResolver) CreatedAt(ctx context.Context, obj *bug.CreateTimelineItem) (time.Time, error) {
+ return obj.CreatedAt.Time(), nil
+
+}
+
+func (createTimelineItemResolver) LastEdit(ctx context.Context, obj *bug.CreateTimelineItem) (time.Time, error) {
+ return obj.LastEdit.Time(), nil
+
+}