We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2004dab commit 231150fCopy full SHA for 231150f
src/FSharp.Data.GraphQL.Server/Values.fs
@@ -322,6 +322,16 @@ let rec internal coerceVariableValue
322
| Ok null when isNullable -> Ok null
323
// TODO: Capture position in the JSON document
324
| Ok null -> createNullError originalTypeDef
325
+ | Ok value when not isNullable ->
326
+ let ``type`` = value.GetType()
327
+ if
328
+ ``type``.IsValueType &&
329
+ ``type``.FullName.StartsWith ReflectionHelper.ValueOptionTypeName &&
330
+ value = Activator.CreateInstance ``type``
331
+ then
332
+ createNullError originalTypeDef
333
+ else
334
+ Ok value
335
| result ->
336
result |> Result.mapError (List.map (mapInputError varDef inputObjectPath objectFieldErrorDetails))
337
| Nullable (InputObject innerdef) ->
0 commit comments