From adeba459a20e3fa2e74d98ae7219ef3ed41e7883 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 24 Jul 2020 21:34:31 +0200 Subject: Release 0.9.0.0 --- src/Language/GraphQL/Validate/Rules.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Language/GraphQL/Validate') diff --git a/src/Language/GraphQL/Validate/Rules.hs b/src/Language/GraphQL/Validate/Rules.hs index bc754c2..a3314e7 100644 --- a/src/Language/GraphQL/Validate/Rules.hs +++ b/src/Language/GraphQL/Validate/Rules.hs @@ -2,6 +2,7 @@ v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. -} +-- | This module contains default rules defined in the GraphQL specification. module Language.GraphQL.Validate.Rules ( Rule(..) , executableDefinitionsRule @@ -10,14 +11,19 @@ module Language.GraphQL.Validate.Rules import Language.GraphQL.AST.Document +-- | 'Rule' assigns a function to each AST node that can be validated. If the +-- validation fails, the function should return an error message, or 'Nothing' +-- otherwise. newtype Rule = DefinitionRule (Definition -> Maybe String) +-- | Default reules given in the specification. specifiedRules :: [Rule] specifiedRules = [ executableDefinitionsRule ] +-- | Definition must be OperationDefinition or FragmentDefinition. executableDefinitionsRule :: Rule executableDefinitionsRule = DefinitionRule go where -- cgit v1.2.3