Skip to content

Commit bf65e75

Browse files
Docs/patch 2 (#1003)
* 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
1 parent e27eff8 commit bf65e75

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

website/src/pages/en/subgraphs/developing/creating/advanced.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Advanced Subgraph Features
44

55
## Overview
66

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.
88

99
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:
1010

website/src/pages/en/subgraphs/developing/creating/graph-ts/api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ As the entity may not exist in the store yet, the `load` method returns a value
270270

271271
> 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.
272272
273-
#### Looking up entities created withing a block
273+
#### Looking up entities created within a block
274274

275275
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.
276276

@@ -496,7 +496,7 @@ export function handleTransfer(event: TransferEvent) {
496496
}
497497
```
498498

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.
500500

501501
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.
502502

website/src/pages/en/subgraphs/developing/creating/install-the-cli.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ graph init <SUBGRAPH_SLUG> --from-example=example-subgraph
6868

6969
`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.
7070

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:
7272

7373
```sh
7474
graph add <address> [<subgraph-manifest default: "./subgraph.yaml">]
@@ -83,7 +83,7 @@ Options:
8383

8484
#### Specifics
8585

86-
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.
8787

8888
- The `--merge-entities` option identifies how the developer would like to handle `entity` and `event` name conflicts:
8989
- If `true`: the new `dataSource` should use existing `eventHandlers` & `entities`.

website/src/pages/en/subgraphs/developing/creating/ql-schema.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Entity fields can be defined as required or optional. Required fields are indica
6262
Null value resolved for non-null field 'name'
6363
```
6464

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!`.
6666

6767
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`.
6868

website/src/pages/en/subgraphs/developing/creating/subgraph-manifest.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The important entries to update for the manifest are:
9393

9494
- `indexerHints.prune`: Defines the retention of historical block data for a Subgraph. See [prune](#prune) in [indexerHints](#indexer-hints) section.
9595

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.
9797

9898
- `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.
9999

@@ -109,7 +109,7 @@ The important entries to update for the manifest are:
109109

110110
- `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.
111111

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.
113113

114114
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.
115115

@@ -153,7 +153,7 @@ While events provide an effective way to collect relevant changes to the state o
153153

154154
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.
155155

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.
157157

158158
### Defining a Call Handler
159159

@@ -218,7 +218,7 @@ filter:
218218

219219
_The defined handler will be called once for every block which contains a call to the contract (data source) the handler is defined under._
220220

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.
222222

223223
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.
224224

website/src/pages/en/subgraphs/querying/graph-client/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ To address the need to support a distributed network, we plan to take several ac
55
1. Compose multiple Subgraphs (on the client-side)
66
2. Fallback to multiple indexers/sources/hosted services
77
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
99

1010
## Standalone mode
1111

@@ -44,7 +44,7 @@ graph LR;
4444

4545
## Subgraph Execution Strategies
4646

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:
4848

4949
```mermaid
5050
graph LR;
@@ -85,7 +85,7 @@ graph LR;
8585
end
8686
```
8787

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.
8989
9090
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:
9191

website/src/pages/en/subgraphs/querying/graph-client/live.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ query ExampleQuery @live(interval: 5000) {
3838

3939
## Integrations
4040

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 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`).
4242

4343
No additional setup is required for GraphQL clients cache updates.

0 commit comments

Comments
 (0)