Skip to content

Commit 83d15f6

Browse files
committed
Fixed @valbers' comments
1 parent 1c5cafb commit 83d15f6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/FSharp.Data.GraphQL.Server/Execution.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ let private compileInputObject (indef: InputObjectDef) =
645645
|> Array.iter(fun inputField ->
646646
// TODO: Implement compilation cache to reuse for the same type
647647
let inputFieldTypeDef = inputField.TypeDef
648-
inputField.ExecuteInput <- compileByType [ box inputField.Name ] Unknown (inputFieldTypeDef, inputField.TypeDef)
648+
inputField.ExecuteInput <- compileByType [ box inputField.Name ] Unknown (inputFieldTypeDef, inputFieldTypeDef)
649649
match inputField.TypeDef with
650650
| InputObject inputObjDef -> inputObjDef.ExecuteInput <- inputField.ExecuteInput
651651
| _ -> ()

src/FSharp.Data.GraphQL.Shared/ValidationTypes.fs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Result =
2222

2323
type ResultBuilder with
2424

25-
member inline _.Source(result: ValidationResult<'error>) = result.AsResult
25+
member inline _.Source (result : ValidationResult<'error>) = result.AsResult
2626

2727
module ValidationResult =
2828

@@ -52,9 +52,17 @@ module GQLValidator =
5252
[<AbstractClass; Sealed>]
5353
type AstError =
5454

55-
static member AsResult(message : string, ?path : FieldPath) =
55+
static member AsResult (message : string, ?path : FieldPath) =
5656
[
57-
let extensions = Dictionary<string, obj>() |> GQLProblemDetails.SetErrorKind ErrorKind.Validation
58-
{ Message = message; Path = path |> Skippable.ofOption |> Skippable.map List.rev; Locations = Skip; Extensions = Include extensions }
57+
{
58+
Message = message
59+
Path = path |> Skippable.ofOption |> Skippable.map List.rev
60+
Locations = Skip
61+
Extensions =
62+
Include (
63+
Dictionary<string, obj> ()
64+
|> GQLProblemDetails.SetErrorKind ErrorKind.Validation
65+
)
66+
}
5967
]
6068
|> ValidationResult.ValidationError

0 commit comments

Comments
 (0)