GraphQL: Required fields that probably shouldn't be #9648

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

Originally created by @joskin-nimar on GitHub (May 10, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.1

Python Version

3.11

Steps to Reproduce

  1. Go to GraphQL console
  2. Enter this query
query {
  ip_address_list(filters: {tenant: "my-tenant"}){
    address
  }
}
  1. You'll have an error that some required fields are missing

Expected Behavior

The family, mask_length__gte and mask_length__lte filters shouldn't be mandatory.

Probably the same for other filters.
Also broken on https://demo.netbox.dev/

Observed Behavior

{
  "data": null,
  "errors": [
    {
      "message": "Field 'IPAddressFilter.family' of required type 'Int!' was not provided.",
      "locations": [
        {
          "line": 2,
          "column": 28
        }
      ]
    },
    {
      "message": "Field 'IPAddressFilter.mask_length__gte' of required type 'Int!' was not provided.",
      "locations": [
        {
          "line": 2,
          "column": 28
        }
      ]
    },
    {
      "message": "Field 'IPAddressFilter.mask_length__lte' of required type 'Int!' was not provided.",
      "locations": [
        {
          "line": 2,
          "column": 28
        }
      ]
    }
  ]
}
Originally created by @joskin-nimar on GitHub (May 10, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.1 ### Python Version 3.11 ### Steps to Reproduce 1. Go to GraphQL console 2. Enter this query ```graphql query { ip_address_list(filters: {tenant: "my-tenant"}){ address } } ``` 3. You'll have an error that some required fields are missing ### Expected Behavior The `family`, `mask_length__gte` and `mask_length__lte` filters shouldn't be mandatory. Probably the same for other filters. Also broken on https://demo.netbox.dev/ ### Observed Behavior ```json { "data": null, "errors": [ { "message": "Field 'IPAddressFilter.family' of required type 'Int!' was not provided.", "locations": [ { "line": 2, "column": 28 } ] }, { "message": "Field 'IPAddressFilter.mask_length__gte' of required type 'Int!' was not provided.", "locations": [ { "line": 2, "column": 28 } ] }, { "message": "Field 'IPAddressFilter.mask_length__lte' of required type 'Int!' was not provided.", "locations": [ { "line": 2, "column": 28 } ] } ] } ```
adam added the type: bugtopic: GraphQLseverity: lowseverity: medium labels 2025-12-29 21:20:15 +01:00
adam closed this issue 2025-12-29 21:20:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9648