aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers/identity.go
diff options
context:
space:
mode:
Diffstat (limited to 'graphql/resolvers/identity.go')
-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