diff --git a/src/project/projectResolvers.ts b/src/project/projectResolvers.ts index a9b4f37..29107a8 100644 --- a/src/project/projectResolvers.ts +++ b/src/project/projectResolvers.ts @@ -469,6 +469,9 @@ const projectResolvers = { parentProjectInfo: { projectId, projectChain }, }: ResolverUnClaimedProjectData) => getWithdrawableBalancesOnChain(projectId, projectChain), + owner: ( + projectData: ResolverClaimedProjectData, + ): AddressDriverAccount | null => projectData.owner, }, Avatar: { __resolveType(parent: { cid: string } | { emoji: string }) { diff --git a/src/project/projectTypeDef.ts b/src/project/projectTypeDef.ts index 8671787..132f0fd 100644 --- a/src/project/projectTypeDef.ts +++ b/src/project/projectTypeDef.ts @@ -54,6 +54,7 @@ const projectTypeDef = gql` verificationStatus: ProjectVerificationStatus! support: [SupportItem!]! withdrawableBalances: [WithdrawableBalance!]! + owner: AddressDriverAccount! } input ProjectWhereInput { diff --git a/src/project/projectUtils.ts b/src/project/projectUtils.ts index 605003a..2a3f2dc 100644 --- a/src/project/projectUtils.ts +++ b/src/project/projectUtils.ts @@ -1,3 +1,4 @@ +import { ZeroAddress } from 'ethers'; import type { DbSchema, Forge, @@ -125,6 +126,8 @@ export async function toProjectRepresentation( project.verificationStatus ?? ProjectVerificationStatus.Unclaimed, isValid: true, chain: project.chain, + ownerAddress: project.ownerAddress || ZeroAddress, + ownerAccountId: project.ownerAccountId || '0', } as ProjectDataValues; } @@ -190,6 +193,11 @@ function mapUnClaimedProjectChainData( support: [], // Will be populated by the resolver. totalEarned: [], // Will be populated by the resolver. withdrawableBalances: [], // Will be populated by the resolver. + owner: { + driver: Driver.ADDRESS, + accountId: fakeUnclaimedProject.ownerAccountId, + address: fakeUnclaimedProject.ownerAddress as string, + }, } as ResolverUnClaimedProjectData; }