From 663e4f35213ac486ffbb86a76877fcac7b58a1e8 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 18 Jan 2025 16:33:13 +0100 Subject: Make the lexer and parser safe --- src/Language/GraphQL/Validate/Rules.hs | 10 ---------- 1 file changed, 10 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 1c202fe..9d3561f 100644 --- a/src/Language/GraphQL/Validate/Rules.hs +++ b/src/Language/GraphQL/Validate/Rules.hs @@ -1067,18 +1067,12 @@ overlappingFieldsCanBeMergedRule = OperationDefinitionRule $ \case go selectionSet selectionType = do fieldTuples <- evalStateT (collectFields selectionType selectionSet) HashSet.empty fieldsInSetCanMerge fieldTuples - fieldsInSetCanMerge :: forall m - . HashMap Full.Name (NonEmpty (Full.Field, Type.CompositeType m)) - -> ReaderT (Validation m) Seq Error fieldsInSetCanMerge fieldTuples = do validation <- ask let (lonely, paired) = flattenPairs fieldTuples let reader = flip runReaderT validation lift $ foldMap (reader . visitLonelyFields) lonely <> foldMap (reader . forEachFieldTuple) paired - forEachFieldTuple :: forall m - . (FieldInfo m, FieldInfo m) - -> ReaderT (Validation m) Seq Error forEachFieldTuple (fieldA, fieldB) = case (parent fieldA, parent fieldB) of (parentA@Type.CompositeObjectType{}, parentB@Type.CompositeObjectType{}) @@ -1105,10 +1099,6 @@ overlappingFieldsCanBeMergedRule = OperationDefinitionRule $ \case let Full.Field _ _ _ _ subSelections _ = node compositeFieldType = Type.outToComposite type' in maybe (lift Seq.empty) (go subSelections) compositeFieldType - sameResponseShape :: forall m - . FieldInfo m - -> FieldInfo m - -> ReaderT (Validation m) Seq Error sameResponseShape fieldA fieldB = let Full.Field _ _ _ _ selectionsA _ = node fieldA Full.Field _ _ _ _ selectionsB _ = node fieldB -- cgit v1.2.3