Skip to content

Wrong enum for role in Graphql IPRangeFilter #19397

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

Closed
freym opened this issue May 5, 2025 · 0 comments · Fixed by #19400
Closed

Wrong enum for role in Graphql IPRangeFilter #19397

freym opened this issue May 5, 2025 · 0 comments · Fixed by #19400
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
Milestone

Comments

@freym
Copy link

freym commented May 5, 2025

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 = (

@freym freym added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels May 5, 2025
@jeremystretch jeremystretch self-assigned this May 5, 2025
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: low Does not significantly disrupt application functionality, or a workaround is available and removed status: needs triage This issue is awaiting triage by a maintainer labels May 5, 2025
@jeremystretch jeremystretch added this to the v4.3.1 milestone May 5, 2025
bctiemann added a commit that referenced this issue May 12, 2025
…Filter-role

Fixes #19397: Fix filtering IP ranges by role in GraphQL API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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