Skip to content

GraphQL returns all objects if tag doesn't exist #11473

@4xoc

Description

@4xoc

NetBox version

v3.4.2

Python version

3.10

Steps to Reproduce

  1. query GraphQL for device/interface with a tag that doesn't exist

Expected Behavior

Resulting list of devices/interfaces only contains devices matching the tags or none if no device exists with matching tags.

Observed Behavior

All devices/interfaces are returned no matter what tag filter has been applied. Same seems to apply for all kinds of filters that can be defined in GraphQL. No errors are returned.

Example below

query:
{ device_list(tag: "blablalba") { id name tags { name } } interface_list(tag: "not-ipmi_exporter") { id device { id } tags { name } } }

result:
{ "data": { "device_list": [ { "id": "1", "name": "device-A", "tags": [ { "name": "node_exporter" } ] }, { "id": "2", "name": "device-B", "tags": [ { "name": "node_exporter" } ] } ], "interface_list": [ { "id": "1", "device": { "id": "1" }, "tags": [ { "name": "ipmi_exporter" } ] }, { "id": "2", "device": { "id": "2" }, "tags": [ { "name": "ipmi_exporter" } ] } ] } }

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions