Skip to content

Commit 937dc9c

Browse files
committed
add options as context for init payload
1 parent 0ca0ce9 commit 937dc9c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/GraphQL.Client/GraphQLHttpClientOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ public class GraphQLHttpClientOptions
6161
/// Sets the `ConnectionParams` object sent with the GQL_CONNECTION_INIT message on establishing a GraphQL websocket connection.
6262
/// See https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md#gql_connection_init.
6363
/// </summary>
64-
public Func<object?> SetWebSocketConnectionInitPayload { get; set; } = () => null;
64+
public Func<GraphQLHttpClientOptions, object?> ConfigureWebSocketConnectionInitPayload { get; set; } = options => null;
6565
}
6666
}

src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public IObservable<GraphQLResponse<TResponse>> CreateSubscriptionStream<TRespons
115115
{
116116
Id = startRequest.Id,
117117
Type = GraphQLWebSocketMessageType.GQL_CONNECTION_INIT,
118-
Payload = Options.SetWebSocketConnectionInitPayload()
118+
Payload = Options.ConfigureWebSocketConnectionInitPayload(Options)
119119
};
120120

121121
var observable = Observable.Create<GraphQLResponse<TResponse>>(o =>

0 commit comments

Comments
 (0)