mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-11 18:24:05 +00:00
Support basic array return types of contract methods in codegen (#363)
* Fix ValueTransformers to check for undefined value * Create Result types if needed * Update codegen to include array return type queries in schema * Update codegen to include array return type queries in resolvers * Update codegen to include array return type queries in indexers * Codegen skip db caching methods for queries returning unhandled types * Codegen handle bigint array in indexer * Update codegen to handle basic array types * Remove redundant code and refactor * Codegen map Solidity types directly to GraphQL types * Codegen get TS from GQL types * Codegen handle ethers BigNumber array in indexer template * Fix GQL type returned in client queries * Codegen unused method isElementaryType should not be exported * Codegen update README with solc version in config * Codegen update README with continue-on-error flag * Codegen add continue-on-error flag for storage mode * Codegen generate gitignore and license for watchers * Codegen refactor gitignore and license generation utils --------- Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
This commit is contained in:
@@ -52,6 +52,10 @@ Steps:
|
||||
# Watcher server port (default: 3008).
|
||||
port: 3008
|
||||
|
||||
# Solc version to use (optional)
|
||||
# If not defined, uses solc version listed in dependencies
|
||||
solc: v0.8.0+commit.c7dfd78e
|
||||
|
||||
# Flatten the input contract file(s) [true | false] (default: true).
|
||||
flatten: true
|
||||
|
||||
@@ -72,6 +76,8 @@ Steps:
|
||||
|
||||
* `config-file`(alias: `c`): Watcher generation config file path (yaml) (required).
|
||||
|
||||
* `continue-on-error` (alias: `e`): To continue generation if any unhandled data type is encountered (optional).
|
||||
|
||||
Example:
|
||||
|
||||
* Generate code using a config file `config.yaml`:
|
||||
@@ -80,6 +86,12 @@ Steps:
|
||||
yarn codegen --config-file ./config.yaml
|
||||
```
|
||||
|
||||
* Generate code ignoring any unhandled data types:
|
||||
|
||||
```bash
|
||||
yarn codegen --config-file ./config.yaml --continue-on-error
|
||||
```
|
||||
|
||||
This will create a folder containing the generated code at the path provided in config. Follow the steps in [Run Generated Watcher](#run-generated-watcher) to setup and run the generated watcher.
|
||||
|
||||
## Development
|
||||
|
||||
Reference in New Issue
Block a user