diff --git a/docs/interfaces/client.clientoptions.md b/docs/interfaces/client.clientoptions.md index 88a6d2fc..afdac93d 100644 --- a/docs/interfaces/client.clientoptions.md +++ b/docs/interfaces/client.clientoptions.md @@ -30,7 +30,7 @@ Configuration used for the GraphQL over WebSocket client. ### connectionParams -• `Optional` **connectionParams**: `Record` \| () => `Record` \| `Promise`\> +• `Optional` **connectionParams**: `Record` \| () => `undefined` \| `Record` \| `Promise`\> Optional parameters, passed through the `payload` field with the `ConnectionInit` message, that the client specifies when establishing a connection with the server. You can use this diff --git a/src/client.ts b/src/client.ts index 2275b003..fa3ba518 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,6 +11,7 @@ import { Disposable, Message, MessageType, + ConnectionInitMessage, ConnectionAckMessage, PingMessage, PongMessage, @@ -170,8 +171,10 @@ export interface ClientOptions { * in the close event reason. */ connectionParams?: - | Record - | (() => Promise> | Record); + | ConnectionInitMessage['payload'] + | (() => + | Promise + | ConnectionInitMessage['payload']); /** * Controls when should the connection be established. *