v3.0-beta1 GraphQL Nested value query #5097

Closed
opened 2025-12-29 19:24:12 +01:00 by adam · 1 comment
Owner

Originally created by @arjenvri on GitHub (Jul 25, 2021).

NetBox version

v3.0-beta1

Python version

3.7

Steps to Reproduce

  1. Open GraphiQL
  2. Paste the below query
 query myprefxes {
  prefix_list(vrf: {name: "customer1"}) {
    prefix
    vrf {
      id
      name
    }
  }
}
  1. Tried the below alternative
 query myprefixes {
  prefix_list(vrf__n: "customer1") {
    prefix
    vrf {
      id
      name
    }
  }
}

Expected Behavior

I would like to return prefixes that have a vrf name "customer1" defined by using GraphQL.

Observed Behavior

{
"errors": [
{
"message": "Argument "vrf" has invalid value {name: "customer1"}.\nExpected type "String", found {name: "customer1"}.",
"locations": [
{
"line": 2,
"column": 20
}
]
}
]
}

Originally created by @arjenvri on GitHub (Jul 25, 2021). ### NetBox version v3.0-beta1 ### Python version 3.7 ### Steps to Reproduce 1. Open GraphiQL 2. Paste the below query ``` query myprefxes { prefix_list(vrf: {name: "customer1"}) { prefix vrf { id name } } } ``` 3. Tried the below alternative ``` query myprefixes { prefix_list(vrf__n: "customer1") { prefix vrf { id name } } } ``` ### Expected Behavior I would like to return prefixes that have a vrf name "customer1" defined by using GraphQL. ### Observed Behavior { "errors": [ { "message": "Argument \"vrf\" has invalid value {name: \"customer1\"}.\nExpected type \"String\", found {name: \"customer1\"}.", "locations": [ { "line": 2, "column": 20 } ] } ] }
adam added the beta label 2025-12-29 19:24:12 +01:00
adam closed this issue 2025-12-29 19:24:12 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 26, 2021):

The GraphQL filters are the same filters used for the UI and REST API. NetBox doesn't currently support filtering prefixes by parent VRF name; only by the VRF ID (?vrf_id=) or route distinguisher (?vrf=). (This is true for v2.11 and earlier releases as well.) Supporting filter by parent VRF name would need to be a feature request submitted for the current release. You're certainly welcome to open one, though we'd need to discuss the specific proposed implementation to avoid interfering with the existing behavior.

I'm going to close this issue as it's not specifically related to GraphQL.

@jeremystretch commented on GitHub (Jul 26, 2021): The GraphQL filters are the same filters used for the UI and REST API. NetBox doesn't currently support filtering prefixes by parent VRF name; only by the VRF ID (`?vrf_id=`) or route distinguisher (`?vrf=`). (This is true for v2.11 and earlier releases as well.) Supporting filter by parent VRF name would need to be a feature request submitted for the current release. You're certainly welcome to open one, though we'd need to discuss the specific proposed implementation to avoid interfering with the existing behavior. I'm going to close this issue as it's not specifically related to GraphQL.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5097