mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
@@ -94,6 +94,21 @@ export class WorkspaceResolver {
|
||||
});
|
||||
}
|
||||
|
||||
@ResolveField(() => Boolean, {
|
||||
description: 'is current workspace initialized',
|
||||
complexity: 2,
|
||||
})
|
||||
async initialized(@Parent() workspace: WorkspaceType) {
|
||||
return this.prisma.snapshot
|
||||
.count({
|
||||
where: {
|
||||
id: workspace.id,
|
||||
workspaceId: workspace.id,
|
||||
},
|
||||
})
|
||||
.then(count => count > 0);
|
||||
}
|
||||
|
||||
@ResolveField(() => UserType, {
|
||||
description: 'Owner of workspace',
|
||||
complexity: 2,
|
||||
|
||||
@@ -893,6 +893,9 @@ type WorkspaceType {
|
||||
histories(before: DateTime, guid: String!, take: Int): [DocHistoryType!]!
|
||||
id: ID!
|
||||
|
||||
"""is current workspace initialized"""
|
||||
initialized: Boolean!
|
||||
|
||||
"""member count of workspace"""
|
||||
memberCount: Int!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user