graphql-0.10.0.0: Haskell GraphQL implementation

Safe HaskellNone
LanguageHaskell2010

Language.GraphQL.Validate

Description

GraphQL validator.

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 #

document :: forall m. Schema m -> [Rule m] -> Document -> Seq Error Source #

Validates a document and returns a list of found errors. If the returned list is empty, the document is valid.

executableDefinitionsRule :: forall m. Rule m Source #

Definition must be OperationDefinition or FragmentDefinition.

loneAnonymousOperationRule :: forall m. Rule m Source #

GraphQL allows a short‐hand form for defining query operations when only that one operation exists in the document.

singleFieldSubscriptionsRule :: forall m. Rule m Source #

Subscription operations must have exactly one root field.

specifiedRules :: forall m. [Rule m] Source #

Default rules given in the specification.

uniqueFragmentNamesRule :: forall m. Rule m Source #

Fragment definitions are referenced in fragment spreads by name. To avoid ambiguity, each fragment’s name must be unique within a document.

Inline fragments are not considered fragment definitions, and are unaffected by this validation rule.

uniqueOperationNamesRule :: forall m. Rule m Source #

Each named operation definition must be unique within a document when referred to by its name.