# GraphAttribute(string, GraphOptions)

> Initializes a new instance of the GraphAttribute class with a file extension and optional graph options.

## Definition

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

```csharp
public GraphAttribute(string extension, GraphOptions options = GraphOptions.Default)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file extension to associate with assets of the graph type. This value must be unique because Unity uses it to select the correct importer.**** (\[GraphOptions]\(/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphoptions)): The configuration options for the graph. Defaults to [GraphOptions.Default](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphoptions/default.md) if not specified.

### Remarks

Use this constructor to define the asset extension and configure the graph. This allows for proper asset recognition and import handling by Unity. The values in [GraphOptions](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphoptions.md) support bitwise combination. Combine multiple flags to configure the graph with custom behavior.

This example keeps the default behavior and adds support for subgraphs by enabling [GraphOptions.SupportsSubgraphs](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphoptions/supportssubgraphs.md).

### Examples

```csharp
[Graph("mygraph", GraphOptions.SupportsSubgraphs)]
public class MyGraph : Graph { }
```
