graphql-client
graphql-client copied to clipboard
Duplicate definition of CreateSubscriptionStream extension methods
trafficstars
The overloads of the extension methods CreateSubscriptionStream() accepting the defineResponseType argument (allowing to use anonymous response types) are defined twice, namely:
- in
GraphQL.Client.Abstractions.GraphQLClientExtensions - in
GraphQL.Client.Http.GraphQLHttpClientExtensions
This code will fail to compile:
using GraphQL.Client.Abstractions;
using GraphQL.Client.Http;
using GraphQL.Client.Serializer.SystemTextJson;
var client = new GraphQLHttpClient("http://example.com/", new SystemTextJsonSerializer());
var request = new GraphQLHttpRequest();
var defineResponseType = () => new { Foo = "" };
client.SendQueryAsync(request, defineResponseType); // OK
client.CreateSubscriptionStream(request, defineResponseType); // CS0121: The call is ambiguous
I know that there are several ways to avoid this conflict (Don't use anonymous types / Don't import GraphQL.Client.Abstractions / Use the fully qualified method name), but I assume that this redundancy is not intended and that the second occurence should be removed, thus keeping all methods for anonymous types in the GraphQL.Client.Abstractions package.