Skip to content

Commit de72ac9

Browse files
committed
Ignore private fields when constructing test GraphQL requests
1 parent 945b8b6 commit de72ac9

File tree

1 file changed

+3
-0
lines changed
  • netbox/utilities/testing

1 file changed

+3
-0
lines changed

netbox/utilities/testing/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ def _build_query_with_filter(self, name, filter_string):
470470
elif type(field.type) is StrawberryOptional and type(field.type.of_type) is LazyType:
471471
fields_string += f'{field.name} {{ id }}\n'
472472
elif hasattr(field, 'is_relation') and field.is_relation:
473+
# Ignore private fields
474+
if field.name.startswith('_'):
475+
continue
473476
# Note: StrawberryField types do not have is_relation
474477
fields_string += f'{field.name} {{ id }}\n'
475478
elif inspect.isclass(field.type) and issubclass(field.type, IPAddressFamilyType):

0 commit comments

Comments
 (0)