summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL/Validate/Rules.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-09-16 09:12:49 +0200
committerEugen Wissner <belka@caraus.de>2020-09-16 09:12:49 +0200
commit6e644c5b4b3a8284ed0a1f0a84fef775f70a68d6 (patch)
tree56cac7b46b3621c8621e5f8026e275c3b464394d /src/Language/GraphQL/Validate/Rules.hs
parent4c10ce92041dc73a95aeb64aca241dd937ffaa5c (diff)
downloadgraphql-6e644c5b4b3a8284ed0a1f0a84fef775f70a68d6.tar.gz
Move path to the execution error
Since it isn't possible to get a path during validation, without executing the query.
Diffstat (limited to 'src/Language/GraphQL/Validate/Rules.hs')
-rw-r--r--src/Language/GraphQL/Validate/Rules.hs11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/Language/GraphQL/Validate/Rules.hs b/src/Language/GraphQL/Validate/Rules.hs
index 0e1ccfa..2d9cf74 100644
--- a/src/Language/GraphQL/Validate/Rules.hs
+++ b/src/Language/GraphQL/Validate/Rules.hs
@@ -70,7 +70,6 @@ executableDefinitionsRule = DefinitionRule $ \case
{ message =
"Definition must be OperationDefinition or FragmentDefinition."
, locations = [location]
- , path = []
}
-- | Subscription operations must have exactly one root field.
@@ -88,12 +87,10 @@ singleFieldSubscriptionsRule = OperationDefinitionRule $ \case
, "must select only one top level field."
]
, locations = [location]
- , path = []
}
| otherwise -> pure $ Error
{ message = errorMessage
, locations = [location]
- , path = []
}
_ -> lift mempty
where
@@ -173,7 +170,6 @@ loneAnonymousOperationRule = OperationDefinitionRule $ \case
{ message =
"This anonymous operation must be the only defined operation."
, locations = [location]
- , path = []
}
-- | Each named operation definition must be unique within a document when
@@ -209,7 +205,6 @@ findDuplicates filterByName thisLocation errorMessage = do
error' locations' = Error
{ message = errorMessage
, locations = locations'
- , path = []
}
viewOperation :: Definition -> Maybe OperationDefinition
@@ -257,7 +252,6 @@ fragmentSpreadTargetDefinedRule = FragmentSpreadRule $ \case
Nothing -> pure $ Error
{ message = error' fragmentName
, locations = [location]
- , path = []
}
Just _ -> lift mempty
where
@@ -288,7 +282,6 @@ fragmentSpreadTypeExistenceRule = SelectionRule $ \case
Nothing -> pure $ Error
{ message = spreadError fragmentName typeCondition
, locations = [location]
- , path = []
}
Just _ -> lift mempty
InlineFragmentSelection fragmentSelection
@@ -299,7 +292,6 @@ fragmentSpreadTypeExistenceRule = SelectionRule $ \case
Nothing -> pure $ Error
{ message = inlineError typeCondition
, locations = [location]
- , path = []
}
Just _ -> lift mempty
_ -> lift mempty
@@ -344,7 +336,6 @@ fragmentsOnCompositeTypesRule = FragmentRule definitionRule inlineRule
Nothing -> pure $ Error
{ message = errorMessage typeCondition
, locations = [location]
- , path = []
}
Just _ -> lift mempty
errorMessage typeCondition = concat
@@ -363,7 +354,6 @@ noUnusedFragmentsRule = FragmentDefinitionRule $ \fragment ->
| otherwise = pure $ Error
{ message = errorMessage fragName
, locations = [location]
- , path = []
}
errorMessage fragName = concat
[ "Fragment \""
@@ -413,7 +403,6 @@ noFragmentCyclesRule = FragmentDefinitionRule $ \case
, ")."
]
, locations = [location]
- , path = []
}
_ -> lift mempty
where