Hacker News new | ask | show | jobs
by MaknMoreGtnLess 1599 days ago
> JSON schema and protobuf didn't feel elegant and were too verbose so I thought why not GraphQL

2 questions:

1. Are there tools out there that can translate between GraphQL schema, JSON schema and protobuf?

2. How would you version events

1 comments

1. Not sure. I'm sure you can find something but not that I know of. Sounds like something that should exist. 2. I think of versioning as a two way process (at least for internal APIs): adding fields and removing fields. Removing fields could break your client but that's where the awesomeness of GraphQL shines. You know all the fields that are being consumed by your consumer so you can safely remove fields that are not being consumed. You can also mark fields as deprecated and this library logs a warning whenever a consumer is using that field. This property of explicitly asking for fields does not exist for protobuf so it's very difficult to remove fields.

More on this here: https://graphql-eventbus.vercel.app/docs/principles/thinking...

hope it makes sense!