aboutsummaryrefslogblamecommitdiffstats
path: root/api/graphql/resolvers/comment.go
blob: 01c174162d883841e963f1d5062a917142a74f45 (plain) (tree)
1
2
3
4
5
6
7
8
9




                 



                                                       





                                                



                                                                                               


                                                                                                      
package resolvers

import (
	"context"

	"github.com/git-bug/git-bug/api/graphql/graph"
	"github.com/git-bug/git-bug/api/graphql/models"
	"github.com/git-bug/git-bug/entities/bug"
	"github.com/git-bug/git-bug/entity"
)

var _ graph.CommentResolver = &commentResolver{}

type commentResolver struct{}

func (c commentResolver) ID(ctx context.Context, obj *bug.Comment) (entity.CombinedId, error) {
	return obj.CombinedId(), nil
}

func (c commentResolver) Author(_ context.Context, obj *bug.Comment) (models.IdentityWrapper, error) {
	return models.NewLoadedIdentity(obj.Author), nil
}