tailly_back_v2/internal/http/graph/comment_resolvers.go
madipo2611 a5a90bed7e v0.0.1
2025-04-28 15:14:02 +03:00

30 lines
915 B
Go

package graph
import (
"context"
"tailly_back_v2/internal/domain"
)
// Comment is the resolver for the comment field.
type commentResolver struct{ *Resolver }
// Author is the resolver for the author field.
func (r *commentResolver) Author(ctx context.Context, obj *domain.Comment) (*domain.User, error) {
return r.services.User.GetByID(ctx, obj.AuthorID)
}
// Post is the resolver for the post field.
func (r *commentResolver) Post(ctx context.Context, obj *domain.Comment) (*domain.Post, error) {
return r.services.Post.GetByID(ctx, obj.PostID)
}
// CreatedAt is the resolver for the createdAt field.
func (r *commentResolver) CreatedAt(ctx context.Context, obj *domain.Comment) (string, error) {
panic("not implemented")
}
// UpdatedAt is the resolver for the updatedAt field.
func (r *commentResolver) UpdatedAt(ctx context.Context, obj *domain.Comment) (string, error) {
panic("not implemented")
}