You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is there any sample code to talk about how to override OnPongAsync() in DefaultSocketSessionInterceptor? I tried the following, but failed to inject the payload the frontend.
public class CustomPayloadMessage : JsonOperationMessage
{
public CustomPayloadMessage(JsonElement? payload = null)
: base("pong", payload)
{
}
}
public override ValueTask OnPongAsync(ISocketSession session, IOperationMessagePayload pongMessage, CancellationToken cancellationToken = default(CancellationToken))
{
string jsonString = @"{
""Date"": ""2019-08-01T00:00:00-07:00"",
""TemperatureCelsius"": 25,
""Summary"": ""Hot""
}";
var document = JsonDocument.Parse(jsonString);
var customPayload = new CustomPayloadMessage(document.RootElement);
return base.OnPongAsync(session, customPayload, cancellationToken);
}
In frontend, using graphql-ws, and listen to pong event, but get false in received, and null in paylaod
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
is there any sample code to talk about how to override
OnPongAsync()
in DefaultSocketSessionInterceptor? I tried the following, but failed to inject the payload the frontend.In frontend, using graphql-ws, and listen to pong event, but get
false
in received, andnull
in paylaodThanks!
Beta Was this translation helpful? Give feedback.
All reactions