diff --git a/apiserver/plane/graphql/types/project.py b/apiserver/plane/graphql/types/project.py index 6271ab0ca4..4988342a2b 100644 --- a/apiserver/plane/graphql/types/project.py +++ b/apiserver/plane/graphql/types/project.py @@ -44,6 +44,7 @@ class ProjectType: total_members: int total_issues: int total_active_issues: int + role: int @strawberry.field def workspace(self) -> int: @@ -73,6 +74,16 @@ class ProjectType: ).count() )() return projects + + @strawberry.field + async def role(self, info: strawberry.Info) -> int: + project_member = await sync_to_async( + lambda: ProjectMember.objects.get( + project_id=self.id, is_active=True, member_id=info.context.user.id + ) + )() + return project_member.role + @strawberry.field async def total_issues(self, info: Info) -> int: