Here is a short snippet how to set up proxy with GraphQL.Client in C#. In this example I use a local proxy for debugging.
var proxy = new WebProxy
{
Address = new Uri($"http://127.0.0.1:8888"),
};
var httpClientHandler = new HttpClientHandler
{
Proxy = proxy,
};
var options = new GraphQLHttpClientOptions
{
EndPoint = new Uri("https://test.com/graphql"),
HttpMessageHandler = httpClientHandler
};
var graphQLClient = new GraphQLHttpClient(
options,
new NewtonsoftJsonSerializer()
);
Top comments (0)