Esempio n. 1
0
        private GraphQLHttpClient(HttpClient httpClient, GraphQLHttpClientOptions options)
        {
            this.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(httpClient, options);
        }
Esempio n. 2
0
        public GraphQLHttpHandler(HttpClient Http, GraphQLHttpClientOptions options)
        {
            this.Options = options ?? 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.HttpClient = Http;
        }
Esempio n. 3
0
 private GraphQLHttpClient(HttpClient httpClient, string endPoint, GraphQLHttpClientOptions options) : this(httpClient, new Uri(endPoint), options)
 {
 }