---
title: "canAddEdge(_:)"
framework: Compute Graph
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "computegraph/computenodegraph/canaddedge(_:)"
---

# canAddEdge(_:)

Returns whether the given edge can be added to the graph.

## Declaration

```swift
func canAddEdge(_ edge: ComputeNodeGraph.Edge) -> Bool
```

## Parameters

- `edge`: The edge to test.

## Return Value

Return Value true if calling addEdge(_:) with this edge would succeed.

## Discussion

Discussion This is the non-throwing preflight check for addEdge(_:). Use it to validate a connection — for example, to highlight compatible ports during drag-and-drop — without modifying the graph.
