GraphQL for Event Driven Architecture
Hey guys, I've been working on a GraphQL library for typescript that enables building event driven architecture using GraphQL schema. It can be used to publish and consume events in a type safe way using any message broker (Kafka, .RabbitMQ, PubSub etc). I built this library to scratch my own itch when I was trying to building a type safe event driven communication between microservices: JSON schema and protobuf didn't feel elegant and were too verbose so I thought why not GraphQL. You can read more in my blog post here: https://graphql-eventbus.vercel.app/blog
Youtube Intro Video: https://www.youtube.com/watch?v=XLbShOmkKk0
Github: https://github.com/skk2142/graphql-eventbus
Docs: https://graphql-eventbus.vercel.app/
I'd love to get your feedback!
(
4 comments
| 8 points
| on HN
)
2 questions:
1. Are there tools out there that can translate between GraphQL schema, JSON schema and protobuf?
2. How would you version events
More on this here: https://graphql-eventbus.vercel.app/docs/principles/thinking...
hope it makes sense!
"While cloudevents does have a promising specification, it does not provide any runtime guarantees. It's similar to OpenAPI: a specification that is hard to follow because nothing enforces runtime compliance with the specification. While this specification makes sense for public Event APIs, we believe that GraphQL Eventbus offers a lot more for building your enterprise event bus."
GraphQL eventbus does incorporate some best practices from cloudevents and event architecture in general: it creates an eventID and publish time for each event and propagates metadata like requestId.