Skip to content

Commit b84d521

Browse files
committed
Polishing documentation
See gh-608
1 parent 10ea73d commit b84d521

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

spring-graphql-docs/modules/ROOT/pages/client.adoc

+10-4
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,20 @@ existing `WebSocketGraphQlClient` to create a new instance with customized setti
165165
166166
----
167167

168-
If you'd like the client to send regular graphql ping messages to the server, you can add these by adding `keepalive(long seconds)` to the builder
168+
`WebSocketGraphQlClient` supports sending periodic ping messages to keep the connection
169+
active when no other messages are sent or received. You can enable that as follows:
170+
169171
[source,java,indent=0,subs="verbatim,quotes"]
170172
----
171-
WebSocketGraphQlClient graphQlClient = WebSocketGraphQlClient.builder(url, client)
172-
.keepalive(30)
173-
.build();
173+
URI url = ... ;
174+
WebSocketClient client = ... ;
175+
176+
WebSocketGraphQlClient graphQlClient = WebSocketGraphQlClient.builder(url, client)
177+
.keepAlive(Duration.ofSeconds(30))
178+
.build();
174179
----
175180

181+
176182
[[client.websocketgraphqlclient.interceptor]]
177183
==== Interceptor
178184

0 commit comments

Comments
 (0)