GraphQL filter for "ip_address_list" - Filter query tag works not as accepted
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"
}
]
}
}
Hi, I would like to tackle this issue (CC @jeffgdotorg)
@fooker any updates on this? Are you still able to work on this?
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
Blocked by #7598
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.