1package resolvers
2
3import (
4 "context"
5
6 "github.com/git-bug/git-bug/api/graphql/graph"
7 "github.com/git-bug/git-bug/api/graphql/models"
8 "github.com/git-bug/git-bug/entities/bug"
9 "github.com/git-bug/git-bug/entity"
10)
11
12var _ graph.CommentResolver = &commentResolver{}
13
14type commentResolver struct{}
15
16func (c commentResolver) ID(ctx context.Context, obj *bug.Comment) (entity.CombinedId, error) {
17 return obj.CombinedId(), nil
18}
19
20func (c commentResolver) Author(_ context.Context, obj *bug.Comment) (models.IdentityWrapper, error) {
21 return models.NewLoadedIdentity(obj.Author), nil
22}