|
| 1 | +--- |
| 2 | +title: Subgraphs |
| 3 | +--- |
| 4 | + |
| 5 | +## What is a Subgraph? |
| 6 | + |
| 7 | +A custom, open API that extracts data from a blockchain, processes it, and stores it so it can be easily queried via GraphQL. |
| 8 | + |
| 9 | +### Subgraphs Capabilities |
| 10 | + |
| 11 | +- Developers can build, deploy, and publish subgraphs to The Graph Network. |
| 12 | + - To get started, check out the subgraph developer [Quick Start](quick-start/). |
| 13 | +- Once a subgraph is indexed, anyone can query it. |
| 14 | +- Explore and query all subgraphs published to the network in [Graph Explorer](https://thegraph.com/explorer). |
| 15 | + |
| 16 | +## Inside a Subgraph |
| 17 | + |
| 18 | +The subgraph manifest, `subgraph.yaml`, defines the smart contracts & network your subgraph will index, the events from these contracts to pay attention to, and how to map event data to entities that Graph Node stores and allows to query. |
| 19 | + |
| 20 | +The **subgraph definition** consists of the following files: |
| 21 | + |
| 22 | +- `subgraph.yaml`: Contains the subgraph manifest |
| 23 | + |
| 24 | +- `schema.graphql`: A GraphQL schema defining the data stored for your subgraph and how to query it via GraphQL |
| 25 | + |
| 26 | +- `mapping.ts`: [AssemblyScript Mappings](https://github.com/AssemblyScript/assemblyscript) code that translates event data into entities defined in your schema (e.g. `mapping.ts` in this guide) |
| 27 | + |
| 28 | +To learn more about each of subgraph component, check out [creating a subgraph](/developing/creating-a-subgraph/). |
| 29 | + |
| 30 | +## Subgraph Development |
| 31 | + |
| 32 | +1. [Create a subgraph](/developing/creating-a-subgraph/) |
| 33 | +2. [Deploy a subgraph](/deploying/deploying-a-subgraph-to-studio/) |
| 34 | +3. [Test a subgraph](/deploying/subgraph-studio/#testing-your-subgraph-in-subgraph-studio) |
| 35 | +4. [Publish a subgraph](/publishing/publishing-a-subgraph/) |
| 36 | +5. [Signal on a subgraph](/publishing/publishing-a-subgraph/#adding-signal-to-your-subgraph) |
| 37 | + |
| 38 | +## Subgraph Lifecycle |
| 39 | + |
| 40 | +Here is a general overview of a subgraph’s lifecycle: |
| 41 | + |
| 42 | + |
0 commit comments