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

# addNode(_:)

Adds a node to the graph and returns its name.

## Declaration

```swift
@discardableResult final func addNode(_ node: ShaderGraph.Node) throws -> String
```

## Return Value

Return Value The name used to reference this node in subsequent calls.

## Discussion

Discussion note: If the node is invalid for this graph.
