aboutsummaryrefslogblamecommitdiffstats
path: root/api/graphql/resolvers/label.go
blob: 8fe6c8e522e73e9d34286d28a57267e026bac297 (plain) (tree)
1
2
3
4
5
6
7
8





                     

                                                      










                                                                                      
                                  

                         
package resolvers

import (
	"context"
	"image/color"

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

var _ graph.LabelResolver = &labelResolver{}

type labelResolver struct{}

func (labelResolver) Name(ctx context.Context, obj *bug.Label) (string, error) {
	return obj.String(), nil
}

func (labelResolver) Color(ctx context.Context, obj *bug.Label) (*color.RGBA, error) {
	rgba := obj.Color().RGBA()
	return &rgba, nil
}