Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hemerajs/graphql-hemera
Skeleton (or boilerplate) with Hemera & GraphQL
https://github.com/hemerajs/graphql-hemera
graphql hemera miroservice
Last synced: about 2 months ago
JSON representation
Skeleton (or boilerplate) with Hemera & GraphQL
- Host: GitHub
- URL: https://github.com/hemerajs/graphql-hemera
- Owner: hemerajs
- License: mit
- Created: 2017-01-22T20:19:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-05T20:54:43.000Z (almost 6 years ago)
- Last Synced: 2024-04-14T05:40:32.510Z (9 months ago)
- Topics: graphql, hemera, miroservice
- Language: JavaScript
- Homepage:
- Size: 571 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What is GraphQL?
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.
[![preview](https://github.com/hemerajs/graphql-hemera/blob/master/media/preview.PNG)](http://localhost:3000/graphql)
## What is Hemera?
[Hemera](https://github.com/hemerajs/hemera) is a small wrapper around the official [NATS](https://nats.io/) driver. [NATS](https://nats.io/) is a simple, fast and reliable solution for the internal communication of a distributed system.
## Introduction
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:1. Add a GraphQL primitive to the [schema](/src/graphql/schema.graphql).
2. Add a [resolver](/src/graphql/resolvers.js) bridge to your hemera service.
3. Implement your Hemera service [resolver](/src/plugins/user-management/index.js).This demo also provide a sample GraphQL subscription. Subscriptions allows to push messages to the client in realtime.
[Here](/demo.md) you can find some GraphQL queries which can be executed in the playground.## Getting started
1. [Downloads](https://nats.io/download/) NATS
2. Start NATS `./gnatsd`
3. Start the application
```js
npm install
npm start
```## GraphiQL Dashboard
```
http://localhost:3000/graphql
```## GraphQL endpoint
```
http://localhost:3000/graphql
```