GraphQLClient ОШИБКА при создании GraphQLHttpClient: IGraphQLWebsocketJsonSerializer - PullRequest
2 голосов
/ 02 марта 2020

Используя GraphQL версии 2.1.0, я не могу создать объект: GraphQLHttpClient.

Я сразу получаю следующую ошибку:

System.AggregateException
  HResult=0x80131500
  Message=One or more errors occurred. (no implementation of "GraphQL.Client.Abstractions.Websocket.IGraphQLWebsocketJsonSerializer" found)
  Source=System.Private.CoreLib
  StackTrace:
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at (...)Program.Main(String[] args) in (..)\Program.cs:line 22

  This exception was originally thrown at this call stack:
    GraphQL.Client.Abstractions.GraphQLJsonSerializerExtensions.EnsureAssigned<TSerializerInterface>(TSerializerInterface)
    GraphQL.Client.Http.GraphQLHttpClient.GraphQLHttpClient(GraphQL.Client.Http.GraphQLHttpClientOptions, System.Net.Http.HttpClient)
    GraphQL.Client.Http.GraphQLHttpClient.GraphQLHttpClient(GraphQL.Client.Http.GraphQLHttpClientOptions)
    GraphQL.Client.Http.GraphQLHttpClient.GraphQLHttpClient(System.Action<GraphQL.Client.Http.GraphQLHttpClientOptions>)
    GraphQL.Client.Http.GraphQLHttpClient.GraphQLHttpClient(System.Uri)
    GraphQL.Client.Http.GraphQLHttpClient.GraphQLHttpClient(string)
    (...)Program.MainAsync() in Program.cs

Inner Exception 1:
InvalidOperationException: no implementation of "GraphQL.Client.Abstractions.Websocket.IGraphQLWebsocketJsonSerializer" found

Код:

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
using System.Net;
using System.Text;
using GraphQL;
using GraphQL.Client;
using System.Threading.Tasks;
using System.Collections.Generic;
using GraphQL.Client.Abstractions;
using GraphQL.Client.Http;

namespace OW_1
{
    class Program
    {

        static void Main(string[] args)
        {
            MainAsync().Wait();
        }

        static async Task MainAsync()
        {
            var graphQLClient = new GraphQLHttpClient("X");

        }
    }
}

Он аварийно завершает работу с GraphQLHttpClient. Раньше я использовал 1.0.3 (с классом GraphQLClient), и он работал.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...