---
title: Introduction
description: What subgraphs are, who this handbook is for, and where to start.
url: https://yashpersonal.thally.app/
---

# Introduction

What subgraphs are, who this handbook is for, and where to start.

## What a subgraph does

A subgraph is an open API that turns raw blockchain data into a queryable
GraphQL endpoint. You describe which smart contract events you care about,
write small mapping functions that transform those events into entities, and
The Graph's indexers do the heavy lifting of scanning the chain, storing the
results, and serving queries.

Without a subgraph, an app that wants "every transfer of this token, sorted by
value" has to crawl blocks with an RPC node, decode logs, and maintain its own
database. With one, that is a single GraphQL query.

A subgraph is made of three files:

| File | Purpose |
| --- | --- |
| `subgraph.yaml` | The manifest. Which contract, which network, which events, and where indexing starts. |
| `schema.graphql` | The entities you want to store and query. |
| `src/mapping.ts` | AssemblyScript handlers that turn each event into entity writes. |

## Who this is for

- **Frontend and full-stack developers** who need indexed onchain data in an
  app and do not want to run indexing infrastructure.
- **Smart contract developers** who want a queryable view of their protocol
  for dashboards, analytics, or integrations.
- **Anyone whose subgraph is stuck or failing.** The debugging guide is built
  from the most common tickets seen in production support.

You should be comfortable with a terminal, Node.js, and basic GraphQL. You do
not need to know AssemblyScript in advance.

## Pick your path

#### [Quickstart](/quickstart)

    Deploy a working subgraph for a verified mainnet contract and run your
    first query in about 15 minutes.

#### [Debug a failed subgraph](/guides/debug-a-failed-subgraph)

    Read the indexing status, decode the fatal error, and apply the fix for
    the most common failure modes.

> **Scope of this handbook:**
  This site focuses on the developer workflow with `graph-cli` and Subgraph
  Studio. For the full protocol reference, including publishing to the
  decentralized network and curation, use the
  [official docs](https://thegraph.com/docs/en/).