-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL returns all objects if tag doesn't exist #11473
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Comments
4xoc
added
the
type: bug
A confirmed report of unexpected behavior in the application
label
Jan 12, 2023
jeremystretch
added
the
status: needs owner
This issue is tentatively accepted pending a volunteer committed to its implementation
label
Jan 12, 2023
I think this could be solved by checking if the filterset is valid in ObjectListField.list_resolver() static method and returning an empty queryset if not valid. I can take a look at this. |
aronbergurj99
pushed a commit
to aronbergurj99/netbox
that referenced
this issue
Feb 14, 2023
…evices/interfaces
@jeremystretch can you assign this to me? |
kkthxbye-code
added
status: accepted
This issue has been accepted for implementation
and removed
status: needs owner
This issue is tentatively accepted pending a volunteer committed to its implementation
labels
Feb 15, 2023
@aronbj20 - I've assigned it to you. |
Thanks for fixing this |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
NetBox version
v3.4.2
Python version
3.10
Steps to Reproduce
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" } ] } ] } }
The text was updated successfully, but these errors were encountered: