# zox-graphql-ws

> Frontend WeSocket interface for Zox.js GraphQL endpoint

Latest version **1.0.3** (published 2019-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install zox-graphql-ws
pnpm add zox-graphql-ws
yarn add zox-graphql-ws
bun add zox-graphql-ws
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-05-05 |
| First published | 2018-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zoran Ravic |
| Maintainers | zoranravic |
| Keywords | zox, graphql, websocket, ws |

## Links

- npm: https://www.npmjs.com/package/zox-graphql-ws
- Repository: https://github.com/zoxjs/zox-graphql-ws
- Homepage: http://zoxjs.com/docs/graphql-web-socket
- Issues: https://github.com/zoxjs/zox-graphql-ws/issues
- npm.io page: https://npm.io/package/zox-graphql-ws

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-05-05
- 1.0.2 — 2019-04-29
- 1.0.1 — 2018-07-13
- 1.0.0 — 2018-07-11

## README

# Frontend WeSocket interface for Zox.js GraphQL endpoint

Connect using a single line of code.  
WeSocket will auto-reconnect if connection breaks.

```js
const gql = new GraphQLWebSocket();
const gql = new GraphQLWebSocket('ws://localhost:8080/graphql');
```

Subscribe to any number of event feeds.

```js
var sid = gql.subscribe({id:'subscription-id'}, event => console.log(event));
```

Unsubscribe using the returned subscription id.

```js
gql.unsubscribe(sid);
```

Execute Queries and Mutations over the same connection.

```js
gql.query({id:'query-id'}, event => console.log(event));
const event = gql.queryAsync({id:'query-id'});
```

### Options:

```yaml
query: Send raw GraphQL Query
id: Execute a predefined Query by it's ID
op: Operation name - used when the Query contains multiple operations
vars: Variables
```

---
_Source: https://npm.io/package/zox-graphql-ws · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
