Generate GQL API for subgraph entities and auto-diff based on store set (#38)

* Add subgraph schema types to the generated schema

* Add queries for subgraph entities

* Add entity generation for subgraph entities

* Call subgraph event handler in indexer

* Refactor subgraph schema and entity generation

* Add resolvers generation for subgraph entities

* Get event signature in the event

* Add NonNullType check for field type in entity generation

* Auto-diff based on store set

* Use contract address from data source in loader

* Change subgraph-schema arg to subgraph-path arg
This commit is contained in:
prathamesh0
2021-12-28 16:08:05 +05:30
committed by nabarun
parent 83775608ec
commit 06ba24e38f
35 changed files with 652 additions and 78 deletions
+8 -5
View File
@@ -21,7 +21,7 @@
* Run the following command to generate a watcher from a contract file:
```bash
yarn codegen --input-file <input-file-path> --contract-name <contract-name> --output-folder [output-folder] --mode [eth_call | storage | all] --flatten [true | false] --kind [lazy | active] --port [server-port]
yarn codegen --input-file <input-file-path> --contract-name <contract-name> --output-folder [output-folder] --mode [eth_call | storage | all] --flatten [true | false] --kind [lazy | active] --port [server-port] --subgraph-path [subgraph-build-path]
```
* `input-file`(alias: `i`): Input contract file path or an URL (required).
@@ -31,6 +31,7 @@
* `flatten`(alias: `f`): Flatten the input contract file (default: `true`).
* `kind` (alias: `k`): Kind of watcher (default: `active`).
* `port` (alias: `p`): Server port (default: `3008`).
* `subgraph-path` (alias: `s`): Path to the subgraph build.
**Note**: When passed an *URL* as `input-file`, it is assumed that it points to an already flattened contract file.
@@ -78,12 +79,14 @@
ipfs daemon
```
* In the config file (`environments/local.toml`):
* Update the state checkpoint settings.
* Update the IPFS API address in `environments/local.toml`.
* Create the databases configured in `environments/local.toml`.
* Update the state checkpoint settings in `environments/local.toml`.
* Update the IPFS API address in `environments/local.toml`.
### Customize
* Indexing on an event: