Skip to content

GraphQL Error when querying connected_endpoints on interface_list without cabled: true filter #18895

@Kani999

Description

@Kani999

Deployment Type

Self-hosted

NetBox Version

v4.2.5

Python Version

3.12

Steps to Reproduce

  1. Send the following GraphQL query:
query MyQuery {
  interface_list(
    filters: {device: "DeviceWithVirtualCircuitConnection"}
  ) {
    name
    device {
      name
      longitude
      latitude
      role {
        name
      }
    }
    connected_endpoints {
      ... on CircuitTerminationType {
        id
      }
    }
  }
}

Expected Behavior

Workaround

Including the cabled: true filter in the query resolves the error. However, this limits the query to only cabled interfaces.

Additional Information

This issue seems to be related to how the connected_endpoints field is resolved when the cabled filter is not explicitly set to true. It might be that the resolver expects a cabled connection and fails when it encounters a non-cabled interface. (It happens when VirtualCircuitTerminations are made)

Observed Behavior

Error:

{
  "data": null,
  "errors": [
    {
      "message": "The type \"<class 'circuits.models.virtual_circuits.VirtualCircuitTermination'>\" cannot be resolved for the field \"connected_endpoints\" , are you using a strawberry.field?",
      "locations": [
        {
          "line": 14,
          "column": 5
        }
      ],
      "path": [
        "interface_list",
        132,
        "connected_endpoints",
        0
      ]
    }
  ]
}

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

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions