blob: 5210dcc9ce8644cd58b8a0b8a3f066bf4c4b59aa (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package resolvers
import (
"context"
"image/color"
"github.com/MichaelMure/git-bug/api/graphql/graph"
"github.com/MichaelMure/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
}
|