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
If incorrect parameters are passed to the graph add command it will write these first to the subgraph.yaml before calling the codegen subcommand which will fail.
The subgraph.yaml is then left in an incorrect state and is not able to be loaded (with a second call to graph add for example) as the validate function fails.
Reproduction
cli
Steps to Reproduce the Bug or Issue
init a subgraph
Run graph add <address> --start-block=invalid
Output should be similar to Failed to run codegen: Command failed: yarn codegen
The subgraph.yaml has been updated with the new contract and startBlock value is set to invalid.
Running the command again should lead to this error
Error: Error in subgraph.yaml:
Path: dataSources > X > source > startBlock
Expected BigInt, found string:
invalid
Expected behavior
The command should not modify the original subgraph.yaml if it leaves it in a invalid state.
Screenshots or Videos
No response
Platform
@graphprotocol/* version(s): 0.90.1
Subgraph Manifest
No response
Subgraph GraphQL Schema
No response
Additional context
Possible solutions
Validate all parameters to make sure the values are valid.
Backup the original manifest and restore in case of errors.
The text was updated successfully, but these errors were encountered:
Which packages are impacted by your issue?
@graphprotocol/graph-cli
Describe the issue
If incorrect parameters are passed to the
graph add
command it will write these first to the subgraph.yaml before calling thecodegen
subcommand which will fail.The
subgraph.yaml
is then left in an incorrect state and is not able to be loaded (with a second call tograph add
for example) as thevalidate
function fails.Reproduction
cli
Steps to Reproduce the Bug or Issue
init
a subgraphgraph add <address> --start-block=invalid
Failed to run codegen: Command failed: yarn codegen
subgraph.yaml
has been updated with the new contract andstartBlock
value is set toinvalid
.Expected behavior
The command should not modify the original
subgraph.yaml
if it leaves it in a invalid state.Screenshots or Videos
No response
Platform
@graphprotocol/*
version(s): 0.90.1Subgraph Manifest
No response
Subgraph GraphQL Schema
No response
Additional context
Possible solutions
The text was updated successfully, but these errors were encountered: