Skip to content

GraphQL: Querying for Manufacturer on Inventory-Items leads to nun-null error #18999

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
dxks opened this issue Mar 25, 2025 · 0 comments · Fixed by #19016
Closed

GraphQL: Querying for Manufacturer on Inventory-Items leads to nun-null error #18999

dxks opened this issue Mar 25, 2025 · 0 comments · Fixed by #19016
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

@dxks
Copy link
Contributor

dxks commented Mar 25, 2025

Deployment Type

Self-hosted

NetBox Version

v4.2.5

Python Version

3.10

Steps to Reproduce

Reproducable on demo.netbox.dev. Also on v4.2.6 in our environment

  1. Create a Inventory-Item on any device and leave the manufacturer blank (as it is not required
  2. Query the following graph-ql (with the specific device-id):
query {
  device(id:172) {id name inventoryitems {id name manufacturer{id name}}}
}

Expected Behavior

Output of Device with given Inventory-Items and manufacturer to be null (i.e. like if tenant is not set):

{
  "data": {
    "device": {
      "id": "172",
      "name": "0634LEO",
      "inventoryitems": [
        {
          "id": "1",
          "name": "Test",
          "manufacturer": null
        }
      ]
    }
  }
}

Observed Behavior

Error raised that manufacturer cannot be null:

{
  "data": null,
  "errors": [
    {
      "message": "Cannot return null for non-nullable field InventoryItemType.manufacturer.",
      "locations": [
        {
          "line": 2,
          "column": 68
        }
      ],
      "path": [
        "device",
        "inventoryitems",
        0,
        "manufacturer"
      ]
    }
  ]
}
@dxks dxks added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Mar 25, 2025
@arthanson arthanson added status: needs owner This issue is tentatively accepted pending a volunteer committed to its 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 Mar 25, 2025
@jnovinger jnovinger self-assigned this Mar 26, 2025
@jnovinger jnovinger added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Mar 26, 2025
@jeremystretch jeremystretch added this to the v4.2.7 milestone Mar 28, 2025
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.

4 participants