mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-24 09:48:45 +02:00
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
from typing import List
|
||||
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
|
||||
@@ -9,10 +7,10 @@ from .types import *
|
||||
@strawberry.type(name="Query")
|
||||
class WirelessQuery:
|
||||
wireless_lan: WirelessLANType = strawberry_django.field()
|
||||
wireless_lan_list: List[WirelessLANType] = strawberry_django.field()
|
||||
wireless_lan_list: list[WirelessLANType] = strawberry_django.field()
|
||||
|
||||
wireless_lan_group: WirelessLANGroupType = strawberry_django.field()
|
||||
wireless_lan_group_list: List[WirelessLANGroupType] = strawberry_django.field()
|
||||
wireless_lan_group_list: list[WirelessLANGroupType] = strawberry_django.field()
|
||||
|
||||
wireless_link: WirelessLinkType = strawberry_django.field()
|
||||
wireless_link_list: List[WirelessLinkType] = strawberry_django.field()
|
||||
wireless_link_list: list[WirelessLinkType] = strawberry_django.field()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import TYPE_CHECKING, Annotated, List, Union
|
||||
from typing import TYPE_CHECKING, Annotated
|
||||
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
@@ -29,8 +29,8 @@ __all__ = (
|
||||
class WirelessLANGroupType(NestedGroupObjectType):
|
||||
parent: Annotated["WirelessLANGroupType", strawberry.lazy('wireless.graphql.types')] | None
|
||||
|
||||
wireless_lans: List[Annotated["WirelessLANType", strawberry.lazy('wireless.graphql.types')]]
|
||||
children: List[Annotated["WirelessLANGroupType", strawberry.lazy('wireless.graphql.types')]]
|
||||
wireless_lans: list[Annotated["WirelessLANType", strawberry.lazy('wireless.graphql.types')]]
|
||||
children: list[Annotated["WirelessLANGroupType", strawberry.lazy('wireless.graphql.types')]]
|
||||
|
||||
|
||||
@strawberry_django.type(
|
||||
@@ -44,15 +44,16 @@ class WirelessLANType(PrimaryObjectType):
|
||||
vlan: Annotated["VLANType", strawberry.lazy('ipam.graphql.types')] | None
|
||||
tenant: Annotated["TenantType", strawberry.lazy('tenancy.graphql.types')] | None
|
||||
|
||||
interfaces: List[Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')]]
|
||||
interfaces: list[Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')]]
|
||||
|
||||
@strawberry_django.field
|
||||
def scope(self) -> Annotated[Union[
|
||||
Annotated["LocationType", strawberry.lazy('dcim.graphql.types')],
|
||||
Annotated["RegionType", strawberry.lazy('dcim.graphql.types')],
|
||||
Annotated["SiteGroupType", strawberry.lazy('dcim.graphql.types')],
|
||||
Annotated["SiteType", strawberry.lazy('dcim.graphql.types')],
|
||||
], strawberry.union("WirelessLANScopeType")] | None:
|
||||
def scope(self) -> Annotated[
|
||||
Annotated['LocationType', strawberry.lazy('dcim.graphql.types')]
|
||||
| Annotated['RegionType', strawberry.lazy('dcim.graphql.types')]
|
||||
| Annotated['SiteGroupType', strawberry.lazy('dcim.graphql.types')]
|
||||
| Annotated['SiteType', strawberry.lazy('dcim.graphql.types')],
|
||||
strawberry.union('WirelessLANScopeType'),
|
||||
] | None:
|
||||
return self.scope
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user