GraphQL filter for "ip_address_list" - Filter query tag works not as accepted #9748

Closed
opened 2025-12-29 21:22:02 +01:00 by adam · 5 comments
Owner

Originally created by @SchmidtJonathan1 on GitHub (May 27, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0.3

Python Version

3.12

Steps to Reproduce

When a query is created in Graphql Explorer that accesses the class "ip_address_list". Cannot be filtered by "tags" as there is only one parameter called "tag".

#Graphql query:

query MyQuery {
  ip_address_list(filters: {tag: "Gateway"}) {
    tags{
      name
    }
  }
}

Expected Behavior

{
  "data": {
    "ip_address_list": [
      {
        "id": "15",
        "tags": [
          {
            "name": "Gateway"
          }
        ]
      }
}

Observed Behavior

{
  "data": {
    "ip_address_list": [
      {
        "id": "2",
        "tags": []
      },
      {
        "id": "3",
        "tags": []
      },
      {
        "id": "4",
        "tags": []
      },
      {
        "id": "15",
        "tags": [
          {
            "name": "Gateway"
          }
        ]
      }
}
Originally created by @SchmidtJonathan1 on GitHub (May 27, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0.3 ### Python Version 3.12 ### Steps to Reproduce When a query is created in Graphql Explorer that accesses the class "ip_address_list". Cannot be filtered by "tags" as there is only one parameter called "tag". ``` #Graphql query: query MyQuery { ip_address_list(filters: {tag: "Gateway"}) { tags{ name } } } ``` ### Expected Behavior ``` { "data": { "ip_address_list": [ { "id": "15", "tags": [ { "name": "Gateway" } ] } } ``` ### Observed Behavior ``` { "data": { "ip_address_list": [ { "id": "2", "tags": [] }, { "id": "3", "tags": [] }, { "id": "4", "tags": [] }, { "id": "15", "tags": [ { "name": "Gateway" } ] } } ```
adam added the type: bugstatus: acceptednetboxtopic: GraphQLseverity: low labels 2025-12-29 21:22:02 +01:00
adam closed this issue 2025-12-29 21:22:03 +01:00
Author
Owner

@fooker commented on GitHub (Jul 1, 2024):

Hi, I would like to tackle this issue (CC @jeffgdotorg)

@fooker commented on GitHub (Jul 1, 2024): Hi, I would like to tackle this issue (CC @jeffgdotorg)
Author
Owner

@arthanson commented on GitHub (Aug 13, 2024):

@fooker any updates on this? Are you still able to work on this?

@arthanson commented on GitHub (Aug 13, 2024): @fooker any updates on this? Are you still able to work on this?
Author
Owner

@jeremypng commented on GitHub (Jan 23, 2025):

Fixed in my branch here:
https://github.com/jeremypng/netbox/tree/refs/heads/graphql-filter-redesign

fixed query:

query IPTags {
  ip_address_list(filters: {tags: {name: {exact: "Bravo"}}}) {
    id
    address
  }
}

results:

{
  "data": {
    "ip_address_list": [
      {
        "id": "34",
        "address": "172.16.0.4/24"
      }
    ]
  }
}

If you'll assign this to me I'll tag it in my PR

@jeremypng commented on GitHub (Jan 23, 2025): Fixed in my branch here: https://github.com/jeremypng/netbox/tree/refs/heads/graphql-filter-redesign fixed query: ```graphql query IPTags { ip_address_list(filters: {tags: {name: {exact: "Bravo"}}}) { id address } } ``` results: ```json { "data": { "ip_address_list": [ { "id": "34", "address": "172.16.0.4/24" } ] } } ``` If you'll assign this to me I'll tag it in my PR
Author
Owner

@jeremystretch commented on GitHub (Feb 7, 2025):

Blocked by #7598

@jeremystretch commented on GitHub (Feb 7, 2025): Blocked by #7598
Author
Owner

@jeremystretch commented on GitHub (Mar 10, 2025):

I believe this has been resolved by the work on #7598. For example, the following query will match all sites with to which the tag named "Alpha" has been assigned:

query {
  site_list(filters: {tags: {name: {exact: "Alpha"}}}) {
    id
    name
  }
}

This change will be implemented in NetBox v4.3.

@jeremystretch commented on GitHub (Mar 10, 2025): I believe this has been resolved by the work on #7598. For example, the following query will match all sites with to which the tag named "Alpha" has been assigned: ```graphql query { site_list(filters: {tags: {name: {exact: "Alpha"}}}) { id name } } ``` This change will be implemented in NetBox v4.3.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9748