GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
Hemera is a small wrapper around the official NATS driver. NATS is a simple, fast and reliable solution for the internal communication of a distributed system.
This demo demonstrate how you can use Hemera for resolving your GraphQL queries. Because of the flexibility of GraphQL you have to deal with many resolvers Hemera can help you to manage this in a very simple and flexible way. Combine GraphQL with the power of pattern matching.
Here you can see a simple example to resolve a graphql query with Hemera. Hemera act as a api gateway to your services. If you want to extend the demo you have to follow some steps:
- Add a GraphQL primitive to the schema.
- Add a resolver bridge to your hemera service.
- Implement your Hemera service resolver.
This demo also provide a sample GraphQL subscription. Subscriptions allows to push messages to the client in realtime. Here you can find some GraphQL queries which can be executed in the playground.
- Downloads NATS
- Start NATS
./gnatsd
- Start the application
npm install
npm start
http://localhost:3000/graphql
http://localhost:3000/graphql