MCPcopy
hub / github.com/enisdenjo/graphql-ws

github.com/enisdenjo/graphql-ws @v6.0.8 sqlite

repository ↗ · DeepWiki ↗ · release v6.0.8 ↗
174 symbols 450 edges 33 files 17 documented · 10%
README

GraphQLOverWebSocket

Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.

graphql-ws

Use Server-Sent Events (SSE) instead? Check out graphql-sse!

Get started

Swiftly start with the get started guide on the website.

Recipes

Short and concise code snippets for starting with common use-cases. Available on the website.

Documentation

Auto-generated by TypeDoc and then rendered on the website.

How does it work?

Read about the exact transport intricacies used by the library in the GraphQL over WebSocket Protocol document.

Want to help?

File a bug, contribute with code, or improve documentation? Read up on our guidelines for contributing and drive development with yarn test --watch away!

Disclaimer

This library and the GraphQL over WebSocket Protocol are not cross-compatible with the deprecated subscriptions-transport-ws and its accompanying Protocol.

You must use graphql-ws coherently and implement the GraphQL over WebSocket Protocol on both sides, server and the client.

Extension points exported contracts — how you extend this code

LikeCloseEvent (Interface)
Minimal close event interface required by the lib for error and socket close handling.
src/client.ts
Disposable (Interface)
(no doc)
src/common.ts
ServerOptions (Interface)
(no doc)
src/server.ts
Extra (Interface)
(no doc)
src/use/crossws.ts
TSubscribe (Interface)
(no doc)
tests/client.test.ts
TClient (Interface)
(no doc)
tests/utils/tclient.ts
ClientOptions (Interface)
(no doc)
src/client.ts
Sink (Interface)
(no doc)
src/common.ts

Core symbols most depended-on inside this repo

stringifyMessage
called by 125
src/common.ts
send
called by 111
tests/utils/tservers.ts
createClient
called by 78
src/client.ts
createTClient
called by 68
tests/utils/tclient.ts
parseMessage
called by 64
src/common.ts
close
called by 43
tests/utils/tservers.ts
createDeferred
called by 33
tests/utils/deferred.ts
close
called by 32
src/server.ts

Shape

Function 110
Interface 36
Method 20
Class 6
Enum 2

Languages

TypeScript100%

Modules by API surface

src/client.ts28 symbols
tests/utils/tservers.ts21 symbols
src/common.ts21 symbols
tests/client.test.ts17 symbols
src/server.ts14 symbols
src/use/uWebSockets.ts12 symbols
tests/server.test.ts11 symbols
tests/fixtures/simple.ts7 symbols
src/use/crossws.ts7 symbols
src/utils.ts6 symbols
src/use/bun.ts6 symbols
website/src/index.tsx5 symbols

Dependencies from manifests, versioned

@changesets/changelog-github0.5.0 · 1×
@changesets/cli2.27.11 · 1×
@fastify/websocket11.0.2 · 1×
@rollup/plugin-terser0.4.4 · 1×
@theguild/algolia2.1.0 · 1×
@theguild/tailwind-config0.4.1 · 1×
@tsconfig/strictest2.0.5 · 1×
@types/glob8.1.0 · 1×
@types/react18.2.79 · 1×
@types/ws8.5.13 · 1×

For agents

$ claude mcp add graphql-ws \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact