aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-02-19 00:10:40 +0100
committerMichael Muré <batolettre@gmail.com>2019-03-01 22:40:27 +0100
commitffe35fece1b1526949107f154abc21a1a02fc74d (patch)
tree04eaf4ca55c6b69aeb44c7322b234d0a481dded1 /graphql/resolvers
parent54f9838f0ab22ce5285f21cdd117ad81c737d822 (diff)
downloadgit-bug-ffe35fece1b1526949107f154abc21a1a02fc74d.tar.gz
identity: complete the graphql api
Diffstat (limited to 'graphql/resolvers')
-rw-r--r--graphql/resolvers/identity.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/graphql/resolvers/identity.go b/graphql/resolvers/identity.go
index cc68197f..d4f9bba2 100644
--- a/graphql/resolvers/identity.go
+++ b/graphql/resolvers/identity.go
@@ -8,6 +8,10 @@ import (
type identityResolver struct{}
+func (identityResolver) ID(ctx context.Context, obj *identity.Interface) (string, error) {
+ return (*obj).Id(), nil
+}
+
func (identityResolver) Name(ctx context.Context, obj *identity.Interface) (*string, error) {
return nilIfEmpty((*obj).Name())
}
@@ -28,6 +32,10 @@ func (identityResolver) AvatarURL(ctx context.Context, obj *identity.Interface)
return nilIfEmpty((*obj).AvatarUrl())
}
+func (identityResolver) IsProtected(ctx context.Context, obj *identity.Interface) (bool, error) {
+ return (*obj).IsProtected(), nil
+}
+
func nilIfEmpty(s string) (*string, error) {
if s == "" {
return nil, nil