Filter VRF on GraphQL ip_address does not filter #9853

Closed
opened 2025-12-29 21:23:34 +01:00 by adam · 1 comment
Owner

Originally created by @antoinekh on GitHub (Jun 17, 2024).

Deployment Type

Self-hosted

NetBox Version

4.0.5

Python Version

3.10

Steps to Reproduce

  1. Create IP addresses on multiple VRF
  2. Make a graphQL request to get IP addresse on a dedicated VRF

Easy to test https://demo.netbox.dev/graphql/ as there is already IP not on dedicated VRF.

Expected Behavior

Filter the request with the VRF name and only display

Observed Behavior

GraphQL request

query GetIP {
  ip_address_list (filters: {vrf : "ABC"}){
    id
    display
    vrf {
      id
      name
    }
  }
}

I also tried with

query GetIP {
  ip_address_list (filters: {vrf :{name:{contains: "ABC"}}}){
    id
    display
    vrf {
      id
      name
    }
  }
}

But this seems not supported:

{
  "data": null,
  "errors": [
    {
      "message": "String cannot represent a non string value: {name: {contains: \"ABC\"}}",
      "locations": [
        {
          "line": 2,
          "column": 35
        }
      ]
    }
  ]
}
Originally created by @antoinekh on GitHub (Jun 17, 2024). ### Deployment Type Self-hosted ### NetBox Version 4.0.5 ### Python Version 3.10 ### Steps to Reproduce 1. Create IP addresses on multiple VRF 2. Make a graphQL request to get IP addresse on a dedicated VRF Easy to test https://demo.netbox.dev/graphql/ as there is already IP not on dedicated VRF. ### Expected Behavior Filter the request with the VRF name and only display ### Observed Behavior GraphQL request ``` query GetIP { ip_address_list (filters: {vrf : "ABC"}){ id display vrf { id name } } } ``` I also tried with ``` query GetIP { ip_address_list (filters: {vrf :{name:{contains: "ABC"}}}){ id display vrf { id name } } } ``` But this seems not supported: ``` { "data": null, "errors": [ { "message": "String cannot represent a non string value: {name: {contains: \"ABC\"}}", "locations": [ { "line": 2, "column": 35 } ] } ] } ```
adam closed this issue 2025-12-29 21:23:35 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 17, 2024):

The vrf filter references the VRF's route distinguisher value, not its name.

@jeremystretch commented on GitHub (Jun 17, 2024): The `vrf` filter references the VRF's [route distinguisher](https://netboxlabs.com/docs/netbox/en/stable/models/ipam/vrf/#route-distinguisher) value, not its name.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9853