Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moonwalker/graphql-nats-subscriptions
A graphql subscriptions implementation using nats and apollo's graphql-subscriptions
https://github.com/moonwalker/graphql-nats-subscriptions
graphql graphql-subscriptions nats
Last synced: 7 days ago
JSON representation
A graphql subscriptions implementation using nats and apollo's graphql-subscriptions
- Host: GitHub
- URL: https://github.com/moonwalker/graphql-nats-subscriptions
- Owner: moonwalker
- License: mit
- Created: 2017-10-26T11:06:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T08:28:50.000Z (7 months ago)
- Last Synced: 2024-11-02T05:33:11.859Z (13 days ago)
- Topics: graphql, graphql-subscriptions, nats
- Language: TypeScript
- Homepage:
- Size: 68.4 KB
- Stars: 30
- Watchers: 4
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# graphql-nats-subscriptions
This package implements the PubSubEngine Interface from the graphql-subscriptions package and also the new AsyncIterator interface. It allows you to connect your subscriptions manger to a nats based Pub Sub mechanism to support multiple subscription manager instances.
## Usage
```javascript
import { NatsPubSub } from '@moonwalker/graphql-nats-subscriptions'const pubsub = new NatsPubSub() // default connecting to nats://localhost:4222
// or
const pubsub = new NatsPubSub({ servers: ['nats://nats.io:4222', 'nats://nats.io:5222', 'nats://nats.io:6222'] })
// or
import * as nats from "nats"const client = nats.connect();
const pubsub = new NatsPubSub({ nc: client })// for more options see: https://github.com/nats-io/node-nats
```