summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL/AST/Document.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-07-08 08:16:14 +0200
committerEugen Wissner <belka@caraus.de>2020-07-08 08:17:55 +0200
commitc9e265f72c301a543091d58ec10863c66b279fd0 (patch)
treeffe05b502fc20ce163130b7e3d383da19d76af6d /src/Language/GraphQL/AST/Document.hs
parentb2d473de8dac0f85f11a8f9985d1a9a4dfee03ab (diff)
downloadgraphql-c9e265f72c301a543091d58ec10863c66b279fd0.tar.gz
Return parser error location in a list
An error can have multiple locations which are returned in a listt with key "locations".
Diffstat (limited to 'src/Language/GraphQL/AST/Document.hs')
-rw-r--r--src/Language/GraphQL/AST/Document.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Language/GraphQL/AST/Document.hs b/src/Language/GraphQL/AST/Document.hs
index 430e92a..ed473b7 100644
--- a/src/Language/GraphQL/AST/Document.hs
+++ b/src/Language/GraphQL/AST/Document.hs
@@ -19,6 +19,7 @@ module Language.GraphQL.AST.Document
, FragmentDefinition(..)
, ImplementsInterfaces(..)
, InputValueDefinition(..)
+ , Location(..)
, Name
, NamedType
, NonNullType(..)
@@ -55,6 +56,12 @@ import Language.GraphQL.AST.DirectiveLocation
-- | Name.
type Name = Text
+-- | Error location, line and column.
+data Location = Location
+ { line :: Word
+ , column :: Word
+ } deriving (Eq, Show)
+
-- ** Document
-- | GraphQL document.