Skip to content

GraphQL fails to show ProviderNetworks in Interface connected_endpoints #14511

@bogi788

Description

@bogi788

Deployment Type

Self-hosted

NetBox Version

v3.6.6

Python Version

3.11

Steps to Reproduce

When performing GraphQL queries on interfaces the connected_endpoints property fails to "expand" when connected to ProviderNetwork objects (via circuits).

Editing dcim/graphql/gfk_mixins.py and adding ProviderNetwork/ProviderNetworkType to LinkPeerType allows the query to succeed.

Expected Behavior

The GraphQL API should include all supported connected_endpoints types or the cable trace (for GraphQL) stop at the CircuitTermination that is already listed in the schema for LinkPeerType.

Observed Behavior

The query

query{
  interface_list(...) {
    id
    connected_endpoints{
      ... on CircuitTerminationType{
        id
      }
    }
  }
}

results in the following error message via the GraphQL API:

Abstract type 'LinkPeerType' must resolve to an Object type at runtime for field 'InterfaceType.connected_endpoints'. Either the 'LinkPeerType' type should provide a 'resolve_type' function or each possible type should provide an 'is_type_of' function.

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