fix: Add direct device relationship to BGPAddressFamily for query filtering (#23)
InfraHub does not support multi-hop relationship traversal in GraphQL filters, so `bgp_config__device__name__value` fails at query time. Fix follows the same pattern used for InfraMlagPeerConfig (#22): add a denormalized direct device relationship to the schema node and use it in the query filter. Changes: - infrahub/schemas/bgp.yml: add `device` relationship (kind: Attribute, cardinality: one, optional: false) to BGPAddressFamily as the first relationship, before bgp_config - infrahub/objects/11-bgp-sessions.yml: add `device: ["<device>"]` to all 22 InfraBGPAddressFamily entries (spine1×2, spine2×2, leaf1–8×2 each, plus leaf7 and leaf8 VRF gold AF) - infrahub/transforms/queries/bgp_intent.gql: change filter from `bgp_config__device__name__value` to `device__name__value` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,7 +68,7 @@ query BgpIntent($device_name: String!) {
|
||||
}
|
||||
}
|
||||
}
|
||||
InfraBGPAddressFamily(bgp_config__device__name__value: $device_name) {
|
||||
InfraBGPAddressFamily(device__name__value: $device_name) {
|
||||
edges {
|
||||
node {
|
||||
afi { value }
|
||||
|
||||
Reference in New Issue
Block a user