Skip to content
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] service_list filter always requires port #17457

Closed
4xoc opened this issue Sep 11, 2024 · 2 comments · Fixed by #17462
Closed

[GraphQL] service_list filter always requires port #17457

4xoc opened this issue Sep 11, 2024 · 2 comments · Fixed by #17462
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@4xoc
Copy link

4xoc commented Sep 11, 2024

Deployment Type

Self-hosted

NetBox Version

v4.1.0

Python Version

3.10

Steps to Reproduce

  1. have a service
  2. try to query said service by name using GraphQL
{
  service_list(filters: {name: {starts_with: "SSH"}}) {
    id
  }
}

I'm using the latest docker-compose version of Netbox, nothing inside the containers has been changed.

Expected Behavior

A list of matching services should be the result and no error being reported back.

Observed Behavior

GraphQL reports that port is a required field that prevents searching for services by name only.

{
  "data": null,
  "errors": [
    {
      "message": "Field 'ServiceFilter.port' of required type 'Int!' was not provided.",
      "locations": [
        {
          "line": 2,
          "column": 25
        }
      ]
    }
  ]
}

Using 0 as port value causes a different error (not really related but maybe good to know):

{
  "data": null,
  "errors": [
    {
      "message": "cannot cast type integer to integer[]\nLINE 1: ... \"ipam_service\" WHERE (\"ipam_service\".\"ports\" @> 0::integer[...\n                                                             ^",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "service_list"
      ]
    }
  ]
}
@4xoc 4xoc added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Sep 11, 2024
@arthanson arthanson added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation and removed status: needs triage This issue is awaiting triage by a maintainer status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Sep 11, 2024
@arthanson
Copy link
Collaborator

Looks like any Filter of type NumericArrayFilter is being marked as required.

@4xoc
Copy link
Author

4xoc commented Sep 12, 2024

I've got to say, thanks a lot for such a speedy response and resolution of this issue!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants