summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL/AST/Document.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-09-21 07:28:40 +0200
committerEugen Wissner <belka@caraus.de>2020-09-21 07:28:40 +0200
commit3e393004ae03a717218a805043d9237ca29ac947 (patch)
treedcff103322dc100eb83ba17f59f504b28b69a191 /src/Language/GraphQL/AST/Document.hs
parent38c3097bcf2d3c92a180c5d328cfb15ef80f0b95 (diff)
downloadgraphql-3e393004ae03a717218a805043d9237ca29ac947.tar.gz
Validate all variables are defined
Diffstat (limited to 'src/Language/GraphQL/AST/Document.hs')
-rw-r--r--src/Language/GraphQL/AST/Document.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Language/GraphQL/AST/Document.hs b/src/Language/GraphQL/AST/Document.hs
index b03b905..1875e49 100644
--- a/src/Language/GraphQL/AST/Document.hs
+++ b/src/Language/GraphQL/AST/Document.hs
@@ -24,6 +24,7 @@ module Language.GraphQL.AST.Document
, Location(..)
, Name
, NamedType
+ , Node(..)
, NonNullType(..)
, ObjectField(..)
, OperationDefinition(..)
@@ -70,6 +71,9 @@ instance Ord Location where
| thisLine > thatLine = GT
| otherwise = compare thisColumn thatColumn
+-- | Contains some tree node with a location.
+data Node a = Node a Location deriving (Eq, Show)
+
-- ** Document
-- | GraphQL document.
@@ -190,7 +194,7 @@ data FragmentSpread = FragmentSpread Name [Directive] Location
-- @
--
-- Here "id" is an argument for the field "user" and its value is 4.
-data Argument = Argument Name Value Location deriving (Eq,Show)
+data Argument = Argument Name (Node Value) Location deriving (Eq, Show)
-- ** Fragments