Merge pull request #21299 from netbox-community/20172-ability-to-query-for-cabled-interfaces-via-graphql

Closes #20172: Add `cabled` filter for DCIM interfaces in GraphQL
This commit is contained in:
bctiemann 2026-01-27 10:13:27 -05:00 committed by GitHub
commit 7e3b60f194
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -550,6 +550,10 @@ class InterfaceFilter(
strawberry_django.filter_field()
)
@strawberry_django.filter_field
def cabled(self, value: bool, prefix: str):
return Q(**{f'{prefix}cable__isnull': (not value)})
@strawberry_django.filter_field
def connected(self, queryset, value: bool, prefix: str):
if value is True: