Skip to content

Commit

Permalink
tiny edits
Browse files Browse the repository at this point in the history
  • Loading branch information
idalithb committed Sep 10, 2024
1 parent baa3b10 commit 93d97b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/pages/en/developing/creating-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ graph init \
The following command initializes a new project from an example subgraph:

```sh
--studio <SUBGRAPH_SLUG> --from-example=example-subgraph
graph init--studio <SUBGRAPH_SLUG> --from-example=example-subgraph
```

- The [example subgraph](https://github.com/graphprotocol/example-subgraph) is based on the Gravity contract by Dani Grant, which manages user avatars and emits `NewGravatar` or `UpdateGravatar` events whenever avatars are created or updated.

- The subgraph handles these events by writing `Gravatar` entities to the Graph Node store and ensuring these are updated according to the events.

### Add new `dataSources` to an existing subgraph
## Add new `dataSources` to an existing subgraph

Since `v0.31.0`, the Graph CLI supports adding new `dataSources` to an existing subgraph through the `graph add` command:

Expand All @@ -88,9 +88,9 @@ Options:
--network-file <path> Networks config file path (default: "./networks.json")
```

#### Specifics
### Specifics

The `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.
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.

- The `--merge-entities` option identifies how the developer would like to handle `entity` and `event` name conflicts:

Expand Down

0 comments on commit 93d97b9

Please sign in to comment.