Add definition module

This commit is contained in:
2019-12-26 13:00:47 +01:00
parent e3a495a778
commit 56d88310df
8 changed files with 164 additions and 30 deletions

View File

@ -5,10 +5,8 @@
module Language.GraphQL.AST
( Alias
, Argument(..)
, Definition(..)
, Directive(..)
, Document
, ExecutableDefinition(..)
, Directive(..)
, FragmentDefinition(..)
, Name
, NonNullType(..)
@ -28,15 +26,6 @@ import Data.Int (Int32)
import Data.List.NonEmpty (NonEmpty)
import Data.Text (Text)
-- * Document
-- | GraphQL document.
type Document = NonEmpty Definition
-- | All kinds of definitions that can occur in a GraphQL document.
newtype Definition = ExecutableDefinition ExecutableDefinition
deriving (Eq, Show)
-- | Name
type Name = Text
@ -74,8 +63,6 @@ type SelectionSet = NonEmpty Selection
-- | Field selection.
type SelectionSetOpt = [Selection]
-- * Field
-- | Single GraphQL field.
--
-- The only required property of a field is its name. Optionally it can also