Skip to content

[GraphQL] service_list filter always requires port #17457

Closed
@4xoc

Description

@4xoc

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"
      ]
    }
  ]
}

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: 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