Skip to content

GraphQL: Querying of cable within a cabletermination_set of an device can only return the ID but no the corresponding cable #18124

Closed
@dxks

Description

@dxks

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.7

Python Version

3.11

Steps to Reproduce

Create a simple GraphQL query to get all cable-terminations of an device and retrieve the cable information:

{
  device(id: 249) {
    cabletermination_set {
      cable {
        display
      }
    }
  }
}

You will retrieve the following error:

{
  "data": null,
  "errors": [
    {
      "message": "Cannot query field 'display' on type 'DjangoModelType'.",
      "locations": [
        {
          "line": 2,
          "column": 61
        }
      ]
    }
  ]
}

Expected Behavior

Retrieve the cable details on the cable-termination:

{
  "data": {
    "device": {
      "cabletermination_set": [
        {
          "cable": {
            "display": "#2452"
          }
        }
      ]
    }
  }
}

Observed Behavior

The cable of cabletermination_set is referencing ModelDjangoType instead of CableType. Querying the cable will only possible when querying the terminations and cable there.

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

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions