You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* mistake in: 'with the ability to run integrate with any GraphQL' -- 'run' removed
* misuse of apostrophe in: its
* fixed two mistakes in: "We can ship a several built-in strategies, along with a simple interfaces to allow developers to write their own."
* typo fix: 'streame'
* fixed: "Recent versions of the Graph CLI supports" - versions is the subject, so 'supports' becomes 'support'
* 'command' being the subject - 'creates' becomes 'create'
* missing 'you' - 'allows' needs a noun
* 'handler will be run every block' changed to 'handler will be run on every block'
* 'does' changed to 'do'
* 'contain' changed to 'contains'
* pluralization of 'depend'
* subject/verbs were off
* fixed sentence
* fixed sentence
* api page typo: 'created withing a block'
* api: missing period
Copy file name to clipboardExpand all lines: website/src/pages/en/subgraphs/developing/creating/advanced.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Advanced Subgraph Features
4
4
5
5
## Overview
6
6
7
-
Add and implement advanced Subgraph features to enhanced your Subgraph's built.
7
+
Add and implement advanced Subgraph features to enhance your Subgraph's build.
8
8
9
9
Starting from `specVersion``0.0.4`, Subgraph features must be explicitly declared in the `features` section at the top level of the manifest file, using their `camelCase` name, as listed in the table below:
Copy file name to clipboardExpand all lines: website/src/pages/en/subgraphs/developing/creating/graph-ts/api.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,7 +270,7 @@ As the entity may not exist in the store yet, the `load` method returns a value
270
270
271
271
> Note: Loading entities is only necessary if the changes made in the mapping depend on the previous data of an entity. See the next section for the two ways of updating existing entities.
272
272
273
-
#### Looking up entities created withing a block
273
+
#### Looking up entities created within a block
274
274
275
275
As of `graph-node` v0.31.0, `@graphprotocol/graph-ts` v0.30.0 and `@graphprotocol/graph-cli` v0.49.0 the `loadInBlock` method is available on all entity types.
276
276
@@ -496,7 +496,7 @@ export function handleTransfer(event: TransferEvent) {
496
496
}
497
497
```
498
498
499
-
`Transfer` is aliased to `TransferEvent` here to avoid a naming conflict with the entity type
499
+
`Transfer` is aliased to `TransferEvent` here to avoid a naming conflict with the entity type.
500
500
501
501
As long as the `ERC20Contract` on Ethereum has a public read-only function called `symbol`, it can be called with `.symbol()`. For public state variables a method with the same name is created automatically.
`dataSources` are key components of Subgraphs. They define the sources of data that the Subgraph indexes and processes. A `dataSource` specifies which smart contract to listen to, which events to process, and how to handle them.
70
70
71
-
Recent versions of the Graph CLI supports adding new `dataSources` to an existing Subgraph through the `graph add` command:
71
+
Recent versions of the Graph CLI support adding new `dataSources` to an existing Subgraph through the `graph add` command:
The `graph add` command will fetch the ABI from Etherscan (unless an ABI path is specified with the `--abi` option) and creates a new `dataSource`, similar to how the `graph init` command creates a `dataSource``--from-contract`, updating the schema and mappings accordingly. This allows you to index implementation contracts from their proxy contracts.
86
+
The `graph add` command will fetch the ABI from Etherscan (unless an ABI path is specified with the `--abi` option) and create a new `dataSource`, similar to how the `graph init` command creates a `dataSource``--from-contract`, updating the schema and mappings accordingly. This allows you to index implementation contracts from their proxy contracts.
87
87
88
88
- The `--merge-entities` option identifies how the developer would like to handle `entity` and `event` name conflicts:
89
89
- If `true`: the new `dataSource` should use existing `eventHandlers` & `entities`.
Copy file name to clipboardExpand all lines: website/src/pages/en/subgraphs/developing/creating/ql-schema.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ Entity fields can be defined as required or optional. Required fields are indica
62
62
Null value resolved for non-null field 'name'
63
63
```
64
64
65
-
Each entity must have an `id` field, which must be of type `Bytes!` or `String!`. It is generally recommended to use `Bytes!`, unless the `id` contains human-readable text, since entities with `Bytes!` id's will be faster to write and query as those with a `String!` `id`. The `id` field serves as the primary key, and needs to be unique among all entities of the same type. For historical reasons, the type `ID!` is also accepted and is a synonym for `String!`.
65
+
Each entity must have an `id` field, which must be of type `Bytes!` or `String!`. It is generally recommended to use `Bytes!`, unless the `id` contains human-readable text, since entities with `Bytes!` id's will be faster to write and query than those with a `String!` `id`. The `id` field serves as the primary key, and needs to be unique among all entities of the same type. For historical reasons, the type `ID!` is also accepted and is a synonym for `String!`.
66
66
67
67
For some entity types the `id` for `Bytes!` is constructed from the id's of two other entities; that is possible using `concat`, e.g., `let id = left.id.concat(right.id) ` to form the id from the id's of `left` and `right`. Similarly, to construct an id from the id of an existing entity and a counter `count`, `let id = left.id.concatI32(count)` can be used. The concatenation is guaranteed to produce unique id's as long as the length of `left` is the same for all such entities, for example, because `left.id` is an `Address`.
Copy file name to clipboardExpand all lines: website/src/pages/en/subgraphs/developing/creating/subgraph-manifest.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ The important entries to update for the manifest are:
93
93
94
94
- `indexerHints.prune`: Defines the retention of historical block data for a Subgraph. See [prune](#prune) in [indexerHints](#indexer-hints) section.
95
95
96
-
- `dataSources.source`: the address of the smart contract the Subgraph sources, and the ABI of the smart contract to use. The address is optional; omitting it allows to index matching events from all contracts.
96
+
- `dataSources.source`: the address of the smart contract the Subgraph sources, and the ABI of the smart contract to use. The address is optional; omitting it allows you to index matching events from all contracts.
97
97
98
98
- `dataSources.source.startBlock`: the optional number of the block that the data source starts indexing from. In most cases, we suggest using the block in which the contract was created.
99
99
@@ -109,7 +109,7 @@ The important entries to update for the manifest are:
109
109
110
110
- `dataSources.mapping.callHandlers`: lists the smart contract functions this Subgraph reacts to and handlers in the mapping that transform the inputs and outputs to function calls into entities in the store.
111
111
112
-
- `dataSources.mapping.blockHandlers`: lists the blocks this Subgraph reacts to and handlers in the mapping to run when a block is appended to the chain. Without a filter, the block handler will be run every block. An optional call-filter can be provided by adding a `filter` field with `kind: call` to the handler. This will only run the handler if the block contains at least one call to the data source contract.
112
+
- `dataSources.mapping.blockHandlers`: lists the blocks this Subgraph reacts to and handlers in the mapping to run when a block is appended to the chain. Without a filter, the block handler will be run on every block. An optional call-filter can be provided by adding a `filter` field with `kind: call` to the handler. This will only run the handler if the block contains at least one call to the data source contract.
113
113
114
114
A single Subgraph can index data from multiple smart contracts. Add an entry for each contract from which data needs to be indexed to the `dataSources` array.
115
115
@@ -153,7 +153,7 @@ While events provide an effective way to collect relevant changes to the state o
153
153
154
154
Call handlers will only trigger in one of two cases: when the function specified is called by an account other than the contract itself or when it is marked as external in Solidity and called as part of another function in the same contract.
155
155
156
-
> **Note:** Call handlers currently depend on the Parity tracing API. Certain networks, such as BNB chain and Arbitrum, does not support this API. If a Subgraph indexing one of these networks contain one or more call handlers, it will not start syncing. Subgraph developers should instead use event handlers. These are far more performant than call handlers, and are supported on every evm network.
156
+
> **Note:** Call handlers currently depend on the Parity tracing API. Certain networks, such as BNB chain and Arbitrum, do not support this API. If a Subgraph indexing one of these networks contains one or more call handlers, it will not start syncing. Subgraph developers should instead use event handlers. These are far more performant than call handlers, and are supported on every evm network.
157
157
158
158
### Defining a Call Handler
159
159
@@ -218,7 +218,7 @@ filter:
218
218
219
219
_The defined handler will be called once for every block which contains a call to the contract (data source) the handler is defined under._
220
220
221
-
> **Note:** The `call` filter currently depend on the Parity tracing API. Certain networks, such as BNB chain and Arbitrum, does not support this API. If a Subgraph indexing one of these networks contain one or more block handlers with a `call` filter, it will not start syncing.
221
+
> **Note:** The `call` filter currently depends on the Parity tracing API. Certain networks, such as BNB chain and Arbitrum, do not support this API. If a Subgraph indexing one of these networks contains one or more block handlers with a `call` filter, it will not start syncing.
222
222
223
223
The absence of a filter for a block handler will ensure that the handler is called every block. A data source can only contain one block handler for each filter type.
Copy file name to clipboardExpand all lines: website/src/pages/en/subgraphs/querying/graph-client/architecture.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ To address the need to support a distributed network, we plan to take several ac
5
5
1. Compose multiple Subgraphs (on the client-side)
6
6
2. Fallback to multiple indexers/sources/hosted services
7
7
3. Automatic/Manual source picking strategy
8
-
4. Agnostic core, with the ability to run integrate with any GraphQL client
8
+
4. Agnostic core, with the ability to integrate with any GraphQL client
9
9
10
10
## Standalone mode
11
11
@@ -44,7 +44,7 @@ graph LR;
44
44
45
45
## Subgraph Execution Strategies
46
46
47
-
Within every Subgraph defined as source, there will be a way to define it's source(s) indexer and the querying strategy, here are a few options:
47
+
Within every Subgraph defined as source, there will be a way to define its source(s) indexer and the querying strategy, here are a few options:
48
48
49
49
```mermaid
50
50
graph LR;
@@ -85,7 +85,7 @@ graph LR;
85
85
end
86
86
```
87
87
88
-
> We can ship a several built-in strategies, along with a simple interfaces to allow developers to write their own.
88
+
> We can ship several built-in strategies, along with a simple interface to allow developers to write their own.
89
89
90
90
To take the concept of strategies to the extreme, we can even build a magical layer that does subscription-as-query, with any hook, and provide a smooth DX for dapps:
Since the entire network layer (along with the `@live` mechanism) is implemented inside `graph-client` core, you can use Live queries with every GraphQL client (such as Urql or Apollo-Client), as long as it supports streame responses (`AsyncIterable`).
41
+
Since the entire network layer (along with the `@live` mechanism) is implemented inside `graph-client` core, you can use Live queries with every GraphQL client (such as Urql or Apollo-Client), as long as it supports streamed responses (`AsyncIterable`).
42
42
43
43
No additional setup is required for GraphQL clients cache updates.
0 commit comments