graphql-0.10.0.0: Haskell GraphQL implementation

Safe HaskellNone
LanguageHaskell2010

Language.GraphQL.Validate.Validation

Description

Definitions used by the validation rules and the validator itself.

Synopsis

Documentation

data Error Source #

Validation error.

Constructors

Error 

Fields

Instances
Eq Error Source # 
Instance details

Defined in Language.GraphQL.Validate.Validation

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

Show Error Source # 
Instance details

Defined in Language.GraphQL.Validate.Validation

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

data Path Source #

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.

Constructors

Segment Text

Field name.

Index Int

List index if a field returned a list.

Instances
Eq Path Source # 
Instance details

Defined in Language.GraphQL.Validate.Validation

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Show Path Source # 
Instance details

Defined in Language.GraphQL.Validate.Validation

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

data Rule m Source #

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.

type RuleT m = ReaderT (Validation m) Maybe Error Source #

Monad transformer used by the rules.

data Validation m Source #

Validation rule context.

Constructors

Validation 

Fields