<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/ComputeNodeGraph/canAddEdge(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Compute Graph",
      "ComputeGraph"
    ],
    "preciseIdentifier" : "s:12ComputeGraph0a4NodeB0V10canAddEdgeySbAC0F0VF"
  },
  "title" : "canAddEdge(_:)"
}
-->

# canAddEdge(_:)

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

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

## Parameters

`edge`

The edge to test.

## Return Value

`true` if calling [`addEdge(_:)`](/documentation/ComputeGraph/ComputeNodeGraph/addEdge(_:)) with this edge would succeed.

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)