graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

`graph init`: revisit parameters and flow

Open YaroShkvorets opened this issue 11 months ago • 0 comments

There is quite a bit of technical debt with parameter validation. Multiple checks for required/incompatible flags result in spaghetti code and bugs.

Confusing flag combinations result in bad DX, there are a few that no longer needed and can be removed.

Need to streamline and simplify validation and re-evaluate some flags prior to v1 release.

There are 4 ways to init subgraph from command line in non-interactive way:

  • --from-contract
  • --from-example
  • --from-subgraph
  • --spkg
  1. If one of the --from-* flags is specified then all required flags need to accompany it or command should fail.
  2. If --from-* is not specified we follow interactive flow.
  3. Why --spkg? Change to --from-substreams for uniformity
  4. Each --from-* should have its own method with required/incompatible flag checks
  5. Leverage oclif flag validation where possible
  6. Remove --skip-git flag as planned
  7. Remove --protocol flag, since we have that information in the registry.

YaroShkvorets avatar Feb 06 '25 21:02 YaroShkvorets