forked from enisdenjo/graphql-ws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): Use
fastify-websocket
(enisdenjo#200)
- Loading branch information
Showing
9 changed files
with
729 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[graphql-ws](../README.md) / [use/fastify-websocket](../modules/use_fastify_websocket.md) / Extra | ||
|
||
# Interface: Extra | ||
|
||
[use/fastify-websocket](../modules/use_fastify_websocket.md).Extra | ||
|
||
The extra that will be put in the `Context`. | ||
|
||
## Table of contents | ||
|
||
### Properties | ||
|
||
- [connection](use_fastify_websocket.extra.md#connection) | ||
- [request](use_fastify_websocket.extra.md#request) | ||
|
||
## Properties | ||
|
||
### connection | ||
|
||
• `Readonly` **connection**: `SocketStream` | ||
|
||
The underlying socket connection between the server and the client. | ||
The WebSocket socket is located under the `socket` parameter. | ||
|
||
___ | ||
|
||
### request | ||
|
||
• `Readonly` **request**: `FastifyRequest`<RouteGenericInterface, Server, IncomingMessage\> | ||
|
||
The initial HTTP upgrade request before the actual | ||
socket and connection is established. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[graphql-ws](../README.md) / use/fastify-websocket | ||
|
||
# Module: use/fastify-websocket | ||
|
||
## Table of contents | ||
|
||
### Interfaces | ||
|
||
- [Extra](../interfaces/use_fastify_websocket.extra.md) | ||
|
||
### Functions | ||
|
||
- [makeHandler](use_fastify_websocket.md#makehandler) | ||
|
||
## Server/fastify-websocket | ||
|
||
### makeHandler | ||
|
||
▸ **makeHandler**<E\>(`options`, `keepAlive?`): `fastifyWebsocket.WebsocketHandler` | ||
|
||
Make a handler to use on a [fastify-websocket](https://github.com/fastify/fastify-websocket) route. | ||
This is a basic starter, feel free to copy the code over and adjust it to your needs | ||
|
||
#### Type parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `E` | `E`: `Record`<PropertyKey, unknown\> = `Record`<PropertyKey, never\> | | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `options` | [ServerOptions](../interfaces/server.serveroptions.md)<[Extra](../interfaces/use_fastify_websocket.extra.md) & `Partial`<E\>\> | | ||
| `keepAlive` | `number` | | ||
|
||
#### Returns | ||
|
||
`fastifyWebsocket.WebsocketHandler` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.