Skip to content

Wrong enum for role in Graphql IPRangeFilter #19397

@freym

Description

@freym

Deployment Type

Self-hosted

NetBox Version

v4.3.0

Python Version

3.12

Steps to Reproduce

  1. Create a IP Range with a custom Role like "DHCP"
  2. Run this Query:
ip_range_list (filters: {role: "DHCP"}) {
    start_address
}

Expected Behavior

Only the IP Range with the role "DHCP" should be shown.

Observed Behavior

You get the following Error Message:

{
  "data": null,
  "errors": [
    {
      "message": "Enum 'IPAddressRoleEnum' cannot represent non-enum value: \"DHCP\".",
      "locations": [
        {
          "line": 2,
          "column": 34
        }
      ]
    }
  ]
}

For a IP Range it is possible to create user-defined functional roles, but the GraphQL Filter is using the static IPAddressRoleEnum

role: Annotated['IPAddressRoleEnum', strawberry.lazy('ipam.graphql.enums')] | None = (

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtopic: GraphQLtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions