Graphql OR for 'tag' returns no results #10810

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

Originally created by @PieterL75 on GitHub (Feb 26, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.1.11

Python Version

3.12

Steps to Reproduce

  1. Create a few tags, devices and link them
  2. Create a graphql filter that filters devices with "tag1 or tag2"
query MyQuery {
  device_list(filters: {tag: "tag1", OR: {tag: "tag2"}}) {
    name
    tags {
      name
    }
  }
}

Expected Behavior

The graphQL returns all devices that have tag1 OR tag2 (or multilple)

{
  "data": {
    "device_list": [
      {
        "name": "device1",
        "tags": [
          {
            "name": "tag1"
          }
        ]
      },
      {
        "name": "device2",
        "tags": [
          {
            "name": "tag2"
          }
        ]
      },
      {
        "name": "device3",
        "tags": [
          {
            "name": "tag1"
          },
          {
            "name": "tag2"
          }
        ]
      }
    ]
  }
}

Observed Behavior

The results are the devices that have tag1 AND tag2

{
  "data": {
    "device_list": [
      {
        "name": "device3",
        "tags": [
          {
            "name": "tag1"
          },
          {
            "name": "tag2"
          }
        ]
      }
    ]
  }
}
Originally created by @PieterL75 on GitHub (Feb 26, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.1.11 ### Python Version 3.12 ### Steps to Reproduce 1. Create a few tags, devices and link them 2. Create a graphql filter that filters devices with "tag1 or tag2" ``` query MyQuery { device_list(filters: {tag: "tag1", OR: {tag: "tag2"}}) { name tags { name } } } ``` ### Expected Behavior The graphQL returns all devices that have tag1 OR tag2 (or multilple) ``` { "data": { "device_list": [ { "name": "device1", "tags": [ { "name": "tag1" } ] }, { "name": "device2", "tags": [ { "name": "tag2" } ] }, { "name": "device3", "tags": [ { "name": "tag1" }, { "name": "tag2" } ] } ] } } ``` ### Observed Behavior The results are the devices that have tag1 AND tag2 ``` { "data": { "device_list": [ { "name": "device3", "tags": [ { "name": "tag1" }, { "name": "tag2" } ] } ] } } ```
adam added the type: bug label 2025-12-29 21:36:11 +01:00
adam closed this issue 2025-12-29 21:36:11 +01:00
Author
Owner

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

@PieterL75 could you add this as a comment on bug #18632 please? I believe it's another symptom of the same underlying limitation (which is being addressed under #7598 in NetBox v4.3).

@jeremystretch commented on GitHub (Feb 26, 2025): @PieterL75 could you add this as a comment on bug #18632 please? I believe it's another symptom of the same underlying limitation (which is being addressed under #7598 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#10810