bug: Jinja computed attribute failure if related node is not found #5768
Labels
group/backend
Issue related to the backend (API Server, Git Agent)
type/bug
Something isn't working as expected
Component
API Server / GraphQL
Infrahub version
1.1.6
Current Behavior
When a computed_attribute (in jinja2) is using an
optional
related node, and this is one is not set, the API reply with a cryptic "Unable to find the peer"The schema used for this :
Expected Behavior
The API should provide a better error for the non-creation of the node.
Steps to Reproduce
1- load the schema above in infrahub as well as this one :
3 - try creating a RoutingBGPPeerGroup without any remote_as
Additional Information
A better
if/else
test seems to beBut I find strange we can't directly use the relationship name like :
if remote_as
The text was updated successfully, but these errors were encountered: