diff options
Diffstat (limited to 'graphql/resolvers')
-rw-r--r-- | graphql/resolvers/operations.go | 10 | ||||
-rw-r--r-- | graphql/resolvers/root.go | 12 |
2 files changed, 16 insertions, 6 deletions
diff --git a/graphql/resolvers/operations.go b/graphql/resolvers/operations.go index 88e15d44..c8089ac1 100644 --- a/graphql/resolvers/operations.go +++ b/graphql/resolvers/operations.go @@ -9,15 +9,21 @@ import ( "github.com/MichaelMure/git-bug/graphql/models" ) +type createOperationResolver struct{} + +func (createOperationResolver) Date(ctx context.Context, obj *bug.CreateOperation) (time.Time, error) { + return obj.Time(), nil +} + type addCommentOperationResolver struct{} func (addCommentOperationResolver) Date(ctx context.Context, obj *bug.AddCommentOperation) (time.Time, error) { return obj.Time(), nil } -type createOperationResolver struct{} +type editCommentOperationResolver struct{} -func (createOperationResolver) Date(ctx context.Context, obj *bug.CreateOperation) (time.Time, error) { +func (editCommentOperationResolver) Date(ctx context.Context, obj *bug.EditCommentOperation) (time.Time, error) { return obj.Time(), nil } diff --git a/graphql/resolvers/root.go b/graphql/resolvers/root.go index b1ce0356..9b3a730b 100644 --- a/graphql/resolvers/root.go +++ b/graphql/resolvers/root.go @@ -28,10 +28,6 @@ func (r RootResolver) Mutation() graph.MutationResolver { } } -func (RootResolver) AddCommentOperation() graph.AddCommentOperationResolver { - return &addCommentOperationResolver{} -} - func (RootResolver) Bug() graph.BugResolver { return &bugResolver{} } @@ -64,6 +60,14 @@ func (RootResolver) CreateOperation() graph.CreateOperationResolver { return &createOperationResolver{} } +func (RootResolver) AddCommentOperation() graph.AddCommentOperationResolver { + return &addCommentOperationResolver{} +} + +func (r RootResolver) EditCommentOperation() graph.EditCommentOperationResolver { + return &editCommentOperationResolver{} +} + func (RootResolver) LabelChangeOperation() graph.LabelChangeOperationResolver { return &labelChangeOperation{} } |