Skip to content

Commit

Permalink
GraphQLWs: Ping messages reflect the payload in the pong response (#1155
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Shane32 authored Oct 7, 2024
1 parent a84c553 commit 2d2ab4c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ public override async Task OnMessageReceivedAsync(OperationMessage message)
/// Executes when a ping message is received.
/// </summary>
protected virtual Task OnPingAsync(OperationMessage message)
=> Connection.SendMessageAsync(_pongMessage);
=> message.Payload == null
? Connection.SendMessageAsync(_pongMessage)
: Connection.SendMessageAsync(new OperationMessage { Type = MessageType.Pong, Payload = message.Payload });

/// <summary>
/// Executes when a pong message is received.
Expand Down

0 comments on commit 2d2ab4c

Please # to comment.