# GraphQL over WebSocket > graphql-ws is the reference implementation of the GraphQL over WebSocket protocol: a zero-dependency server and client for queries, mutations and subscriptions over WebSocket, with adapters for ws, uWebSockets.js, Fastify, Bun, Deno and crossws. ## Guides - [Get Started](https://the-guild.dev/graphql/ws/guides.md): Install graphql-ws, start a spec-compliant GraphQL over WebSocket server with ws, uWebSockets.js, Fastify, Bun, Deno or crossws, and connect a client. - [Recipes](https://the-guild.dev/graphql/ws/guides/recipes.md): Short, copy-paste code snippets for common graphql-ws client and server use cases, from Relay and Apollo integrations to auth, pings and persisted queries. ## API Reference - [Overview](https://the-guild.dev/graphql/ws/docs.md): Every module, function, class, interface and type exported by graphql-ws, generated from the source. - [client](https://the-guild.dev/graphql/ws/docs/client.md): Everything exported by graphql-ws/client: functions, classes, interfaces and types, with links to each. - [TerminatedCloseEvent](https://the-guild.dev/graphql/ws/docs/client/classes/TerminatedCloseEvent.md): TerminatedCloseEvent (graphql-ws/client): A synthetic close event 4499: Terminated is issued to the current to immediately - [createClient](https://the-guild.dev/graphql/ws/docs/client/functions/createClient.md): createClient (graphql-ws/client): Creates a disposable GraphQL over WebSocket client. - [Client](https://the-guild.dev/graphql/ws/docs/client/interfaces/Client.md): Client (graphql-ws/client): Dispose of the instance and clear up resources. - [ClientOptions](https://the-guild.dev/graphql/ws/docs/client/interfaces/ClientOptions.md): ClientOptions (graphql-ws/client): Configuration used for the GraphQL over WebSocket client. - [Event](https://the-guild.dev/graphql/ws/docs/client/type-aliases/Event.md): Event (graphql-ws/client): All events that could occur. - [EventClosed](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventClosed.md): EventClosed (graphql-ws/client): WebSocket connection has closed. - [EventClosedListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventClosedListener.md): EventClosedListener (graphql-ws/client): The argument is actually the websocket CloseEvent, but to avoid - [EventConnected](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventConnected.md): EventConnected (graphql-ws/client): Open WebSocket connection has been acknowledged. - [EventConnectedListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventConnectedListener.md): EventConnectedListener (graphql-ws/client): The first argument is actually the WebSocket, but to avoid - [EventConnecting](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventConnecting.md): EventConnecting (graphql-ws/client): WebSocket started connecting. - [EventConnectingListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventConnectingListener.md): EventConnectingListener, exported by graphql-ws/client. - [EventError](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventError.md): EventError (graphql-ws/client): WebSocket connection had an error or client had an internal error. - [EventErrorListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventErrorListener.md): EventErrorListener (graphql-ws/client): Events dispatched from the WebSocket onerror are handled in this listener, - [EventListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventListener.md): EventListener, exported by graphql-ws/client. - [EventMessage](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventMessage.md): EventMessage (graphql-ws/client): A message has been received. - [EventMessageListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventMessageListener.md): EventMessageListener (graphql-ws/client): Called for all valid messages received by the client. Mainly useful for - [EventOpened](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventOpened.md): EventOpened (graphql-ws/client): WebSocket has opened. - [EventOpenedListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventOpenedListener.md): EventOpenedListener (graphql-ws/client): The first argument is actually the WebSocket, but to avoid - [EventPing](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventPing.md): EventPing, exported by graphql-ws/client. - [EventPingListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventPingListener.md): EventPingListener (graphql-ws/client): The first argument communicates whether the ping was received from the server. - [EventPong](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventPong.md): EventPong, exported by graphql-ws/client. - [EventPongListener](https://the-guild.dev/graphql/ws/docs/client/type-aliases/EventPongListener.md): EventPongListener (graphql-ws/client): The first argument communicates whether the pong was received from the server. - [common](https://the-guild.dev/graphql/ws/docs/common.md): Everything exported by graphql-ws/common: functions, classes, interfaces and types, with links to each. - [CloseCode](https://the-guild.dev/graphql/ws/docs/common/enumerations/CloseCode.md): CloseCode (graphql-ws/common): Subscriber distinction is very important - [MessageType](https://the-guild.dev/graphql/ws/docs/common/enumerations/MessageType.md): MessageType (graphql-ws/common): Types of messages allowed to be sent by the client/server over the WS protocol. - [parseMessage](https://the-guild.dev/graphql/ws/docs/common/functions/parseMessage.md): parseMessage (graphql-ws/common): Parses the raw websocket message data to a valid message. - [stringifyMessage](https://the-guild.dev/graphql/ws/docs/common/functions/stringifyMessage.md): stringifyMessage (graphql-ws/common): Stringifies a valid message ready to be sent through the socket. - [validateMessage](https://the-guild.dev/graphql/ws/docs/common/functions/validateMessage.md): validateMessage (graphql-ws/common): Validates the message against the GraphQL over WebSocket Protocol. - [CompleteMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/CompleteMessage.md): CompleteMessage, exported by graphql-ws/common. - [ConnectionAckMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/ConnectionAckMessage.md): ConnectionAckMessage, exported by graphql-ws/common. - [ConnectionInitMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/ConnectionInitMessage.md): ConnectionInitMessage, exported by graphql-ws/common. - [Disposable](https://the-guild.dev/graphql/ws/docs/common/interfaces/Disposable.md): Disposable (graphql-ws/common): Dispose of the instance and clear up resources. - [ErrorMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/ErrorMessage.md): ErrorMessage, exported by graphql-ws/common. - [ExecutionResult](https://the-guild.dev/graphql/ws/docs/common/interfaces/ExecutionResult.md): ExecutionResult, exported by graphql-ws/common. - [FormattedExecutionResult](https://the-guild.dev/graphql/ws/docs/common/interfaces/FormattedExecutionResult.md): FormattedExecutionResult, exported by graphql-ws/common. - [NextMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/NextMessage.md): NextMessage, exported by graphql-ws/common. - [PingMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/PingMessage.md): PingMessage, exported by graphql-ws/common. - [PongMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/PongMessage.md): PongMessage, exported by graphql-ws/common. - [Sink](https://the-guild.dev/graphql/ws/docs/common/interfaces/Sink.md): Sink (graphql-ws/common): A representation of any set of values over any amount of time. - [SubscribeMessage](https://the-guild.dev/graphql/ws/docs/common/interfaces/SubscribeMessage.md): SubscribeMessage, exported by graphql-ws/common. - [SubscribePayload](https://the-guild.dev/graphql/ws/docs/common/interfaces/SubscribePayload.md): SubscribePayload, exported by graphql-ws/common. - [ID](https://the-guild.dev/graphql/ws/docs/common/type-aliases/ID.md): ID (graphql-ws/common): ID is a string type alias representing - [JSONMessageReplacer](https://the-guild.dev/graphql/ws/docs/common/type-aliases/JSONMessageReplacer.md): JSONMessageReplacer (graphql-ws/common): Function that allows customization of the produced JSON string - [JSONMessageReviver](https://the-guild.dev/graphql/ws/docs/common/type-aliases/JSONMessageReviver.md): JSONMessageReviver (graphql-ws/common): Function for transforming values within a message during JSON parsing - [Message](https://the-guild.dev/graphql/ws/docs/common/type-aliases/Message.md): Message, exported by graphql-ws/common. - [GRAPHQL_TRANSPORT_WS_PROTOCOL](https://the-guild.dev/graphql/ws/docs/common/variables/GRAPHQL_TRANSPORT_WS_PROTOCOL.md): GRAPHQL_TRANSPORT_WS_PROTOCOL (graphql-ws/common): The WebSocket sub-protocol used for the GraphQL over WebSocket Protocol. - [server](https://the-guild.dev/graphql/ws/docs/server.md): Everything exported by graphql-ws/server: functions, classes, interfaces and types, with links to each. - [handleProtocols](https://the-guild.dev/graphql/ws/docs/server/functions/handleProtocols.md): handleProtocols (graphql-ws/server): Helper utility for choosing the "graphql-transport-ws" subprotocol from - [makeServer](https://the-guild.dev/graphql/ws/docs/server/functions/makeServer.md): makeServer (graphql-ws/server): Makes a Protocol compliant WebSocket GraphQL server. The server - [Context](https://the-guild.dev/graphql/ws/docs/server/interfaces/Context.md): Context (graphql-ws/server): Indicates that the connection was acknowledged - [Server](https://the-guild.dev/graphql/ws/docs/server/interfaces/Server.md): Server (graphql-ws/server): New socket has been established. The lib will validate - [ServerOptions](https://the-guild.dev/graphql/ws/docs/server/interfaces/ServerOptions.md): ServerOptions (graphql-ws/server): The amount of time for which the server will wait - [WebSocket](https://the-guild.dev/graphql/ws/docs/server/interfaces/WebSocket.md): WebSocket (graphql-ws/server): The subprotocol of the WebSocket. Will be used - [GraphQLExecutionContextValue](https://the-guild.dev/graphql/ws/docs/server/type-aliases/GraphQLExecutionContextValue.md): GraphQLExecutionContextValue (graphql-ws/server): A concrete GraphQL execution context value type. - [OperationResult](https://the-guild.dev/graphql/ws/docs/server/type-aliases/OperationResult.md): OperationResult, exported by graphql-ws/server. - [websocket](https://the-guild.dev/graphql/ws/docs/use/@fastify/websocket.md): Everything exported by graphql-ws/use/@fastify/websocket: functions, classes, interfaces and types, with links to each. - [makeHandler](https://the-guild.dev/graphql/ws/docs/use/@fastify/websocket/functions/makeHandler.md): makeHandler (graphql-ws/use/@fastify/websocket): Make a handler to use on a @fastify/websocket route. - [Extra](https://the-guild.dev/graphql/ws/docs/use/@fastify/websocket/interfaces/Extra.md): Extra (graphql-ws/use/@fastify/websocket): The extra that will be put in the Context. - [bun](https://the-guild.dev/graphql/ws/docs/use/bun.md): Everything exported by graphql-ws/use/bun: functions, classes, interfaces and types, with links to each. - [makeHandler](https://the-guild.dev/graphql/ws/docs/use/bun/functions/makeHandler.md): makeHandler (graphql-ws/use/bun): Use the server with Bun. - [Extra](https://the-guild.dev/graphql/ws/docs/use/bun/interfaces/Extra.md): Extra (graphql-ws/use/bun): The extra that will be put in the Context. - [crossws](https://the-guild.dev/graphql/ws/docs/use/crossws.md): Everything exported by graphql-ws/use/crossws: functions, classes, interfaces and types, with links to each. - [makeHooks](https://the-guild.dev/graphql/ws/docs/use/crossws/functions/makeHooks.md): makeHooks, exported by graphql-ws/use/crossws. - [Extra](https://the-guild.dev/graphql/ws/docs/use/crossws/interfaces/Extra.md): Extra (graphql-ws/use/crossws): The extra that will be put in the Context. - [deno](https://the-guild.dev/graphql/ws/docs/use/deno.md): Everything exported by graphql-ws/use/deno: functions, classes, interfaces and types, with links to each. - [makeHandler](https://the-guild.dev/graphql/ws/docs/use/deno/functions/makeHandler.md): makeHandler (graphql-ws/use/deno): Use the server with Deno. - [Extra](https://the-guild.dev/graphql/ws/docs/use/deno/interfaces/Extra.md): Extra (graphql-ws/use/deno): The extra that will be put in the Context. - [uWebSockets](https://the-guild.dev/graphql/ws/docs/use/uWebSockets.md): Everything exported by graphql-ws/use/uWebSockets: functions, classes, interfaces and types, with links to each. - [makeBehavior](https://the-guild.dev/graphql/ws/docs/use/uWebSockets/functions/makeBehavior.md): makeBehavior (graphql-ws/use/uWebSockets): Make the behaviour for using a uWebSockets.js WebSocket server. - [Extra](https://the-guild.dev/graphql/ws/docs/use/uWebSockets/interfaces/Extra.md): Extra (graphql-ws/use/uWebSockets): The extra that will be put in the Context. - [PersistedRequest](https://the-guild.dev/graphql/ws/docs/use/uWebSockets/interfaces/PersistedRequest.md): PersistedRequest (graphql-ws/use/uWebSockets): The initial HTTP upgrade request before the actual - [UpgradeData](https://the-guild.dev/graphql/ws/docs/use/uWebSockets/interfaces/UpgradeData.md): UpgradeData (graphql-ws/use/uWebSockets): Data acquired during the HTTP upgrade callback from uWS. - [ws](https://the-guild.dev/graphql/ws/docs/use/ws.md): Everything exported by graphql-ws/use/ws: functions, classes, interfaces and types, with links to each. - [useServer](https://the-guild.dev/graphql/ws/docs/use/ws/functions/useServer.md): useServer (graphql-ws/use/ws): Use the server on a ws ws server. - [Extra](https://the-guild.dev/graphql/ws/docs/use/ws/interfaces/Extra.md): Extra (graphql-ws/use/ws): The extra that will be put in the Context. ## Changelog