strawberry shake v.11 deserializing dictionary<string, object> with any type (and custom scalar type) not working #4124
kimbendtsen
started this conversation in
General
Replies: 1 comment
-
We have continued working and come with a work around. Instead of a code first schema
Then replacing this with
This does however require 12.0.0-preview-* to work. I think however there are 2 issues not working in neither 11.* or 12.* - I'm considering creating bug reports for
2: The code generation fails if the runtime type is a generic. e.g.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi - we are trying to get into using hotchocolate / strawberry shake as a .net graphql client server solution.
We have hit a few hickups on the way but one deserializing issue that we are stucked with.
On the server / schema side we are creating
The values is actually a Dictionary<string,object> and when making a query request it is serialized as a json dictionary. In the playground this all looks fine.
On the client side though we have tried to
Any hints how to accomplish this?
ps: Many attempts end in the auto generated code
DeserializeString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "values")
where the value of obj.values isValueKind = Object : "{"count":"06","ee":-3}"
The problem with the attempted deSerializing is that no GetString() exists. e.g. in the auto generated code
return _stringParser.Parse(obj.Value.GetString()!);
So howto hit a different serializer that will use my custom serializer? Or a standard one that can handle dictionary<string, object>
Br
Kim
Beta Was this translation helpful? Give feedback.
All reactions