diff options
| author | Eugen Wissner <belka@caraus.de> | 2021-05-06 22:23:16 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2021-05-06 22:23:16 +0200 |
| commit | 5a5f265fe4bf291c1ef58f5fe452f1e8c69c9ed6 (patch) | |
| tree | 355fa51dd3e37607afbe536253badc5bed6be5c1 /src/Language/GraphQL/Validate.hs | |
| parent | 2220f0ca560ba010f0aa1210dad5379f35554f39 (diff) | |
| download | graphql-5a5f265fe4bf291c1ef58f5fe452f1e8c69c9ed6.tar.gz | |
Validate non-nullable values inside lists
Diffstat (limited to 'src/Language/GraphQL/Validate.hs')
| -rw-r--r-- | src/Language/GraphQL/Validate.hs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/Language/GraphQL/Validate.hs b/src/Language/GraphQL/Validate.hs index 2e86e53..f929b98 100644 --- a/src/Language/GraphQL/Validate.hs +++ b/src/Language/GraphQL/Validate.hs @@ -314,9 +314,6 @@ constValue (Validation.ValueRule _ rule) valueType = go valueType go inputObjectType value'@(Full.Node (Full.ConstObject fields) _) = foldMap (forEach inputObjectType) (Seq.fromList fields) |> rule inputObjectType value' - go listType value'@(Full.Node (Full.ConstList values) _location) - = embedListLocation go listType values - |> rule listType value' go anotherValue value' = pure $ rule anotherValue value' forEach inputObjectType Full.ObjectField{value = value', ..} = go (valueTypeByName name inputObjectType) value' @@ -420,19 +417,6 @@ argument rule argumentType (Full.Argument _ value' _) = where valueType (In.Argument _ valueType' _) = valueType' --- Applies a validation rule to each list value and merges returned errors. -embedListLocation :: forall a m - . (Maybe In.Type -> Full.Node a -> Seq m) - -> Maybe In.Type - -> [Full.Node a] - -> Seq m -embedListLocation go listType - = foldMap (go $ valueTypeFromList listType) - . Seq.fromList - where - valueTypeFromList (Just (In.ListBaseType baseType)) = Just baseType - valueTypeFromList _ = Nothing - value :: forall m . Validation.Rule m -> Maybe In.Type @@ -443,9 +427,6 @@ value (Validation.ValueRule rule _) valueType = go valueType go inputObjectType value'@(Full.Node (Full.Object fields) _) = foldMap (forEach inputObjectType) (Seq.fromList fields) |> rule inputObjectType value' - go listType value'@(Full.Node (Full.List values) _location) - = embedListLocation go listType values - |> rule listType value' go anotherValue value' = pure $ rule anotherValue value' forEach inputObjectType Full.ObjectField{value = value', ..} = go (valueTypeByName name inputObjectType) value' |
