netbox icon indicating copy to clipboard operation
netbox copied to clipboard

GraphQL interface filter 'kind' no longer works since 4.3

Open llamafilm opened this issue 6 months ago • 3 comments

Deployment Type

Self-hosted

NetBox Version

v4.3.2

Python Version

3.12

Steps to Reproduce

Run this GraphQL query

{
  interface_list(filters: {kind: "physical"}) {
    id
  }
}

Expected Behavior

This worked in 4.2.4 and older versions

Observed Behavior

In 4.3.2 it fails

  "message": "Field 'kind' is not defined by type 'InterfaceFilter'. Did you mean 'AND' or 'id'?",

llamafilm avatar Jun 20 '25 01:06 llamafilm

As a clunky workaround, I tried listing all the interface types with an OR statement. But I can't figure out how to combine more than 2 conditions this way. This query works with just 2 conditions:

{
  interface_list(filters: {
    type: TYPE_100BASE_TX
    OR: {type: TYPE_1000BASE_TX}
  }) {
    id
    name
    type
  }
}

llamafilm avatar Jun 20 '25 01:06 llamafilm

looks like there are a couple filters on interface that are missing, including virtual_chassis and kind.

arthanson avatar Jun 20 '25 14:06 arthanson

Seemingly "connected", too. Maybe "cabled" as well, I believe that was a filter in the past, not sure if that one is still in use

unvented-carat-dimmed avatar Jun 25 '25 21:06 unvented-carat-dimmed

I volunteer to fix this, can you assign to me please?

I'll add connected in the same PR if that's ok.

llamafilm avatar Sep 06 '25 08:09 llamafilm

I've never used virtual chassis at all so I didn't feel comfortable including that in this PR.

llamafilm avatar Sep 06 '25 18:09 llamafilm

I'll file a follow up for the virtual_chassis filter. #20172 is already filed for the cabled filter.

jnovinger avatar Sep 08 '25 14:09 jnovinger