15809 Mark unions as nullable in GraphQL where appropriate (#15824)

* 15809 mark unions as nullable where appropriate

* 15809 fix tests

* 15809 fix tests
This commit is contained in:
Arthur Hanson
2024-04-25 06:19:19 -07:00
committed by GitHub
parent e05ca710ae
commit ded2fe9471
3 changed files with 8 additions and 5 deletions

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(