bug: Frontend error when accessing Node after deleting a related node in a relationship attribute
#5619
Labels
priority/2
This issue stalls work on the project or its dependents, it's a blocker for a release
state/backlog
This issue is part of the backlog
type/bug
Something isn't working as expected
Component
API Server / GraphQL, Frontend UI
Infrahub version
1.1.5
Current Behavior
After deleting a related node assigned to a Device (e.g., an IP address), the frontend attempts to access properties of the now-null relationship, leading to an error.
The frontend sends the following GraphQL query, which includes the properties field of primary_relation even when the related node is deleted:
Resulting in
It seems like removing the properties field from the GraphQL query (for the ip_address) resolves the issue.
Expected Behavior
The frontend should handle the null primary_relation gracefully without crashing.
Steps to Reproduce
Bug: Frontend Crashes When Accessing Device After Deleting a Related Node
Description
After deleting a related node assigned to a Device (e.g., an IP address), the frontend attempts to access properties of the now-null relationship, leading to an error.
Steps to Reproduce
Start Infrahub 1.1.5
Load the following schema:
yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
version: "1.0"
generics:
namespace: Dcim
include_in_menu: true
human_friendly_id:
order_by:
display_labels:
attributes:
kind: Text
unique: true
order_weight: 1000
relationships:
peer: IpamIPAddress
label: Primary IP Address
identifier: genericdevice__ipaddress
optional: true
cardinality: one
kind: Attribute
order_weight: 1700
nodes:
name: IPAddress
namespace: Ipam
include_in_menu: true
display_labels:
inherit_from:
uniqueness_constraints:
human_friendly_id:
attributes:
label: FQDN
kind: Text
optional: true
name: Device
namespace: Dcim
include_in_menu: true
inherit_from:
attributes: []
relationships: []
The text was updated successfully, but these errors were encountered: