Skip to content

RelatedIPAddressNodeInput missing hfid field #8574

@BeArchiTek

Description

@BeArchiTek

Description

When using an object file to create a RoutingBGPSession with a relationship to IpamIPAddress, referencing the IP address by its HFID fails with:

Field 'hfid' is not defined by type 'RelatedIPAddressNodeInput'. Did you mean 'id'?

Root Cause

In backend/infrahub/graphql/types/attribute.py, RelatedIPAddressNodeInput does not include the hfid field, while both RelatedNodeInput and RelatedIPPrefixNodeInput do.

When a relationship targets a node inheriting from BuiltinIPAddress, the GraphQL manager (backend/infrahub/graphql/manager.py:_get_related_input_type) selects RelatedIPAddressNodeInput instead of the standard RelatedNodeInput. Since user-defined schemas like IpamIPAddress can define human_friendly_id, HFID resolution should be supported but the input type doesn't expose the field.

Expected Behavior

RelatedIPAddressNodeInput should include hfid = Field(List(of_type=String), required=False) so that IP address relationships can be referenced by HFID, consistent with RelatedIPPrefixNodeInput and RelatedNodeInput.

Steps to Reproduce

  1. Define an IpamIPAddress schema with human_friendly_id: [address__value]
  2. Define a RoutingBGPSession with relationships local_ip / remote_ip targeting IpamIPAddress
  3. Create a BGP session object file referencing an IP address by HFID
  4. Observe the GraphQL error about hfid not being defined on RelatedIPAddressNodeInput

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions