Skip to content

Commit

Permalink
Add new often used constructor (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
zooeywm authored Mar 20, 2024
1 parent fbf37df commit 3e06275
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/GraphQL.Client/GraphQLHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ public GraphQLHttpClient(GraphQLHttpClientOptions options, IGraphQLWebsocketJson
_lazyHttpWebSocket = new Lazy<GraphQLHttpWebSocket>(CreateGraphQLHttpWebSocket);
}

public GraphQLHttpClient(Action<GraphQLHttpClientOptions> configure, IGraphQLWebsocketJsonSerializer serializer, HttpClient httpClient)
: this(configure.New(), serializer, httpClient) { }

public GraphQLHttpClient(Uri endPoint, IGraphQLWebsocketJsonSerializer serializer, HttpClient httpClient)
: this(o => o.EndPoint = endPoint, serializer, httpClient) { }

public GraphQLHttpClient(string endPoint, IGraphQLWebsocketJsonSerializer serializer, HttpClient httpClient)
: this(new Uri(endPoint), serializer, httpClient) { }

#endregion

#region IGraphQLClient
Expand Down

0 comments on commit 3e06275

Please sign in to comment.