From 7f76c4bf89886e71909c81c6f57ec95d2c8f6deb Mon Sep 17 00:00:00 2001 From: Yash Jagtap Date: Sun, 15 Nov 2026 11:31:13 +0530 Subject: [PATCH] docs: point stale heading anchors at their current pages Links to /developing/creating-a-subgraph/#... redirect to starting-your-subgraph, which has none of those headings, and the graphql-api heading is now #time-travel-queries-example. Point each link at the page that holds the section: subgraph-manifest (prune, start blocks, data source templates, indexer hints, polling and once filters), advanced (grafting, file data sources, file handlers, timeseries, indexed argument filters) and ql-schema (enums). --- .../src/pages/en/subgraphs/best-practices/pruning.mdx | 6 +++--- .../en/subgraphs/developing/creating/advanced.mdx | 2 +- .../developing/creating/starting-your-subgraph.mdx | 10 +++++----- .../pages/en/subgraphs/developing/developer-faq.mdx | 6 +++--- .../existing-subgraphs/standard-subgraphs.mdx | 2 +- website/src/pages/en/subgraphs/guides/enums.mdx | 2 +- website/src/pages/en/subgraphs/guides/grafting.mdx | 4 ++-- .../en/subgraphs/tooling/unit-testing-framework.mdx | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/website/src/pages/en/subgraphs/best-practices/pruning.mdx b/website/src/pages/en/subgraphs/best-practices/pruning.mdx index 6f7ea4903d3d..112b8e02e499 100644 --- a/website/src/pages/en/subgraphs/best-practices/pruning.mdx +++ b/website/src/pages/en/subgraphs/best-practices/pruning.mdx @@ -5,7 +5,7 @@ sidebarTitle: 'Pruning with indexerHints' ## TLDR -[Pruning](/developing/creating-a-subgraph/#prune) removes archival entities from the Subgraph’s database up to a given block, and removing unused entities from a Subgraph’s database will improve a Subgraph’s query performance, often dramatically. Using `indexerHints` is an easy way to prune a Subgraph. +[Pruning](/subgraphs/developing/creating/subgraph-manifest/#prune) removes archival entities from the Subgraph’s database up to a given block, and removing unused entities from a Subgraph’s database will improve a Subgraph’s query performance, often dramatically. Using `indexerHints` is an easy way to prune a Subgraph. ## How to Prune a Subgraph With `indexerHints` @@ -15,7 +15,7 @@ Add a section called `indexerHints` in the manifest. - `prune: auto`: Retains the minimum necessary history as set by the Indexer, optimizing query performance. This is the generally recommended setting and is the default for all Subgraphs created by `graph-cli` >= 0.66.0. - `prune: `: Sets a custom limit on the number of historical blocks to retain. -- `prune: never`: No pruning of historical data; retains the entire history and is the default if there is no `indexerHints` section. `prune: never` should be selected if [Time Travel Queries](/subgraphs/querying/graphql-api/#time-travel-queries) are desired. +- `prune: never`: No pruning of historical data; retains the entire history and is the default if there is no `indexerHints` section. `prune: never` should be selected if [Time Travel Queries](/subgraphs/querying/graphql-api/#time-travel-queries-example) are desired. We can add `indexerHints` to our Subgraphs by updating our `subgraph.yaml`: @@ -33,7 +33,7 @@ dataSources: ## Important Considerations -- If [Time Travel Queries](/subgraphs/querying/graphql-api/#time-travel-queries) are desired as well as pruning, pruning must be performed accurately to retain Time Travel Query functionality. Due to this, it is generally not recommended to use `indexerHints: prune: auto` with Time Travel Queries. Instead, prune using `indexerHints: prune: ` to accurately prune to a block height that preserves the historical data required by Time Travel Queries, or use `prune: never` to maintain all data. +- If [Time Travel Queries](/subgraphs/querying/graphql-api/#time-travel-queries-example) are desired as well as pruning, pruning must be performed accurately to retain Time Travel Query functionality. Due to this, it is generally not recommended to use `indexerHints: prune: auto` with Time Travel Queries. Instead, prune using `indexerHints: prune: ` to accurately prune to a block height that preserves the historical data required by Time Travel Queries, or use `prune: never` to maintain all data. - It is not possible to [graft](/subgraphs/cookbook/grafting/) at a block height that has been pruned. If grafting is routinely performed and pruning is desired, it is recommended to use `indexerHints: prune: ` that will accurately retain a set number of blocks (e.g., enough for six months). diff --git a/website/src/pages/en/subgraphs/developing/creating/advanced.mdx b/website/src/pages/en/subgraphs/developing/creating/advanced.mdx index 0f33c514f8cb..78b7f9e21452 100644 --- a/website/src/pages/en/subgraphs/developing/creating/advanced.mdx +++ b/website/src/pages/en/subgraphs/developing/creating/advanced.mdx @@ -153,7 +153,7 @@ File data sources are a new Subgraph functionality for accessing off-chain data Rather than fetching files "in line" during handler execution, this introduces templates which can be spawned as new data sources for a given file identifier. These new data sources fetch the files, retrying if they are unsuccessful, running a dedicated handler when the file is found. -This is similar to the [existing data source templates](/developing/creating-a-subgraph/#data-source-templates), which are used to dynamically create new chain-based data sources. +This is similar to the [existing data source templates](/subgraphs/developing/creating/subgraph-manifest/#data-source-templates), which are used to dynamically create new chain-based data sources. > This replaces the existing `ipfs.cat` API diff --git a/website/src/pages/en/subgraphs/developing/creating/starting-your-subgraph.mdx b/website/src/pages/en/subgraphs/developing/creating/starting-your-subgraph.mdx index 726af8e3514c..18c72e4ca3ac 100644 --- a/website/src/pages/en/subgraphs/developing/creating/starting-your-subgraph.mdx +++ b/website/src/pages/en/subgraphs/developing/creating/starting-your-subgraph.mdx @@ -24,12 +24,12 @@ Explore additional [resources for APIs](/subgraphs/developing/creating/graph-ts/ | Version | Release notes | | :-: | --- | -| 1.2.0 | Added support for [Indexed Argument Filtering](/#indexed-argument-filters--topic-filters) & declared `eth_call` | -| 1.1.0 | Supports [Timeseries & Aggregations](#timeseries-and-aggregations). Added support for type `Int8` for `id`. | -| 1.0.0 | Supports [`indexerHints`](/developing/creating-a-subgraph/#indexer-hints) feature to prune Subgraphs | +| 1.2.0 | Added support for [Indexed Argument Filtering](/subgraphs/developing/creating/advanced/#indexed-argument-filters--topic-filters) & declared `eth_call` | +| 1.1.0 | Supports [Timeseries & Aggregations](/subgraphs/developing/creating/advanced/#timeseries-and-aggregations). Added support for type `Int8` for `id`. | +| 1.0.0 | Supports [`indexerHints`](/subgraphs/developing/creating/subgraph-manifest/#indexer-hints) feature to prune Subgraphs | | 0.0.9 | Supports `endBlock` feature | -| 0.0.8 | Added support for polling [Block Handlers](/developing/creating-a-subgraph/#polling-filter) and [Initialisation Handlers](/developing/creating-a-subgraph/#once-filter). | -| 0.0.7 | Added support for [File Data Sources](/developing/creating-a-subgraph/#file-data-sources). | +| 0.0.8 | Added support for polling [Block Handlers](/subgraphs/developing/creating/subgraph-manifest/#polling-filter) and [Initialisation Handlers](/subgraphs/developing/creating/subgraph-manifest/#once-filter). | +| 0.0.7 | Added support for [File Data Sources](/subgraphs/developing/creating/advanced/#ipfsarweave-file-data-sources). | | 0.0.6 | Supports fast [Proof of Indexing](/indexing/overview/#what-is-a-proof-of-indexing-poi) calculation variant. | | 0.0.5 | Added support for event handlers having access to transaction receipts. | | 0.0.4 | Added support for managing subgraph features. | diff --git a/website/src/pages/en/subgraphs/developing/developer-faq.mdx b/website/src/pages/en/subgraphs/developing/developer-faq.mdx index e45141294523..a2d6939847b2 100644 --- a/website/src/pages/en/subgraphs/developing/developer-faq.mdx +++ b/website/src/pages/en/subgraphs/developing/developer-faq.mdx @@ -51,7 +51,7 @@ Within a Subgraph, the events are always processed in the order they appear in t Templates allow you to create data sources quickly, while your Subgraph is indexing. Your contract might spawn new contracts as people interact with it. Since you know the shape of those contracts (ABI, events, etc.) upfront, you can define how you want to index them in a template. When they are spawned, your Subgraph will create a dynamic data source by supplying the contract address. -Check out the "Instantiating a data source template" section on: [Data Source Templates](/developing/creating-a-subgraph/#data-source-templates). +Check out the "Instantiating a data source template" section on: [Data Source Templates](/subgraphs/developing/creating/subgraph-manifest/#data-source-templates). ### 11. Is it possible to set up a Subgraph using `graph init` from `graph-cli` with two contracts? Or should I manually add another dataSource in `subgraph.yaml` after running `graph init`? @@ -108,11 +108,11 @@ Yes. Sepolia supports block handlers, call handlers and event handlers. It shoul ### 19. Is it possible to specify what block to start indexing on? -Yes. `dataSources.source.startBlock` in the `subgraph.yaml` file specifies the number of the block that the dataSource starts indexing from. In most cases, we suggest using the block where the contract was created: [Start blocks](/developing/creating-a-subgraph/#start-blocks) +Yes. `dataSources.source.startBlock` in the `subgraph.yaml` file specifies the number of the block that the dataSource starts indexing from. In most cases, we suggest using the block where the contract was created: [Start blocks](/subgraphs/developing/creating/subgraph-manifest/#start-blocks) ### 20. What are some tips to increase the performance of indexing? My Subgraph is taking a very long time to sync -Yes, you should take a look at the optional start block feature to start indexing from the block where the contract was deployed: [Start blocks](/developing/creating-a-subgraph/#start-blocks) +Yes, you should take a look at the optional start block feature to start indexing from the block where the contract was deployed: [Start blocks](/subgraphs/developing/creating/subgraph-manifest/#start-blocks) ### 21. Is there a way to query the Subgraph directly to determine the latest block number it has indexed? diff --git a/website/src/pages/en/subgraphs/existing-subgraphs/standard-subgraphs.mdx b/website/src/pages/en/subgraphs/existing-subgraphs/standard-subgraphs.mdx index eff49463e004..04fc88c3da34 100644 --- a/website/src/pages/en/subgraphs/existing-subgraphs/standard-subgraphs.mdx +++ b/website/src/pages/en/subgraphs/existing-subgraphs/standard-subgraphs.mdx @@ -48,7 +48,7 @@ The standardized schemas each cover one protocol category. Every schema shares a Because the schemas are meant to be consumed the same way regardless of protocol, they follow a consistent set of conventions. -**Three ways to read quantitative data.** You can query an entity directly for _real-time_ values (e.g. `totalValueLockedUSD` on a `Pool`), use [time-travel queries](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#time-travel-queries) for _point-in-time_ historical values, or query the snapshot entities for _time-series_ data (e.g. `PoolDailySnapshot`). +**Three ways to read quantitative data.** You can query an entity directly for _real-time_ values (e.g. `totalValueLockedUSD` on a `Pool`), use [time-travel queries](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#time-travel-queries-example) for _point-in-time_ historical values, or query the snapshot entities for _time-series_ data (e.g. `PoolDailySnapshot`). **Standardized financial metrics.** Revenue is split consistently across every schema: diff --git a/website/src/pages/en/subgraphs/guides/enums.mdx b/website/src/pages/en/subgraphs/guides/enums.mdx index 9f55ae07c54b..1199fb359a4d 100644 --- a/website/src/pages/en/subgraphs/guides/enums.mdx +++ b/website/src/pages/en/subgraphs/guides/enums.mdx @@ -26,7 +26,7 @@ enum TokenStatus { This means that when you use the `TokenStatus` type in your schema, you expect it to be exactly one of predefined values: `OriginalOwner`, `SecondOwner`, or `ThirdOwner`, ensuring consistency and validity. -To learn more about enums, check out [Creating a Subgraph](/developing/creating-a-subgraph/#enums) and [GraphQL documentation](https://graphql.org/learn/schema/#enumeration-types). +To learn more about enums, check out [Creating a Subgraph](/subgraphs/developing/creating/ql-schema/#enums) and [GraphQL documentation](https://graphql.org/learn/schema/#enumeration-types). ## Benefits of Using Enums diff --git a/website/src/pages/en/subgraphs/guides/grafting.mdx b/website/src/pages/en/subgraphs/guides/grafting.mdx index d9abe0e70d2a..95ce7121504f 100644 --- a/website/src/pages/en/subgraphs/guides/grafting.mdx +++ b/website/src/pages/en/subgraphs/guides/grafting.mdx @@ -20,7 +20,7 @@ The grafted Subgraph can use a GraphQL schema that is not identical to the one o For more information, you can check: -- [Grafting](/developing/creating-a-subgraph/#grafting-onto-existing-subgraphs) +- [Grafting](/subgraphs/developing/creating/advanced/#grafting-onto-existing-subgraphs) In this tutorial, we will be covering a basic use case. We will replace an existing contract with an identical contract (with a new address, but the same code). Then, graft the existing Subgraph onto the "base" Subgraph that tracks the new contract. @@ -197,6 +197,6 @@ If you want more experience with grafting, here are a few examples for popular c - [ERC-721](https://github.com/messari/subgraphs/blob/master/subgraphs/erc721-metadata/subgraph.yaml) - [Uniswap](https://github.com/messari/subgraphs/blob/master/subgraphs/uniswap-v3-forks/protocols/uniswap-v3/config/templates/uniswapV3Template.yaml), -To become even more of a Graph expert, consider learning about other ways to handle changes in underlying datasources. Alternatives like [Data Source Templates](/developing/creating-a-subgraph/#data-source-templates) can achieve similar results +To become even more of a Graph expert, consider learning about other ways to handle changes in underlying datasources. Alternatives like [Data Source Templates](/subgraphs/developing/creating/subgraph-manifest/#data-source-templates) can achieve similar results > Note: A lot of material from this article was taken from the previously published [Arweave article](/subgraphs/cookbook/arweave/) diff --git a/website/src/pages/en/subgraphs/tooling/unit-testing-framework.mdx b/website/src/pages/en/subgraphs/tooling/unit-testing-framework.mdx index 1ec03c5555c7..4887fd5d554b 100644 --- a/website/src/pages/en/subgraphs/tooling/unit-testing-framework.mdx +++ b/website/src/pages/en/subgraphs/tooling/unit-testing-framework.mdx @@ -1220,7 +1220,7 @@ type TokenLockMetadata @entity { export function handleMetadata(content: Bytes): void { // dataSource.stringParams() returns the File DataSource CID // stringParam() will be mocked in the handler test - // for more info https://thegraph.com/docs/en/developing/creating-a-subgraph/#create-a-new-handler-to-process-files + // for more info https://thegraph.com/docs/en/subgraphs/developing/creating/advanced/#create-a-new-handler-to-process-files let tokenMetadata = new TokenLockMetadata(dataSource.stringParam()) const value = json.fromBytes(content).toObject()