# QueryGraph

> Class that represents a query graph.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.Search](/engine/6000.7/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor

```csharp
public class QueryGraph
```

## Remarks

A parsed query is converted into a graph with each node in the graph corresponding to a filter.

## Constructors

| Constructor                                                                                                        | Description                             |
| ------------------------------------------------------------------------------------------------------------------ | --------------------------------------- |
| [QueryGraph(UnityEditor.Search.IQueryNode)](/engine/6000.7/script-reference/unityeditor/search/querygraph/ctor.md) | Constructor. Creates a new query graph. |

## Properties

| Property                                                                        | Description                          |
| ------------------------------------------------------------------------------- | ------------------------------------ |
| [empty](/engine/6000.7/script-reference/unityeditor/search/querygraph/empty.md) | Returns true if the graph is empty.  |
| [root](/engine/6000.7/script-reference/unityeditor/search/querygraph/root.md)   | Root node of the graph. Can be null. |

## Methods

| Method                                                                                | Description         |
| ------------------------------------------------------------------------------------- | ------------------- |
| [Optimize](/engine/6000.7/script-reference/unityeditor/search/querygraph/optimize.md) | Optimize the graph. |
