# GetNodes()

> Retrieves all nodes in the graph.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public IEnumerable<INode> GetNodes()
```

### Returns

| Type                                                                                                   | Description                                                                                                        |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| [IEnumerable\<INode>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) | An `IEnumerable` of all [INode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode.md)s in the graph. |

### Remarks

Use this method to access every node in the graph. Nodes are returned in the order they were created.

The list includes:

* Your own [Node](/engine/6000.7/script-reference/unity/graphtoolkit/editor/node.md)s

* [ContextNode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/contextnode.md)s

* [IVariableNode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariablenode.md)s

* [IConstantNode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iconstantnode.md)s

* [ISubgraphNode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/isubgraphnode.md)s

It excludes [BlockNode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/blocknode.md)s, which are only accessible through their parent [ContextNode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/contextnode.md).
