diff --git a/src/GraphQL.Client/Http/GraphQLHttpClient.cs b/src/GraphQL.Client/Http/GraphQLHttpClient.cs index eaac501d..2795fdeb 100644 --- a/src/GraphQL.Client/Http/GraphQLHttpClient.cs +++ b/src/GraphQL.Client/Http/GraphQLHttpClient.cs @@ -90,14 +90,14 @@ public GraphQLHttpClient(GraphQLHttpClientOptions options) { this.graphQLHttpHandler = new GraphQLHttpHandler(options); } - internal GraphQLHttpClient(GraphQLHttpClientOptions options,HttpClient httpClient) { + internal GraphQLHttpClient(GraphQLHttpClientOptions options, HttpClient httpClient) { if (options == null) { throw new ArgumentNullException(nameof(options)); } if (options.EndPoint == null) { throw new ArgumentNullException(nameof(options.EndPoint)); } if (options.JsonSerializerSettings == null) { throw new ArgumentNullException(nameof(options.JsonSerializerSettings)); } if (options.HttpMessageHandler == null) { throw new ArgumentNullException(nameof(options.HttpMessageHandler)); } if (options.MediaType == null) { throw new ArgumentNullException(nameof(options.MediaType)); } - this.graphQLHttpHandler = new GraphQLHttpHandler(options,httpClient); + this.graphQLHttpHandler = new GraphQLHttpHandler(options, httpClient); } public Task SendQueryAsync(string query, CancellationToken cancellationToken = default) => @@ -121,7 +121,8 @@ public Task SendSubscribeAsync(GraphQLRequest reques if (request == null) { throw new ArgumentNullException(nameof(request)); } if (request.Query == null) { throw new ArgumentNullException(nameof(request.Query)); } - var webSocketUri = new Uri($"ws://{this.EndPoint.Host}:{this.EndPoint.Port}{this.EndPoint.AbsolutePath}"); + var webSocketSchema = this.EndPoint.Scheme == "https" ? "wss" : "ws"; + var webSocketUri = new Uri($"{webSocketSchema}://{this.EndPoint.Host}:{this.EndPoint.Port}{this.EndPoint.AbsolutePath}"); var graphQLSubscriptionResult = new GraphQLHttpSubscriptionResult(webSocketUri, request); graphQLSubscriptionResult.StartAsync(cancellationToken); return Task.FromResult((IGraphQLSubscriptionResult)graphQLSubscriptionResult); diff --git a/src/GraphQL.Client/Http/GraphQLHttpSubscriptionResult.cs b/src/GraphQL.Client/Http/GraphQLHttpSubscriptionResult.cs index 9174f47b..278a4035 100644 --- a/src/GraphQL.Client/Http/GraphQLHttpSubscriptionResult.cs +++ b/src/GraphQL.Client/Http/GraphQLHttpSubscriptionResult.cs @@ -61,6 +61,7 @@ private Task SendInitialMessageAsync(CancellationToken cancellationToken = defau } private static class GQLWebSocketMessageType { + /// /// Client sends this message after plain websocket connection to start the communication with the server /// The server will response only with GQL_CONNECTION_ACK + GQL_CONNECTION_KEEP_ALIVE(if used) or GQL_CONNECTION_ERROR @@ -142,6 +143,7 @@ private static class GQLWebSocketMessageType { /// id: string : operation id /// public const string GQL_STOP = "stop"; // Client -> Server + } } diff --git a/src/GraphQL.Client/Http/Internal/GraphQLHttpHandler.cs b/src/GraphQL.Client/Http/Internal/GraphQLHttpHandler.cs index b3cce718..f2223610 100644 --- a/src/GraphQL.Client/Http/Internal/GraphQLHttpHandler.cs +++ b/src/GraphQL.Client/Http/Internal/GraphQLHttpHandler.cs @@ -87,7 +87,8 @@ public async Task ReadHttpResponseMessageAsync(HttpResponseMess }; try { return jsonSerializer.Deserialize(jsonTextReader); - } catch (JsonReaderException exception) { + } + catch (JsonReaderException exception) { if (httpResponseMessage.IsSuccessStatusCode) { throw exception; } diff --git a/src/GraphQL.Client/Obsolete.GraphQLClient.Extensions.cs b/src/GraphQL.Client/Obsolete.GraphQLClient.Extensions.cs index da7ee138..a7b6dbfc 100644 --- a/src/GraphQL.Client/Obsolete.GraphQLClient.Extensions.cs +++ b/src/GraphQL.Client/Obsolete.GraphQLClient.Extensions.cs @@ -9,7 +9,7 @@ namespace GraphQL.Client { /// /// Extension Methods for /// - [Obsolete()] + [Obsolete] public static class GraphQLClientExtensions { private const string IntrospectionQuery = @"