git-bug/api/graphql/resolvers/identity.go

22 lines
494 B
Go
Raw Normal View History

2019-01-19 18:01:06 +03:00
package resolvers
import (
"context"
"github.com/MichaelMure/git-bug/api/graphql/graph"
"github.com/MichaelMure/git-bug/api/graphql/models"
2019-01-19 18:01:06 +03:00
)
var _ graph.IdentityResolver = &identityResolver{}
2019-01-19 18:01:06 +03:00
type identityResolver struct{}
func (identityResolver) ID(ctx context.Context, obj models.IdentityWrapper) (string, error) {
return obj.Id().String(), nil
2019-02-19 02:10:40 +03:00
}
2020-02-08 19:22:45 +03:00
func (r identityResolver) HumanID(ctx context.Context, obj models.IdentityWrapper) (string, error) {
2020-02-08 19:22:45 +03:00
return obj.Id().Human(), nil
}