graphprotocol / graph-tooling

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

`graph protogen` command #1617

Open saihaj opened 7 months ago

saihaj commented 7 months ago

We also want to add a feature that will generate the protobuf-as types... currently this is either done with https://github.com/gravitational/protobuf-as but its broken atm -- @mangas created a branch that works https://github.com/mangas/protobuf-as Ideally we would have a command in the CLI that was written like this... graph protogen --out=src/pb/ ./proto/*.proto From @kmjones1979 on Slack

joshuanazareth97 commented 6 months ago

Hi @saihaj, with your approval will pick this up next. Can we discuss any potential reasons for choosing protobuf-as vs ts-proto with protoc?

joshuanazareth97 commented 6 months ago

Hey @saihaj, if you have a moment can we discuss me picking this task? Will work on it today / over the weekend and close by Monday if possible. Just wanted to know about protobuf-ts vs ts-proto for the solution.

azf20 commented 6 months ago

thanks so much @joshuanazareth97! @mangas maybe has some context on that?

joshuanazareth97 commented 6 months ago

@mangas any input on using one vs the other?

maoueh commented 6 months ago

We explored this a bit recently, see https://github.com/streamingfast/substreams-sink-examples/pull/4.

The substreams protogen command uses buf to facilitate generation. We also used a different code generator than what was used before.