Open ChrisMH opened 1 year ago
I expect this issue is the same one I have been experiencing. I also had to downgrade to 13.5.1 because anything newer causes issues.
public class OptionsSerializer : ScalarSerializer<JsonElement, Dictionary<string, List<string>>> {
public OptionsSerializer(string typeName = "Options") : base(typeName) {
}
public override Dictionary<string, List<string>> Parse(JsonElement serializedValue) {
return serializedValue.Deserialize<Dictionary<string, List<string>>>()!;
}
protected override JsonElement Format(Dictionary<string, List<string>> runtimeValue) {
return JsonSerializer.SerializeToElement(runtimeValue);
}
}
Using this results in
StrawberryShake.GraphQLClientException: Failed to parse "Options": invalid type: string "{}", expected a map
at StrawberryShake.OperationResultExtensions.EnsureNoErrors(IOperationResult result)
Rust backend is reporting that it received a string "{}"
instead of an empty object {}
.
Is there an existing issue for this?
Product
Strawberry Shake
Describe the bug
I am sending a GeoJSONPointInput to a GraphQL server for reverse geocoding. I am using a custom serializer to serialize the Position part of the input type, which has been in place and working up through 13.5.1. When upgrading to 13.7.0, my server started returning errors. I have tracked down the prerelease versions and the issue was introduced in 13.6.0-preview.33. 13.6.0-preview.32 worked.
Steps to reproduce
Using this serializer, send a GeoJSONPointInput to a GraphQL server:
Relevant log output
Additional Context?
13.6.0-preview.32 - Working 13.6.0-preview.33 - NOT working
My server is 13.7.0. I am using 13.7.0 for code generation. The package that appears to cause the problem is StrawberryShake.Server. The above versions where changed for that package only.
I am able to send the operation directly to the server using Postman:
Version
13.7.0