Safe Haskell | None |
---|---|
Language | Haskell2010 |
GraphQL validator.
Synopsis
- data Error = Error {}
- data Path
- document :: forall m. Schema m -> [Rule m] -> Document -> Seq Error
- executableDefinitionsRule :: forall m. Rule m
- loneAnonymousOperationRule :: forall m. Rule m
- singleFieldSubscriptionsRule :: forall m. Rule m
- specifiedRules :: forall m. [Rule m]
- uniqueFragmentNamesRule :: forall m. Rule m
- uniqueOperationNamesRule :: forall m. Rule m
Documentation
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 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.