15809 mark unions as nullable where appropriate

This commit is contained in:
Arthur 2024-04-23 09:08:45 -07:00
parent c32dff5649
commit c80953fb88
3 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,7 @@ class CabledObjectMixin:
Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')],
Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')],
Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')],
], strawberry.union("LinkPeerType")]]
], strawberry.union("LinkPeerType")]] | None
@strawberry.type
@ -40,4 +40,4 @@ class PathEndpointMixin:
Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')],
Annotated["ProviderNetworkType", strawberry.lazy('circuits.graphql.types')],
Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')],
], strawberry.union("ConnectedEndpointType")]]
], strawberry.union("ConnectedEndpointType")]] | None

View File

@ -130,7 +130,7 @@ class CableTerminationType(NetBoxObjectType):
Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')],
Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')],
Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')],
], strawberry.union("CableTerminationTerminationType")]
], strawberry.union("CableTerminationTerminationType")] | None
@strawberry_django.type(
@ -302,7 +302,7 @@ class InventoryItemTemplateType(ComponentTemplateType):
Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')],
Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')],
Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')],
], strawberry.union("InventoryItemTemplateComponentType")]
], strawberry.union("InventoryItemTemplateComponentType")] | None
@strawberry_django.type(
@ -431,7 +431,7 @@ class InventoryItemType(ComponentType):
Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')],
Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')],
Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')],
], strawberry.union("InventoryItemComponentType")]
], strawberry.union("InventoryItemComponentType")] | None
@strawberry_django.type(

View File

@ -133,7 +133,7 @@ class IPAddressType(NetBoxObjectType, BaseIPAddressFamilyType):
Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')],
Annotated["FHRPGroupType", strawberry.lazy('ipam.graphql.types')],
Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')],
], strawberry.union("IPAddressAssignmentType")]:
], strawberry.union("IPAddressAssignmentType")] | None:
return self.assigned_object
@ -261,7 +261,7 @@ class VLANGroupType(OrganizationalObjectType):
Annotated["RegionType", strawberry.lazy('dcim.graphql.types')],
Annotated["SiteType", strawberry.lazy('dcim.graphql.types')],
Annotated["SiteGroupType", strawberry.lazy('dcim.graphql.types')],
], strawberry.union("VLANGroupScopeType")]:
], strawberry.union("VLANGroupScopeType")] | None:
return self.scope