@@ -90,14 +90,14 @@ public GraphQLHttpClient(GraphQLHttpClientOptions options) {
9090 this . graphQLHttpHandler = new GraphQLHttpHandler ( options ) ;
9191 }
9292
93- internal GraphQLHttpClient ( GraphQLHttpClientOptions options , HttpClient httpClient ) {
93+ internal GraphQLHttpClient ( GraphQLHttpClientOptions options , HttpClient httpClient ) {
9494 if ( options == null ) { throw new ArgumentNullException ( nameof ( options ) ) ; }
9595 if ( options . EndPoint == null ) { throw new ArgumentNullException ( nameof ( options . EndPoint ) ) ; }
9696 if ( options . JsonSerializerSettings == null ) { throw new ArgumentNullException ( nameof ( options . JsonSerializerSettings ) ) ; }
9797 if ( options . HttpMessageHandler == null ) { throw new ArgumentNullException ( nameof ( options . HttpMessageHandler ) ) ; }
9898 if ( options . MediaType == null ) { throw new ArgumentNullException ( nameof ( options . MediaType ) ) ; }
9999
100- this . graphQLHttpHandler = new GraphQLHttpHandler ( options , httpClient ) ;
100+ this . graphQLHttpHandler = new GraphQLHttpHandler ( options , httpClient ) ;
101101 }
102102
103103 public Task < GraphQLResponse > SendQueryAsync ( string query , CancellationToken cancellationToken = default ) =>
@@ -121,7 +121,8 @@ public Task<IGraphQLSubscriptionResult> SendSubscribeAsync(GraphQLRequest reques
121121 if ( request == null ) { throw new ArgumentNullException ( nameof ( request ) ) ; }
122122 if ( request . Query == null ) { throw new ArgumentNullException ( nameof ( request . Query ) ) ; }
123123
124- var webSocketUri = new Uri ( $ "ws://{ this . EndPoint . Host } :{ this . EndPoint . Port } { this . EndPoint . AbsolutePath } ") ;
124+ var webSocketSchema = this . EndPoint . Scheme == "https" ? "wss" : "ws" ;
125+ var webSocketUri = new Uri ( $ "{ webSocketSchema } ://{ this . EndPoint . Host } :{ this . EndPoint . Port } { this . EndPoint . AbsolutePath } ") ;
125126 var graphQLSubscriptionResult = new GraphQLHttpSubscriptionResult ( webSocketUri , request ) ;
126127 graphQLSubscriptionResult . StartAsync ( cancellationToken ) ;
127128 return Task . FromResult ( ( IGraphQLSubscriptionResult ) graphQLSubscriptionResult ) ;
0 commit comments