Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.GraphQL.Validate
Description
GraphQL validator.
Documentation
Validation error.
If an error can be associated to a particular field in the GraphQL result, it must contain an entry with the key path that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error.
document :: forall m. Schema m -> [Rule] -> Document -> Seq Error Source #
Validates a document and returns a list of found errors. If the returned list is empty, the document is valid.
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.
Constructors
DefinitionRule (Definition -> Maybe String) |
executableDefinitionsRule :: Rule Source #
Definition must be OperationDefinition or FragmentDefinition.
specifiedRules :: [Rule] Source #
Default reules given in the specification.