From 1745d2ae93613861053512360402e6164fad3476 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Mon, 26 Jan 2026 15:39:56 +0100 Subject: [PATCH] feat(dcim): Add filter for cabled objects in GraphQL Introduces a `cabled` filter to the GraphQL API for DCIM. Allows filtering objects based on whether they are connected to a cable, improving query customization. Fixes #20172 --- netbox/dcim/graphql/filters.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netbox/dcim/graphql/filters.py b/netbox/dcim/graphql/filters.py index 9e5915146..8a81f3110 100644 --- a/netbox/dcim/graphql/filters.py +++ b/netbox/dcim/graphql/filters.py @@ -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: