File tree 1 file changed +13
-0
lines changed
src/FSharp.Data.GraphQL.Server
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,19 @@ let rec internal compileByType (inputObjectPath: FieldPath) (inputSource : Input
188
188
| ValueSome field ->
189
189
match Map.tryFind field.Name props with
190
190
| None -> Ok <| wrapOptionalNone param.ParameterType field.TypeDef.Type
191
+ | Some input when isNull ( box field.ExecuteInput) ->
192
+ // hack around the case where field.ExecuteInput is null
193
+ let rec extract = function
194
+ | NullValue -> null
195
+ | IntValue i -> box i
196
+ | FloatValue f -> box f
197
+ | BooleanValue b -> box b
198
+ | StringValue s -> box s
199
+ | EnumValue e -> box e
200
+ | ListValue l -> box ( l |> List.map extract)
201
+ | ObjectValue o -> o |> Map.map ( fun k v -> extract v) |> box
202
+ | VariableName v -> failwithf " Todo: extract variable"
203
+ extract input |> Ok
191
204
| Some prop ->
192
205
field.ExecuteInput prop variables |> Result.map ( normalizeOptional param.ParameterType)
193
206
|> attachErrorExtensionsIfScalar inputSource inputObjectPath originalInputDef field
You can’t perform that action at this time.
0 commit comments