From ffe35fece1b1526949107f154abc21a1a02fc74d Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 19 Feb 2019 00:10:40 +0100 Subject: identity: complete the graphql api --- graphql/resolvers/identity.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'graphql/resolvers/identity.go') 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 -- cgit