Wrong enum for role in Graphql IPRangeFilter #11119

Closed
opened 2025-12-29 21:40:32 +01:00 by adam · 0 comments
Owner

Originally created by @freym on GitHub (May 5, 2025).

Originally assigned to: @jeremystretch on GitHub.

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

6e49cee718/netbox/ipam/graphql/filters.py (L171)

Originally created by @freym on GitHub (May 5, 2025). Originally assigned to: @jeremystretch on GitHub. ### 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 https://github.com/netbox-community/netbox/blob/6e49cee7181784bf25973a35425408f1759fb67c/netbox/ipam/graphql/filters.py#L171
adam added the type: bugstatus: acceptedtopic: GraphQLseverity: low labels 2025-12-29 21:40:32 +01:00
adam closed this issue 2025-12-29 21:40:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11119