-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
This line always overwrites Option.JsonSerializer:
| Options.JsonSerializer = serializer ?? throw new ArgumentNullException(nameof(serializer)); |
Therefore the following code does not work as expected:
_client = new GraphQLHttpClient(o =>
{
o.EndPoint = new Uri(_testUrl);
o.JsonSerializer = new SystemTextJsonSerializer(
options =>
{
options.Converters.Add(new JsonStringEnumConverter());
});
});
The constructor above calls the constructor
| public GraphQLHttpClient(GraphQLHttpClientOptions options, HttpClient httpClient) : this(options, httpClient, new NewtonsoftJsonSerializer()) { } |
which sets the JsonSerializer always to NewtonsoftJsonSerializer.
By the way, I think it would be better to make a breaking change, remove the reference to GraphQL.Client.Serializer.Newtonsoft and require the caller to provide the serializer.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request