---
title: "replaceAll(nodes:edges:)"
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/replaceall(nodes:edges:)"
---

# replaceAll(nodes:edges:)

Replaces all nodes and edges in the graph with the provided collections.

## Declaration

```swift
mutating func replaceAll(nodes: [ComputeNodeGraph.NodeID : ComputeNodeGraph.Node], edges: [ComputeNodeGraph.Edge]) throws
```

## Parameters

- `nodes`: A sequence of nodes and their keys to add to the graph.
- `edges`: A sequence of edges to add to the graph.

## Discussion

Discussion This bulk operation allows for efficient wholesale replacement of the graph’s structure. note: An error if the replacement operation fails.
