|
10 | 10 | - [context](ServerArgs.md#context) |
11 | 11 | - [dynamodb](ServerArgs.md#dynamodb) |
12 | 12 | - [log](ServerArgs.md#log) |
13 | | -- [pingpong](ServerArgs.md#pingpong) |
14 | | -- [schema](ServerArgs.md#schema) |
15 | | -- [tableNames](ServerArgs.md#tablenames) |
16 | | - |
17 | | -### Methods |
18 | | - |
19 | 13 | - [onConnect](ServerArgs.md#onconnect) |
20 | 14 | - [onConnectionInit](ServerArgs.md#onconnectioninit) |
21 | 15 | - [onDisconnect](ServerArgs.md#ondisconnect) |
22 | 16 | - [onError](ServerArgs.md#onerror) |
23 | 17 | - [onPing](ServerArgs.md#onping) |
24 | 18 | - [onPong](ServerArgs.md#onpong) |
| 19 | +- [pingpong](ServerArgs.md#pingpong) |
| 20 | +- [schema](ServerArgs.md#schema) |
| 21 | +- [tableNames](ServerArgs.md#tablenames) |
25 | 22 |
|
26 | 23 | ## Properties |
27 | 24 |
|
@@ -55,139 +52,163 @@ Defaults to debug('graphql-lambda-subscriptions') from https://www.npmjs.com/pac |
55 | 52 |
|
56 | 53 | ___ |
57 | 54 |
|
58 | | -### pingpong |
59 | | - |
60 | | -• `Optional` **pingpong**: [`MaybePromise`](../README.md#maybepromise)<{ `delay`: `number` ; `machine`: `string` ; `timeout`: `number` }\> |
61 | | - |
62 | | -If set you can use the `stepFunctionsHandler` and a step function to setup a per connection ping/pong cycle to detect disconnects sooner than the 10 minute idle timeout. |
63 | | - |
64 | | -___ |
65 | | - |
66 | | -### schema |
67 | | - |
68 | | -• **schema**: `GraphQLSchema` |
69 | | - |
70 | | -A GraphQL Schema with resolvers |
71 | | - |
72 | | -You can use `makeExecutableSchema` from [`@graphql-tools/schema`](https://www.npmjs.com/package/@graphql-tools/schema), or `makeSchema` from [`nexus`](https://nexusjs.org/) |
73 | | - |
74 | | -```ts |
75 | | -import { makeExecutableSchema } from '@graphql-tools/schema |
76 | | -// or |
77 | | -import { makeSchema } from 'nexus' |
78 | | -``` |
79 | | - |
80 | | -___ |
81 | | - |
82 | | -### tableNames |
83 | | - |
84 | | -• `Optional` **tableNames**: [`MaybePromise`](../README.md#maybepromise)<{ `connections?`: `string` ; `subscriptions?`: `string` }\> |
85 | | - |
86 | | -An optional object or a promise for an object with DDB table names. |
87 | | - |
88 | | -Defaults to `{ connections: 'graphql_connections', subscriptions: 'graphql_subscriptions' }` |
| 55 | +### onConnect |
89 | 56 |
|
90 | | -## Methods |
| 57 | +• `Optional` **onConnect**: (`e`: { `event`: [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) }) => [`MaybePromise`](../README.md#maybepromise)<`void`\> |
91 | 58 |
|
92 | | -### onConnect |
| 59 | +#### Type declaration |
93 | 60 |
|
94 | | -▸ `Optional` **onConnect**(`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 61 | +▸ (`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
95 | 62 |
|
96 | | -#### Parameters |
| 63 | +##### Parameters |
97 | 64 |
|
98 | 65 | | Name | Type | |
99 | 66 | | :------ | :------ | |
100 | 67 | | `e` | `Object` | |
101 | 68 | | `e.event` | [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) | |
102 | 69 |
|
103 | | -#### Returns |
| 70 | +##### Returns |
104 | 71 |
|
105 | 72 | [`MaybePromise`](../README.md#maybepromise)<`void`\> |
106 | 73 |
|
107 | 74 | ___ |
108 | 75 |
|
109 | 76 | ### onConnectionInit |
110 | 77 |
|
111 | | -▸ `Optional` **onConnectionInit**(`e`): [`MaybePromise`](../README.md#maybepromise)<`Record`<`string`, `any`\>\> |
| 78 | +• `Optional` **onConnectionInit**: (`e`: { `event`: [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) ; `message`: `ConnectionInitMessage` }) => [`MaybePromise`](../README.md#maybepromise)<`Record`<`string`, `any`\>\> |
| 79 | + |
| 80 | +#### Type declaration |
| 81 | + |
| 82 | +▸ (`e`): [`MaybePromise`](../README.md#maybepromise)<`Record`<`string`, `any`\>\> |
112 | 83 |
|
113 | | -#### Parameters |
| 84 | +##### Parameters |
114 | 85 |
|
115 | 86 | | Name | Type | |
116 | 87 | | :------ | :------ | |
117 | 88 | | `e` | `Object` | |
118 | 89 | | `e.event` | [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) | |
119 | 90 | | `e.message` | `ConnectionInitMessage` | |
120 | 91 |
|
121 | | -#### Returns |
| 92 | +##### Returns |
122 | 93 |
|
123 | 94 | [`MaybePromise`](../README.md#maybepromise)<`Record`<`string`, `any`\>\> |
124 | 95 |
|
125 | 96 | ___ |
126 | 97 |
|
127 | 98 | ### onDisconnect |
128 | 99 |
|
129 | | -▸ `Optional` **onDisconnect**(`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 100 | +• `Optional` **onDisconnect**: (`e`: { `event`: [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) }) => [`MaybePromise`](../README.md#maybepromise)<`void`\> |
130 | 101 |
|
131 | | -#### Parameters |
| 102 | +#### Type declaration |
| 103 | + |
| 104 | +▸ (`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 105 | + |
| 106 | +##### Parameters |
132 | 107 |
|
133 | 108 | | Name | Type | |
134 | 109 | | :------ | :------ | |
135 | 110 | | `e` | `Object` | |
136 | 111 | | `e.event` | [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) | |
137 | 112 |
|
138 | | -#### Returns |
| 113 | +##### Returns |
139 | 114 |
|
140 | 115 | [`MaybePromise`](../README.md#maybepromise)<`void`\> |
141 | 116 |
|
142 | 117 | ___ |
143 | 118 |
|
144 | 119 | ### onError |
145 | 120 |
|
146 | | -▸ `Optional` **onError**(`error`, `context`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 121 | +• `Optional` **onError**: (`error`: `any`, `context`: `any`) => [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 122 | + |
| 123 | +#### Type declaration |
147 | 124 |
|
148 | | -#### Parameters |
| 125 | +▸ (`error`, `context`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 126 | + |
| 127 | +##### Parameters |
149 | 128 |
|
150 | 129 | | Name | Type | |
151 | 130 | | :------ | :------ | |
152 | 131 | | `error` | `any` | |
153 | 132 | | `context` | `any` | |
154 | 133 |
|
155 | | -#### Returns |
| 134 | +##### Returns |
156 | 135 |
|
157 | 136 | [`MaybePromise`](../README.md#maybepromise)<`void`\> |
158 | 137 |
|
159 | 138 | ___ |
160 | 139 |
|
161 | 140 | ### onPing |
162 | 141 |
|
163 | | -▸ `Optional` **onPing**(`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 142 | +• `Optional` **onPing**: (`e`: { `event`: [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) ; `message`: `PingMessage` }) => [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 143 | + |
| 144 | +#### Type declaration |
| 145 | + |
| 146 | +▸ (`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
164 | 147 |
|
165 | | -#### Parameters |
| 148 | +##### Parameters |
166 | 149 |
|
167 | 150 | | Name | Type | |
168 | 151 | | :------ | :------ | |
169 | 152 | | `e` | `Object` | |
170 | 153 | | `e.event` | [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) | |
171 | 154 | | `e.message` | `PingMessage` | |
172 | 155 |
|
173 | | -#### Returns |
| 156 | +##### Returns |
174 | 157 |
|
175 | 158 | [`MaybePromise`](../README.md#maybepromise)<`void`\> |
176 | 159 |
|
177 | 160 | ___ |
178 | 161 |
|
179 | 162 | ### onPong |
180 | 163 |
|
181 | | -▸ `Optional` **onPong**(`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 164 | +• `Optional` **onPong**: (`e`: { `event`: [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) ; `message`: `PongMessage` }) => [`MaybePromise`](../README.md#maybepromise)<`void`\> |
182 | 165 |
|
183 | | -#### Parameters |
| 166 | +#### Type declaration |
| 167 | + |
| 168 | +▸ (`e`): [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 169 | + |
| 170 | +##### Parameters |
184 | 171 |
|
185 | 172 | | Name | Type | |
186 | 173 | | :------ | :------ | |
187 | 174 | | `e` | `Object` | |
188 | 175 | | `e.event` | [`APIGatewayWebSocketEvent`](APIGatewayWebSocketEvent.md) | |
189 | 176 | | `e.message` | `PongMessage` | |
190 | 177 |
|
191 | | -#### Returns |
| 178 | +##### Returns |
192 | 179 |
|
193 | 180 | [`MaybePromise`](../README.md#maybepromise)<`void`\> |
| 181 | + |
| 182 | +___ |
| 183 | + |
| 184 | +### pingpong |
| 185 | + |
| 186 | +• `Optional` **pingpong**: [`MaybePromise`](../README.md#maybepromise)<{ `delay`: `number` ; `machine`: `string` ; `timeout`: `number` }\> |
| 187 | + |
| 188 | +If set you can use the `stepFunctionsHandler` and a step function to setup a per connection ping/pong cycle to detect disconnects sooner than the 10 minute idle timeout. |
| 189 | + |
| 190 | +___ |
| 191 | + |
| 192 | +### schema |
| 193 | + |
| 194 | +• **schema**: `GraphQLSchema` |
| 195 | + |
| 196 | +A GraphQL Schema with resolvers |
| 197 | + |
| 198 | +You can use `makeExecutableSchema` from [`@graphql-tools/schema`](https://www.npmjs.com/package/@graphql-tools/schema), or `makeSchema` from [`nexus`](https://nexusjs.org/) |
| 199 | + |
| 200 | +```ts |
| 201 | +import { makeExecutableSchema } from '@graphql-tools/schema |
| 202 | +// or |
| 203 | +import { makeSchema } from 'nexus' |
| 204 | +``` |
| 205 | + |
| 206 | +___ |
| 207 | + |
| 208 | +### tableNames |
| 209 | + |
| 210 | +• `Optional` **tableNames**: [`MaybePromise`](../README.md#maybepromise)<{ `connections?`: `string` ; `subscriptions?`: `string` }\> |
| 211 | + |
| 212 | +An optional object or a promise for an object with DDB table names. |
| 213 | + |
| 214 | +Defaults to `{ connections: 'graphql_connections', subscriptions: 'graphql_subscriptions' }` |
0 commit comments