@benzene/ws

Fast, minimal, agnostic GraphQL over WebSockets

Usage no npm install needed!

<script type="module">
  import benzeneWs from 'https://cdn.skypack.dev/@benzene/ws';
</script>

README

@benzene/ws

npm CI codecov PRs Welcome

Fast and simple GraphQL over WebSocket implementing the upcoming GraphQL over WebSocket Protocol.

Installation

npm i graphql @benzene/ws

Usage

import * as WebSocket from "ws";
import { Benzene, makeHandler } from "@benzene/ws";

const GQL = new Benzene({ schema });

const wss = new WebSocket.Server({ path: "/graphql", port: 3000 });
wss.on("connection", makeHandler(GQL, options));

Documentation

Documentation is available at benzene.vercel.app. Check out examples for integrations with different server libraries.