From ef2191394344b7f85be7f438715943a202a7ddd6 Mon Sep 17 00:00:00 2001 From: Shiyas Mohammed <83513144+Shiyasmohd@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:17:56 +0530 Subject: [PATCH] docs: Added new Q&A in Developer FAQ (#625) * docs: Added new Q&A in Developer FAQ Added new Q&A in Developer FAQ regarding the order of handlers triggered for a data source. * docs: added info about dynamic data sources on FAQ * docs: note on ordering of handlers in dynamic data sources added --- website/pages/en/developing/creating-a-subgraph.mdx | 2 ++ website/pages/en/developing/developer-faqs.mdx | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/website/pages/en/developing/creating-a-subgraph.mdx b/website/pages/en/developing/creating-a-subgraph.mdx index 78494569ce90..867f69f2408a 100644 --- a/website/pages/en/developing/creating-a-subgraph.mdx +++ b/website/pages/en/developing/creating-a-subgraph.mdx @@ -182,6 +182,8 @@ The triggers for a data source within a block are ordered using the following pr These ordering rules are subject to change. +> **Note:** When new [dynamic data source](#data-source-templates-for-dynamically-created-contracts) are created, the handlers defined for dynamic data sources will only start processing after all existing data source handlers are processed, and will repeat in the same sequence whenever triggered. + ### Getting The ABIs The ABI file(s) must match your contract(s). There are a few ways to obtain ABI files: diff --git a/website/pages/en/developing/developer-faqs.mdx b/website/pages/en/developing/developer-faqs.mdx index dce2f8137eba..4ae3d66e7aa1 100644 --- a/website/pages/en/developing/developer-faqs.mdx +++ b/website/pages/en/developing/developer-faqs.mdx @@ -136,3 +136,9 @@ The Graph will never charge for the hosted service. The Graph is a decentralized ## 27. How do I update a subgraph on mainnet? If you’re a subgraph developer, you can deploy a new version of your subgraph to the Subgraph Studio using the CLI. It’ll be private at that point, but if you’re happy with it, you can publish to the decentralized Graph Explorer. This will create a new version of your subgraph that Curators can start signaling on. + +## 28. In what order are the event, block, and call handlers triggered for a data source? + +Event and call handlers are first ordered by transaction index within the block. Event and call handlers within the same transaction are ordered using a convention: event handlers first then call handlers, each type respecting the order they are defined in the manifest. Block handlers are run after event and call handlers, in the order they are defined in the manifest. Also these ordering rules are subject to change. + +When new dynamic data source are created, the handlers defined for dynamic data sources will only start processing after all existing data source handlers are processed, and will repeat in the same sequence whenever triggered.