@@ -63,7 +63,7 @@ async def entity(
6363 * ,
6464 info : Info [StrawberryGQLContext ],
6565 ) -> EntityNode | None :
66- from ai .backend .common .types import ImageID
66+ from ai .backend .common .types import ImageID , SessionId
6767 from ai .backend .manager .api .gql .artifact .types import ArtifactRevision
6868 from ai .backend .manager .api .gql .container_registry .types import ContainerRegistryGQL
6969 from ai .backend .manager .api .gql .deployment .types .deployment import ModelDeployment
@@ -76,6 +76,7 @@ async def entity(
7676 from ai .backend .manager .api .gql .project_v2 .types .node import ProjectV2GQL
7777 from ai .backend .manager .api .gql .rbac .types .role import RoleGQL
7878 from ai .backend .manager .api .gql .resource_group .types import ResourceGroupGQL
79+ from ai .backend .manager .api .gql .session .types import SessionV2GQL
7980 from ai .backend .manager .api .gql .user .types .node import UserV2GQL
8081
8182 element_type = self .entity_type .to_element ()
@@ -146,9 +147,15 @@ async def entity(
146147 if cr_data is None :
147148 return None
148149 return ContainerRegistryGQL .from_data (cr_data )
150+ case RBACElementType .SESSION :
151+ session_data = await data_loaders .session_loader .load (
152+ SessionId (uuid .UUID (self .entity_id ))
153+ )
154+ if session_data is None :
155+ return None
156+ return SessionV2GQL .from_data (session_data )
149157 case (
150- RBACElementType .SESSION
151- | RBACElementType .VFOLDER
158+ RBACElementType .VFOLDER
152159 | RBACElementType .KEYPAIR
153160 | RBACElementType .NETWORK
154161 | RBACElementType .STORAGE_HOST
0 commit comments