# GraphDatabase

> Provides functionality needed to access, and perform operations on, graph assets.

## Definition

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

```csharp
public static class GraphDatabase
```

## Remarks

The `GraphDatabase` class is similar to Unity's [AssetDatabase](/engine/6000.7/script-reference/unityeditor/assetdatabase.md), but it is tailored for graph-based tools. Use this class to create, load, and save [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md) instances and their associated assets. This API supports typical asset workflows such as creating new graph assets in the Project window, accessing graphs by path or GUID, and ensuring changes to graph data are saved.

Use [GraphDatabase.PromptInProjectBrowserToCreateNewAsset](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/promptinprojectbrowsertocreatenewasset.md) to create and name a new asset, [GraphDatabase.CreateGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/creategraph.md) to generate an asset file, and [GraphDatabase.LoadGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/loadgraph.md) to retrieve an existing one.

Use [GraphDatabase.SaveGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/savegraph.md) to persist graph data changes, and [GraphDatabase.LoadGraphForImporter](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/loadgraphforimporter.md) to load a clean instance during import.

## Static Methods

| Method                                                                                                                                                      | Description                                                                                                                                                              |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [CreateGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/creategraph.md)                                                       | Creates a new graph asset of type `T` at the specified file path.                                                                                                        |
| [GetGraphAssetGUID](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/getgraphassetguid.md)                                           | Retrieves the globally unique identifier (GUID) for the asset associated with the specified [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md). |
| [GetGraphAssetPath](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/getgraphassetpath.md)                                           | Retrieves the file path of the asset associated with the specified [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md).                          |
| [LoadGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/loadgraph.md)                                                           | Loads a [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md) of type `T` from the asset at the specified path.                                    |
| [LoadGraphForImporter](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/loadgraphforimporter.md)                                     | Loads a fresh instance of the [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md) of type `T` from disk for use in the asset import pipeline.    |
| [PromptInProjectBrowserToCreateNewAsset](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/promptinprojectbrowsertocreatenewasset.md) | Creates a new graph asset and activates the naming field in the Project Browser.                                                                                         |
| [SaveGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/savegraph.md)                                                           | Saves the asset of the specified [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md) to disk if it has unsaved changes.                          |
