diff --git a/src/FSharp.Data.GraphQL.Server/Values.fs b/src/FSharp.Data.GraphQL.Server/Values.fs index 641ae9a24..c79a30ef3 100644 --- a/src/FSharp.Data.GraphQL.Server/Values.fs +++ b/src/FSharp.Data.GraphQL.Server/Values.fs @@ -188,6 +188,19 @@ let rec internal compileByType (inputObjectPath: FieldPath) (inputSource : Input | ValueSome field -> match Map.tryFind field.Name props with | None -> Ok <| wrapOptionalNone param.ParameterType field.TypeDef.Type + | Some input when isNull (box field.ExecuteInput) -> + // hack around the case where field.ExecuteInput is null + let rec extract = function + | NullValue -> null + | IntValue i -> box i + | FloatValue f -> box f + | BooleanValue b -> box b + | StringValue s -> box s + | EnumValue e -> box e + | ListValue l -> box (l |> List.map extract) + | ObjectValue o -> o |> Map.map (fun k v -> extract v) |> box + | VariableName v -> failwithf "Todo: extract variable" + extract input |> Ok | Some prop -> field.ExecuteInput prop variables |> Result.map (normalizeOptional param.ParameterType) |> attachErrorExtensionsIfScalar inputSource inputObjectPath originalInputDef field