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

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

@@ -469,6 +469,9 @@ class APIViewTestCases:
elif type(field.type) is StrawberryUnion:
# this would require a fragment query
continue
elif type(field.type) is StrawberryOptional and type(field.type.of_type) is StrawberryUnion:
# this would require a fragment query
continue
elif type(field.type) is StrawberryOptional and type(field.type.of_type) is LazyType:
fields_string += f'{field.name} {{ id }}\n'
elif hasattr(field, 'is_relation') and field.is_relation: