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
- Define an
IpamIPAddress schema with human_friendly_id: [address__value]
- Define a
RoutingBGPSession with relationships local_ip / remote_ip targeting IpamIPAddress
- Create a BGP session object file referencing an IP address by HFID
- Observe the GraphQL error about
hfid not being defined on RelatedIPAddressNodeInput
Description
When using an object file to create a
RoutingBGPSessionwith a relationship toIpamIPAddress, referencing the IP address by its HFID fails with:Root Cause
In
backend/infrahub/graphql/types/attribute.py,RelatedIPAddressNodeInputdoes not include thehfidfield, while bothRelatedNodeInputandRelatedIPPrefixNodeInputdo.When a relationship targets a node inheriting from
BuiltinIPAddress, the GraphQL manager (backend/infrahub/graphql/manager.py:_get_related_input_type) selectsRelatedIPAddressNodeInputinstead of the standardRelatedNodeInput. Since user-defined schemas likeIpamIPAddresscan definehuman_friendly_id, HFID resolution should be supported but the input type doesn't expose the field.Expected Behavior
RelatedIPAddressNodeInputshould includehfid = Field(List(of_type=String), required=False)so that IP address relationships can be referenced by HFID, consistent withRelatedIPPrefixNodeInputandRelatedNodeInput.Steps to Reproduce
IpamIPAddressschema withhuman_friendly_id: [address__value]RoutingBGPSessionwith relationshipslocal_ip/remote_iptargetingIpamIPAddresshfidnot being defined onRelatedIPAddressNodeInput