Product
Hot Chocolate
Version
16.0.9
Link to minimal reproduction
https://github.com/stanislav-a-frolov/TestEmptyDictionaryKeys
Steps to reproduce
- Setup executor with query field resolving to dictionary with empty string key, add type converter to JsonElement
var executor = await new ServiceCollection()
.AddGraphQL()
.AddQueryType(q => q.Field("data").Resolve(ctx => new Dictionary<string, object?>() { { "", 1 } }).Type<AnyType>())
.AddTypeConverter<Dictionary<string, object?>, JsonElement>(value => JsonSerializer.SerializeToElement(value))
.BuildRequestExecutorAsync();
- Execute query, get errors
var response = await executor.ExecuteAsync("query { data }");
var operationResult = response.ExpectOperationResult();
Assert.Empty(operationResult!.Errors); // fail: Value cannot be null. (Parameter 'propertyName')
What is expected?
Result is expected to be serialized with empty string field without errors as it was in HC 15
What is actually happening?
ArgumentNullException is thrown at ResultElement.SetPropertyName due to empty span
Relevant log output
Additional context
No response
Product
Hot Chocolate
Version
16.0.9
Link to minimal reproduction
https://github.com/stanislav-a-frolov/TestEmptyDictionaryKeys
Steps to reproduce
What is expected?
Result is expected to be serialized with empty string field without errors as it was in HC 15
What is actually happening?
ArgumentNullException is thrown at ResultElement.SetPropertyName due to empty span
Relevant log output
Additional context
No response