forked from OSS/graphql
Eta reduce and update required hlint
This commit is contained in:
parent
0047a13bc0
commit
930b8f10b7
@ -205,5 +205,5 @@ collectImplementations = HashMap.foldr go HashMap.empty
|
||||
let Out.ObjectType _ _ interfaces _ = objectType
|
||||
in foldr (add implementation) accumulator interfaces
|
||||
go _ accumulator = accumulator
|
||||
add implementation (Out.InterfaceType typeName _ _ _) accumulator =
|
||||
HashMap.insertWith (++) typeName [implementation] accumulator
|
||||
add implementation (Out.InterfaceType typeName _ _ _) =
|
||||
HashMap.insertWith (++) typeName [implementation]
|
||||
|
@ -152,7 +152,7 @@ singleFieldSubscriptionsRule = OperationDefinitionRule $ \case
|
||||
where
|
||||
errorMessage =
|
||||
"Anonymous Subscription must select only one top level field."
|
||||
collectFields selectionSet = foldM forEach HashSet.empty selectionSet
|
||||
collectFields = foldM forEach HashSet.empty
|
||||
forEach accumulator = \case
|
||||
Full.FieldSelection fieldSelection -> forField accumulator fieldSelection
|
||||
Full.FragmentSpreadSelection fragmentSelection ->
|
||||
@ -472,7 +472,7 @@ noFragmentCyclesRule = FragmentDefinitionRule $ \case
|
||||
collectCycles :: Traversable t
|
||||
=> t Full.Selection
|
||||
-> StateT (Int, Full.Name) (ReaderT (Validation m) Seq) (HashMap Full.Name Int)
|
||||
collectCycles selectionSet = foldM forEach HashMap.empty selectionSet
|
||||
collectCycles = foldM forEach HashMap.empty
|
||||
forEach accumulator = \case
|
||||
Full.FieldSelection fieldSelection -> forField accumulator fieldSelection
|
||||
Full.InlineFragmentSelection fragmentSelection ->
|
||||
@ -702,8 +702,7 @@ uniqueInputFieldNamesRule =
|
||||
where
|
||||
go (Full.Node (Full.Object fields) _) = filterFieldDuplicates fields
|
||||
go _ = mempty
|
||||
filterFieldDuplicates fields =
|
||||
filterDuplicates getFieldName "input field" fields
|
||||
filterFieldDuplicates = filterDuplicates getFieldName "input field"
|
||||
getFieldName (Full.ObjectField fieldName _ location') = (fieldName, location')
|
||||
constGo (Full.Node (Full.ConstObject fields) _) = filterFieldDuplicates fields
|
||||
constGo _ = mempty
|
||||
@ -1331,8 +1330,8 @@ variablesInAllowedPositionRule = OperationDefinitionRule $ \case
|
||||
-> Type.CompositeType m
|
||||
-> t Full.Selection
|
||||
-> ValidationState m (Seq Error)
|
||||
visitSelectionSet variables selectionType selections =
|
||||
foldM (evaluateSelection variables selectionType) mempty selections
|
||||
visitSelectionSet variables selectionType =
|
||||
foldM (evaluateSelection variables selectionType) mempty
|
||||
evaluateFieldSelection variables selections accumulator = \case
|
||||
Just newParentType -> do
|
||||
let folder = evaluateSelection variables newParentType
|
||||
@ -1617,4 +1616,3 @@ valuesOfCorrectTypeRule = ValueRule go constGo
|
||||
}
|
||||
| otherwise -> mempty
|
||||
_ -> checkResult
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user