From 3d97b3e2ff7cc6d5126c8c6c8b66eed3c1fe010b Mon Sep 17 00:00:00 2001 From: Danny Navarro Date: Mon, 21 Sep 2015 10:05:09 +0200 Subject: Introduce `Node` data type to simplify `OperationDefinition` Thanks to @swolchok for the suggestion. --- Data/GraphQL/AST.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Data/GraphQL/AST.hs') diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs index 45bc519..cc631e6 100644 --- a/Data/GraphQL/AST.hs +++ b/Data/GraphQL/AST.hs @@ -16,12 +16,12 @@ data Definition = DefinitionOperation OperationDefinition | DefinitionType TypeDefinition deriving (Eq,Show) -data OperationDefinition = - Query Name [VariableDefinition] [Directive] SelectionSet - | Mutation Name [VariableDefinition] [Directive] SelectionSet - -- Not official yet - -- -- | Subscription Name [VariableDefinition] [Directive] SelectionSet - deriving (Eq,Show) +data OperationDefinition = Query Node + | Mutation Node + deriving (Eq,Show) + +data Node = Node Name [VariableDefinition] [Directive] SelectionSet + deriving (Eq,Show) data VariableDefinition = VariableDefinition Variable Type (Maybe DefaultValue) deriving (Eq,Show) -- cgit v1.2.3