Repository navigation
Conversation
The first example listed event and handler outside an eventHandlers list entry, and the second wrote calls as a list, which graph-node rejects because calls is a map. Also document struct field access in declared calls (specVersion 1.4.0) and add 1.4.0 to the specVersion table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The declared
eth_callsection insubgraphs/developing/creating/advancedhas two examples that don't parse into the shape graph-node expects, and it doesn't cover struct field access from specVersion 1.4.0.Example fixes (
advanced.mdx)event.addressexample listedevent:,handler:andcalls:at the same level aseventHandlers:, so the YAML parses witheventHandlers: nulland the handler fields at the top level. It's now a proper list entry undereventHandlers.event.paramsexample wrotecallsas a list (- ERC20DecimalsToken0: ...). graph-node deserializescallsas a map of label to call (HashMap<String, String>inUnresolvedCallDecls,graph/src/data_source/common.rs), so the list form fails. It's nowERC20DecimalsToken0: ..., with one sentence explaining thatcallsis a map.specVersion: 1.2.0", matching graph-node'sSPEC_VERSION_1_2_0("Enables eth call declarations") and the existing 1.2.0 row in the specVersion table.New: accessing struct fields
A short subsection with an example of reading struct fields by position (
event.params.asset.0) and by name (event.params.complexAsset.base.addr), available fromspecVersion: 1.4.0. The examples are taken from graph-node'stests/integration-tests/declared-calls-struct-fields/subgraph.yamland matchdocs/subgraph-manifest.md§1.5.3 in graph-node.specVersion table (
subgraph-manifest.mdx)eth_calls"), fromSPEC_VERSION_1_4_0ingraph/src/data/subgraph/api_version.rs.1.3.0" from thespecVersionbullet and pointed to the table instead. graph-node already defines 1.5.0 (Amp data sources), which the docs intentionally don't cover since Remove Amp, add Anubis network icon + custom page, fix Robinhood icon #1120, so any "latest" number here would be wrong or would need Amp docs. Happy to put a version back if you prefer.Checks: every YAML snippet in the section parses to the expected shape (the old two did not);
prettier --checkandeslint --max-warnings 0pass on both files. English pages only, no URL changes.