# LoadGraph<T>(string)

> Loads a Graph of type T from the asset at the specified path.

## Definition

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

```csharp
public static T LoadGraph<T>(string assetPath) where T : Graph
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The relative path to the graph asset (for example, "Assets/Graphs/MyGraph.mygraph").

### Returns

| Type | Description                                                         |
| ---- | ------------------------------------------------------------------- |
| T    | The loaded graph instance, or `null` if no matching graph is found. |

### Remarks

Use this method to load a graph asset of type `T` from a given asset path. The `assetPath` must be relative to the Unity project folder. This method returns the graph object currently loaded in memory, which might differ from the version on disk if the asset was modified or opened in an editor. This behavior is similar to [AssetDatabase.LoadAssetAtPath](/engine/6000.6/script-reference/unityeditor/assetdatabase/loadassetatpath.md). For deterministic loading during import, use [GraphDatabase.LoadGraphForImporter](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphdatabase/loadgraphforimporter.md) instead.
