> For the complete documentation index, see [llms.txt](https://doc.traceye.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.traceye.io/services/dedicated-indexing/graph-nodes/subgraph-manual/manage-subgraph.md).

# Manage Subgraph

This section will guide you on how to manage a subgraph.

* [Create Subgraph](#create-subgraph)
* [Deploy Subgraph](#deploy-subgraph)
* [Query Subgraph](#query-subgraph)
* [Delete Subgraph](#delete-subgraph)

***

### Create Subgraph

{% hint style="warning" %}
The node needs to be in the live state for you to add a subgraph to it.
{% endhint %}

**Step 1: Graph Nodes** - Navigate to the [Graph Nodes](https://app.traceye.io/subgraph/graph-node) page on the platform. Here you will see a list of nodes that you purchased and the ones that are already deployed. Now, click on the **Add Subgraph** button.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FpCtXnYLlpkujJmjqL926%2Fimage.png?alt=media&amp;token=337812a0-6d50-4844-ab8b-efd3c45fe7f9" alt=""><figcaption></figcaption></figure>

**Step 2: Create Subgraph -** Choose the **Create New** option from the dropdown menu.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FelUN83Qe5BCisbAcJiPy%2Fimage.png?alt=media&amp;token=c8a05129-7986-4dc9-b1e1-aeda7d563d71" alt=""><figcaption></figcaption></figure>

**Step 3: Enter Details -** Provide a name, and choose the node and the network for your subgraph. Now, click on the **Add** button to create a new subgraph.\
NOTE: If only one node is live then it will be pre-selected. Also, if a single network is present in the node then it will also be pre-selected.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FxmsD4DkKFq08wthJY3v8%2Fimage.png?alt=media&amp;token=e8886aa5-b1cf-4b80-9e5e-9757ef256970" alt=""><figcaption></figcaption></figure>

On successful creation, you will be redirected to the subgraph detail page.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FfOYQ6VPNNvBHfZs1d3DB%2Fimage.png?alt=media&amp;token=4127b0aa-eb5c-4519-b951-521501e34e4b" alt=""><figcaption></figcaption></figure>

***

### Deploy Subgraph

**Step 1:** Navigate to the **Details** section on the subgraph detail page. Now, click on the **Deployment Command** button.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FisffyQXdV1OSDTIQUzq2%2Fimage.png?alt=media&amp;token=14095ad3-906a-4282-ae14-c7930dfed13f" alt=""><figcaption></figcaption></figure>

**Step 2:** Follow the steps provided on the screen to deploy your own subgraph.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FN8KTvUQgrGeJ3W17HIJA%2Fimage.png?alt=media&amp;token=304f5dd4-2f8a-4619-b43e-51ad1db73ddf" alt=""><figcaption></figcaption></figure>

***

### Query Subgraph

{% hint style="warning" %}
The subgraph must be deployed and indexed before it can be queried.
{% endhint %}

On the subgraph detail page, navigate to the **Query URL** section. Click on first icon to open the **GraphiQL** query editor on a new tab, or click on second icon to copy the query URL.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FNarxgm3eMcLErIY52cW7%2Fimage.png?alt=media&amp;token=dde7ce02-99f5-4ada-97a6-4c480614ba9f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FkNl85upm08tgEfacC9iK%2Fimage.png?alt=media&amp;token=aeb35d4c-0336-4912-acdc-712090e7dbce" alt=""><figcaption></figcaption></figure>

***

### Delete Subgraph

On the subgraph detail page, click on the **Delete** button on the top right corner of the screen.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FqV3pjRLdjtDdIVKKxYvw%2Fimage.png?alt=media&amp;token=dcc98813-4dcb-41a3-9e1f-01d2b796b3f4" alt=""><figcaption></figcaption></figure>

Now, click on the **Continue** button to delete the subgraph.

<figure><img src="https://461237800-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtdewVLJM1K7okWyOstj%2Fuploads%2FtX5hpvS6Fl5C7GPLhorV%2Fimage.png?alt=media&amp;token=87c7cfcf-8770-440f-87d8-1fe9065d02c0" alt=""><figcaption></figcaption></figure>
