mirror of
https://github.com/MichaelMure/git-bug.git
synced 2025-01-05 17:33:12 +03:00
23 lines
457 B
Go
23 lines
457 B
Go
|
package resolvers
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"image/color"
|
||
|
|
||
|
"github.com/MichaelMure/git-bug/bug"
|
||
|
"github.com/MichaelMure/git-bug/graphql/graph"
|
||
|
)
|
||
|
|
||
|
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.RGBA()
|
||
|
return &rgba, nil
|
||
|
}
|