From 22d4a4e583d8075fc71cddc22566f41fc5a698dc Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 7 Jul 2019 06:31:53 +0200 Subject: Change the main namespace to Language.GraphQL --- src/Data/GraphQL/AST.hs | 131 ------------------------------------------------ 1 file changed, 131 deletions(-) delete mode 100644 src/Data/GraphQL/AST.hs (limited to 'src/Data/GraphQL/AST.hs') diff --git a/src/Data/GraphQL/AST.hs b/src/Data/GraphQL/AST.hs deleted file mode 100644 index 3378655..0000000 --- a/src/Data/GraphQL/AST.hs +++ /dev/null @@ -1,131 +0,0 @@ --- | This module defines an abstract syntax tree for the @GraphQL@ language based on --- . --- --- Target AST for Parser. - -module Data.GraphQL.AST where - -import Data.Int (Int32) -import Data.List.NonEmpty (NonEmpty) -import Data.Text (Text) - --- * Name - -type Name = Text - --- * Document - -type Document = NonEmpty Definition - --- * Operations - -data Definition = DefinitionOperation OperationDefinition - | DefinitionFragment FragmentDefinition - deriving (Eq,Show) - -data OperationDefinition = OperationSelectionSet SelectionSet - | OperationDefinition OperationType - (Maybe Name) - VariableDefinitions - Directives - SelectionSet - deriving (Eq,Show) - -data OperationType = Query | Mutation deriving (Eq,Show) - --- * SelectionSet - -type SelectionSet = NonEmpty Selection - -type SelectionSetOpt = [Selection] - -data Selection = SelectionField Field - | SelectionFragmentSpread FragmentSpread - | SelectionInlineFragment InlineFragment - deriving (Eq,Show) - --- * Field - -data Field = Field (Maybe Alias) Name Arguments Directives SelectionSetOpt - deriving (Eq,Show) - -type Alias = Name - --- * Arguments - -type Arguments = [Argument] - -data Argument = Argument Name Value deriving (Eq,Show) - --- * Fragments - -data FragmentSpread = FragmentSpread Name Directives deriving (Eq,Show) - -data InlineFragment = InlineFragment (Maybe TypeCondition) Directives SelectionSet - deriving (Eq,Show) - -data FragmentDefinition = - FragmentDefinition FragmentName TypeCondition Directives SelectionSet - deriving (Eq,Show) - -type FragmentName = Name - -type TypeCondition = Name - --- Input Values - -data Value = ValueVariable Variable - | ValueInt IntValue - | ValueFloat FloatValue - | ValueString StringValue - | ValueBoolean BooleanValue - | ValueNull - | ValueEnum EnumValue - | ValueList ListValue - | ValueObject ObjectValue - deriving (Eq,Show) - -type IntValue = Int32 - --- GraphQL Float is double precison -type FloatValue = Double - -type StringValue = Text - -type BooleanValue = Bool - -type EnumValue = Name - -type ListValue = [Value] - -type ObjectValue = [ObjectField] - -data ObjectField = ObjectField Name Value deriving (Eq,Show) - --- * Variables - -type VariableDefinitions = [VariableDefinition] - -data VariableDefinition = VariableDefinition Variable Type (Maybe DefaultValue) - deriving (Eq,Show) - -type Variable = Name - -type DefaultValue = Value - --- * Input Types - -data Type = TypeNamed Name - | TypeList Type - | TypeNonNull NonNullType - deriving (Eq,Show) - -data NonNullType = NonNullTypeNamed Name - | NonNullTypeList Type - deriving (Eq,Show) - --- * Directives - -type Directives = [Directive] - -data Directive = Directive Name [Argument] deriving (Eq,Show) -- cgit v1.2.3