Support directives (skip and include)

Fixes #24.
This commit is contained in:
2019-12-06 22:52:24 +01:00
parent fc9ad9c4a1
commit 3c1a5c800f
6 changed files with 211 additions and 33 deletions

View File

@ -2,6 +2,8 @@
module Language.GraphQL.AST.Core
( Alias
, Argument(..)
, Arguments(..)
, Directive(..)
, Document
, Field(..)
, Fragment(..)
@ -39,6 +41,14 @@ data Field
-- | Single argument.
data Argument = Argument Name Value deriving (Eq, Show)
-- | Argument list.
newtype Arguments = Arguments (HashMap Name Value)
deriving (Eq, Show)
-- | Directive.
data Directive = Directive Name Arguments
deriving (Eq, Show)
-- | Represents fragments and inline fragments.
data Fragment
= Fragment TypeCondition (Seq Selection)