1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

9856 fix partial dcim FK

This commit is contained in:
Arthur
2024-03-07 10:48:50 -08:00
parent e53475a63f
commit 676764a661
3 changed files with 48 additions and 33 deletions

View File

@@ -3,7 +3,7 @@ from typing import Annotated, List
import strawberry
import strawberry_django
from dcim.graphql.types import ComponentObjectType
from dcim.graphql.types import ComponentType
from extras.graphql.mixins import ConfigContextMixin
from ipam.graphql.mixins import IPAddressesMixin, VLANGroupsMixin
from netbox.graphql.scalars import BigInt
@@ -110,8 +110,7 @@ class VirtualMachineType(ConfigContextMixin, NetBoxObjectType):
fields='__all__',
filters=VMInterfaceFilter
)
class VMInterfaceType(IPAddressesMixin, ComponentObjectType):
_name: str
class VMInterfaceType(IPAddressesMixin, ComponentType):
mac_address: str | None
parent: Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')] | None
bridge: Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')] | None
@@ -141,6 +140,5 @@ class VMInterfaceType(IPAddressesMixin, ComponentObjectType):
fields='__all__',
filters=VirtualDiskFilter
)
class VirtualDiskType(ComponentObjectType):
_name: str
class VirtualDiskType(ComponentType):
virtual_machine: Annotated["VirtualMachineType", strawberry.lazy('virtualization.graphql.types')]