Ignore private fields when constructing test GraphQL requests

This commit is contained in:
Jeremy Stretch 2025-07-30 12:44:40 -04:00
parent 945b8b6832
commit de72ac97cb

View File

@ -470,6 +470,9 @@ class APIViewTestCases:
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:
# Ignore private fields
if field.name.startswith('_'):
continue
# Note: StrawberryField types do not have is_relation
fields_string += f'{field.name} {{ id }}\n'
elif inspect.isclass(field.type) and issubclass(field.type, IPAddressFamilyType):