Skip to content

Commit

Permalink
fix: Identity.isManaged
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Dec 16, 2019
1 parent 17e1186 commit 38ad11e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/daf-core/src/graphql/graphql-identity-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const managedIdentities = async (_: any, args: any, ctx: Context) => {
}))
}

const isManaged = async (identity: any, args: any, ctx: Context) => {
const list = await ctx.core.identityManager.listDids()
return list.indexOf(identity.did) > -1
}

const createIdentity = async (
_: any,
args: {
Expand Down Expand Up @@ -74,6 +79,9 @@ const managedIdentitySecret = async (
// Actions

export const resolvers = {
Identity: {
isManaged,
},
Query: {
managedIdentityTypes,
managedIdentities,
Expand Down Expand Up @@ -101,6 +109,7 @@ export const typeDefs = `
extend type Identity {
type: String
isManaged: Boolean!
}
`

0 comments on commit 38ad11e

Please sign in to comment.