Skip to content

Commit

Permalink
Change scope parameter as not-required and fix wrong query param parser
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed Oct 22, 2024
1 parent e798c6c commit f0ac696
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/ai/backend/manager/models/gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
LegacyComputeSessionList,
)
from .keypair import CreateKeyPair, DeleteKeyPair, KeyPair, KeyPairList, ModifyKeyPair
from .rbac import ScopeField, ScopeType
from .rbac import ScopeField, ScopeType, SystemScope
from .rbac.permission_defs import ComputeSessionPermission, DomainPermission
from .rbac.permission_defs import VFolderPermission as VFolderRBACPermission
from .resource_policy import (
Expand Down Expand Up @@ -391,7 +391,7 @@ class Queries(graphene.ObjectType):
domain_nodes = PaginatedConnectionField(
DomainConnection,
description="Added in 24.12.0.",
scope=ScopeField(required=True),
scope=ScopeField(),
filter=graphene.String(),
order=graphene.String(),
permission=DomainPermissionValueField(
Expand Down Expand Up @@ -991,7 +991,7 @@ async def resolve_domain_nodes(
root: Any,
info: graphene.ResolveInfo,
*,
scope: ScopeType,
scope: Optional[ScopeType] = None,
permission: DomainPermission,
filter: Optional[str] = None,
order: Optional[str] = None,
Expand All @@ -1000,6 +1000,8 @@ async def resolve_domain_nodes(
before: Optional[str] = None,
last: Optional[int] = None,
) -> ConnectionResolverResult[DomainNode]:
if scope is None:
scope = SystemScope()
return await DomainNode.get_connection(
info,
scope,
Expand Down
4 changes: 2 additions & 2 deletions src/ai/backend/manager/models/gql_models/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def parse_value(value: str) -> DomainPermission:
"row_id": ("id", None),
"name": ("name", None),
"is_active": ("is_active", None),
"created_at": ("created_at", dtparse),
"modified_at": ("modified_at", dtparse),
"created_at": ("created_at", None),
"modified_at": ("modified_at", None),
}


Expand Down

0 comments on commit f0ac696

Please sign in to comment.