---
title: "replace(nodes:edges:)"
framework: realitykit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "realitykit/shadergraph/replace(nodes:edges:)"
---

# replace(nodes:edges:)

Replaces all nodes and edges in the graph.

## Declaration

```swift
final func replace(nodes: [String : ShaderGraph.Node], edges: [ShaderGraph.Edge]) throws
```

## Discussion

Discussion note: If the provided nodes and edges do not form a valid graph.
