Description
I propose to move variables deserialization into
|
let rec private coerceVariableValue isNullable typedef (vardef: VarDef) (input: obj) (errMsg: string) : obj = |
and pass
Map<string, obj>where
obj can be either
System.Text.Json.JsonElement or another
Map<string, obj>.
Because in that function we have all the required info to correctly get value from JSON.
This way a scalar coerce function will always receive System.Text.Json.JsonElement and for objects options with converters can be applied.
@jberzy what do you think?
Alternatives
Define an interface that allows to convert arbitrary JSON toke (i.e. JsonElemen to JToken) to a requested value type and pass it.
Description
I propose to move variables deserialization into
FSharp.Data.GraphQL/src/FSharp.Data.GraphQL.Server/Values.fs
Line 105 in b072222
Map<string, obj>whereobjcan be eitherSystem.Text.Json.JsonElementor anotherMap<string, obj>.Because in that function we have all the required info to correctly get value from JSON.
This way a scalar coerce function will always receive
System.Text.Json.JsonElementand for objects options with converters can be applied.@jberzy what do you think?
Alternatives
Define an interface that allows to convert arbitrary JSON toke (i.e. JsonElemen to JToken) to a requested value type and pass it.