@@ -904,8 +904,8 @@ module Ast =
904904 =
905905 let visitCount =
906906 visited
907- |> List .filter ( fun x -> x = fragName)
908- |> List .length
907+ |> Seq .filter ( fun x -> x = fragName)
908+ |> Seq .length
909909 if visitCount > 1 then
910910 AstError.AsResult $" Fragment '%s {fragName}' is making a cyclic reference."
911911 else
@@ -961,7 +961,7 @@ module Ast =
961961 |> getFragmentAndParentTypes
962962 |> ValidationResult.collect ( checkFragmentSpreadIsPossibleInSelection))
963963
964- let private checkInputValue ( schemaInfo : SchemaInfo ) ( variables : VariableDefinition list option ) ( selection : SelectionInfo ) =
964+ let private checkInputValue ( schemaInfo : SchemaInfo ) ( variables : VariableDefinition list voption ) ( selection : SelectionInfo ) =
965965 let rec checkIsCoercible ( tref : IntrospectionTypeRef ) ( argName : string ) ( value : InputValue ) =
966966 let canNotCoerce =
967967 AstError.AsResult (
@@ -1045,15 +1045,15 @@ module Ast =
10451045 | VariableName varName ->
10461046 let variableDefinition =
10471047 variables
1048- |> Option .defaultValue []
1049- |> List.tryPick ( fun v ->
1048+ |> ValueOption .defaultValue []
1049+ |> List.vtryPick ( fun v ->
10501050 if v.VariableName = varName then
1051- Some ( v, schemaInfo.TryGetInputType ( v.Type))
1051+ ValueSome ( v, schemaInfo.TryGetInputType ( v.Type))
10521052 else
1053- None )
1053+ ValueNone )
10541054 match variableDefinition with
1055- | Some ( vdef, Some vtype) when vdef.DefaultValue.IsSome -> checkIsCoercible vtype argName vdef.DefaultValue.Value
1056- | Some ( vdef, None) when vdef.DefaultValue.IsSome -> canNotCoerce
1055+ | ValueSome ( vdef, Some vtype) when vdef.DefaultValue.IsSome -> checkIsCoercible vtype argName vdef.DefaultValue.Value
1056+ | ValueSome ( vdef, None) when vdef.DefaultValue.IsSome -> canNotCoerce
10571057 | _ -> Success
10581058 selection.Field.Arguments
10591059 |> ValidationResult.collect ( fun arg ->
@@ -1067,10 +1067,10 @@ module Ast =
10671067 let internal validateInputValues ( ctx : ValidationContext ) =
10681068 ctx.Definitions
10691069 |> ValidationResult.collect ( fun def ->
1070- let ( vars , selectionSet ) =
1070+ let struct ( vars , selectionSet ) =
10711071 match def with
1072- | OperationDefinitionInfo odef -> ( Some odef.Definition.VariableDefinitions, odef.SelectionSet)
1073- | FragmentDefinitionInfo fdef -> ( None , fdef.SelectionSet)
1072+ | OperationDefinitionInfo odef -> struct ( ValueSome odef.Definition.VariableDefinitions, odef.SelectionSet)
1073+ | FragmentDefinitionInfo fdef -> struct ( ValueNone , fdef.SelectionSet)
10741074 selectionSet
10751075 |> ValidationResult.collect ( checkInputValue ctx.Schema vars))
10761076
@@ -1096,7 +1096,7 @@ module Ast =
10961096 let selectionSetDirectives =
10971097 frag.SelectionSet
10981098 |> List.collect ( getDistinctDirectiveNamesInSelection path)
1099- fragDirectives |> List.append selectionSetDirectives
1099+ fragDirectives @ selectionSetDirectives
11001100
11011101 let internal validateDirectivesDefined ( ctx : ValidationContext ) =
11021102 ctx.Definitions
0 commit comments