diff options
Diffstat (limited to 'Data/GraphQL/AST.hs')
| -rw-r--r-- | Data/GraphQL/AST.hs | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs index 5fdd146..99eaa79 100644 --- a/Data/GraphQL/AST.hs +++ b/Data/GraphQL/AST.hs @@ -1,7 +1,5 @@ -{- | This module defines an - abstract syntax tree for the GraphQL language, based on - <https://facebook.github.io/graphql/ Facebook's GraphQL Specification>. --} +-- | This module defines an abstract syntax tree for the @GraphQL@ language based on +-- <https://facebook.github.io/graphql/ Facebook's GraphQL Specification>. module Data.GraphQL.AST where @@ -44,33 +42,26 @@ data Selection = SelectionField Field | SelectionInlineFragment InlineFragment deriving (Eq,Show) -{- | <https://facebook.github.io/graphql/#sec-Language.Query-Document.Fields Field Specification> - - A selection set is primarily composed of fields. - A field describes one discrete piece of information - available to request within a selection set. - - Some fields describe complex data or relationships to other data. - In order to further explore this data, a field may itself contain - a selection set, allowing for deeply nested requests. - All GraphQL operations must specify their selections down to - fields which return scalar values to ensure an unambiguously - shaped response. - --} +-- | A 'SelectionSet' is primarily composed of 'Field's. A 'Field' describes one +-- discrete piece of information available to request within a 'SelectionSet'. +-- +-- Some 'Field's describe complex data or relationships to other data. In +-- order to further explore this data, a 'Field' may itself contain a +-- 'SelectionSet', allowing for deeply nested requests. All @GraphQL@ operations +-- must specify their 'Selection's down to 'Field's which return scalar values to +-- ensure an unambiguously shaped response. +-- +-- <https://facebook.github.io/graphql/#sec-Language.Query-Document.Fields Field Specification> data Field = Field Alias Name [Argument] [Directive] SelectionSet deriving (Eq,Show) type Alias = Name -{- | <https://facebook.github.io/graphql/#sec-Language.Query-Document.Arguments Argument Specification> - - Fields are conceptually functions which return values, - and occasionally accept arguments which alter their behavior. - These arguments often map directly to function arguments within a - GraphQL server’s implementation. - --} +-- | 'Field's are conceptually functions which return values, and occasionally accept +-- 'Argument's which alter their behavior. These 'Argument's often map directly to +-- function arguments within a @GraphQL@ server’s implementation. +-- +-- <https://facebook.github.io/graphql/#sec-Language.Query-Document.Arguments Argument Specification> data Argument = Argument Name Value deriving (Eq,Show) -- * Fragments @@ -90,18 +81,15 @@ type TypeCondition = NamedType -- * Values -{- | <https://facebook.github.io/graphql/#sec-Input-Values Input Value Specification> - - Field and directive arguments accept input values - of various literal primitives; input values can be scalars, - enumeration values, lists, or input objects. - - If not defined as constant (for example, in DefaultValue), - input values can be specified as a variable. - List and inputs objects may also contain - variables (unless defined to be constant). - --} +-- | 'Field' and 'Directive' 'Arguments' accept input values of various literal +-- primitives; input values can be scalars, enumeration values, lists, or input +-- objects. +-- +-- If not defined as constant (for example, in 'DefaultValue'), input values +-- can be specified as a 'Variable'. List and inputs objects may also contain +-- 'Variable's (unless defined to be constant). +-- +-- <https://facebook.github.io/graphql/#sec-Input-Values Input Value Specification> data Value = ValueVariable Variable | ValueInt Int32 -- GraphQL Float is double precison |
