diff options
| author | Danny Navarro <j@dannynavarro.net> | 2015-09-14 11:49:20 +0200 |
|---|---|---|
| committer | Danny Navarro <j@dannynavarro.net> | 2015-09-14 12:15:04 +0200 |
| commit | 62adfd89cdb8cafc7ff75b8680456d62b02c6d50 (patch) | |
| tree | 0ae7937e15b2024824bfd2f88d0751b0cce1e2a2 /Data/GraphQL/AST.hs | |
| parent | b20607904737f49a85a23b3e2aaac89db3efa8c0 (diff) | |
| download | graphql-62adfd89cdb8cafc7ff75b8680456d62b02c6d50.tar.gz | |
Several improvements to the parser
- Add token combinator to simplify whitespace handling.
- Simplify whiteSpace parsers.
- Add `optempty` to handle pure mempty cases. `empty /= pure mempty`.
- Use `between` combinators for brackets, braces and parens.
This also includes small adjustments to the AST.
Diffstat (limited to 'Data/GraphQL/AST.hs')
| -rw-r--r-- | Data/GraphQL/AST.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs index 1625f12..0a09671 100644 --- a/Data/GraphQL/AST.hs +++ b/Data/GraphQL/AST.hs @@ -22,12 +22,12 @@ data OperationDefinition = -- -- | Subscription Name [VariableDefinition] [Directive] SelectionSet deriving (Eq,Show) -data VariableDefinition = VariableDefinition Variable Type DefaultValue +data VariableDefinition = VariableDefinition Variable Type (Maybe DefaultValue) deriving (Eq,Show) newtype Variable = Variable Name deriving (Eq,Show) -newtype SelectionSet = SelectionSet [Selection] deriving (Eq,Show) +type SelectionSet = [Selection] data Selection = SelectionField Field | SelectionFragmentSpread FragmentSpread @@ -118,7 +118,7 @@ data FieldDefinition = FieldDefinition Name ArgumentsDefinition Type type ArgumentsDefinition = [InputValueDefinition] -data InputValueDefinition = InputValueDefinition Name Type DefaultValue +data InputValueDefinition = InputValueDefinition Name Type (Maybe DefaultValue) deriving (Eq,Show) data InterfaceTypeDefinition = InterfaceTypeDefinition Name [FieldDefinition] |
