From 328e6acdeeaafa27501d6bcc88b5b79704791210 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 16 Mar 2021 10:08:13 +0100 Subject: Emit list item errors once --- src/Language/GraphQL/Validate/Rules.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Language/GraphQL/Validate/Rules.hs') diff --git a/src/Language/GraphQL/Validate/Rules.hs b/src/Language/GraphQL/Validate/Rules.hs index ee2fdbe..905c2a7 100644 --- a/src/Language/GraphQL/Validate/Rules.hs +++ b/src/Language/GraphQL/Validate/Rules.hs @@ -1540,7 +1540,7 @@ valuesOfCorrectTypeRule = ValueRule go constGo go (Just inputType) value | Just constValue <- toConstNode value = lift $ check inputType constValue - go _ _ = lift mempty + go _ _ = lift mempty -- This rule checks only literals. toConstNode Full.Node{..} = flip Full.Node location <$> toConst node toConst (Full.Variable _) = Nothing toConst (Full.Int integer) = Just $ Full.ConstInt integer @@ -1586,8 +1586,8 @@ valuesOfCorrectTypeRule = ValueRule go constGo , Full.ConstObject valueFields <- node = foldMap (checkObjectField typeFields) valueFields check (In.ListBaseType listType) constValue@Full.Node{ .. } - | Full.ConstList listValues <- node = - foldMap (check listType) listValues + -- Skip, lists are checked recursively by the validation traverser. + | Full.ConstList _ <- node = mempty | otherwise = check listType constValue check inputType Full.Node{ .. } = pure $ Error { message = concat -- cgit v1.2.3