GraphQL: Extend relationships further #6536

Closed
opened 2025-12-29 19:42:05 +01:00 by adam · 2 comments
Owner

Originally created by @ryanmerolle on GitHub (Jun 3, 2022).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.2.4

Feature type

Change to existing functionality

Proposed functionality

I am not really going to articulate this well, but I have noticed many GraphQL models do not go very deep into the relationships of other models.

Use case

Examples:

{
  circuit_list {
    id
    cid
    type {
      name
    }
    termination_a {
      _link_peer_type {
        id
      }
    termination_b {
      _link_peer_type {
        id
      }
      _link_peer_id
    }
  }
}

termination_a & termination_b do not (at bare minimum) allow you to grab the display or device keys like you can with the REST API. In reality, you should be able to further follow the path of the relationship to include information about the models related.

Possible Use Cases:
Gather circuit, termination, cable, ip address, and connected peer device/interface/ip details
Filtering circuits based on the status of the site it's attached to @tyler-8 example from chat
Filtering circuits based on the VLAN membership of the interface it's connected to @tyler-8 example from chat.

There are a whole host of items like this where the relationship cannot be followed to the end within graphql. To quote @tyler-8 "Yeah graphql would really shine if we unlocked more of that" .."I'm just not sure how that works in graphene, like if it's "easy" to do that or if you basically have to explicitly define all of those things every time"

Database changes

No response

External dependencies

No response

Originally created by @ryanmerolle on GitHub (Jun 3, 2022). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.2.4 ### Feature type Change to existing functionality ### Proposed functionality I am not really going to articulate this well, but I have noticed many GraphQL models do not go very deep into the relationships of other models. ### Use case Examples: ``` { circuit_list { id cid type { name } termination_a { _link_peer_type { id } termination_b { _link_peer_type { id } _link_peer_id } } } ``` termination_a & termination_b do not (at bare minimum) allow you to grab the display or device keys like you can with the REST API. In reality, you should be able to further follow the path of the relationship to include information about the models related. **Possible Use Cases:** Gather circuit, termination, cable, ip address, and connected peer device/interface/ip details Filtering circuits based on the status of the site it's attached to @tyler-8 example from chat Filtering circuits based on the VLAN membership of the interface it's connected to @tyler-8 example from chat. There are a whole host of items like this where the relationship cannot be followed to the end within graphql. To quote @tyler-8 "Yeah graphql would really shine if we unlocked more of that" .."I'm just not sure how that works in graphene, like if it's "easy" to do that or if you basically have to explicitly define all of those things every time" ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 19:42:05 +01:00
adam closed this issue 2025-12-29 19:42:05 +01:00
Author
Owner

@basti1508 commented on GitHub (Jun 20, 2022):

Since I am creating Switch-Configs from the Information stored in Netbox, the possibility to have the connected_endpoint on an interface would be a real gamechanger.

@basti1508 commented on GitHub (Jun 20, 2022): Since I am creating Switch-Configs from the Information stored in Netbox, the possibility to have the connected_endpoint on an interface would be a real gamechanger.
Author
Owner

@jeremystretch commented on GitHub (Jul 27, 2022):

Blocked by #9856

@jeremystretch commented on GitHub (Jul 27, 2022): Blocked by #9856
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6536