graphprotocol / graph-tooling

Monorepo for various tools used by subgraph developers.
https://thegraph.com/docs
Apache License 2.0
386 stars 208 forks source link

Subgraph validation and normalization #148

Open Jannis opened 6 years ago

Jannis commented 6 years ago

Validation

Normalization

leoyvens commented 6 years ago

The normalization plan is under the assumption that we're going to read a yaml, normalize it, output another yaml and hash that. One thing that would complicate this is supporting subgraph manifests in json format, which would require a step converting the json to yaml. But the other way around of converting yaml to json seems simpler, and json also has the advantage of being easier to put in a canonical shape since it doesn't care about whitespace.

The point is that if we'll support both yaml and json manifests, we should consider having json be the canonical format because it's simpler.

Jannis commented 6 years ago

Agreed! The above doesn't make any assumptions like that though — only the current PR does. But YAML is what we use right now, so it seems appropriate. Plus the logic there should also work for JSON.

leoyvens commented 5 years ago

@Jannis wanna check off all that got done here?

Jannis commented 5 years ago

@leodasvacas Done, I would've forgotten :)