summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL/AST/Document.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-08-26 18:58:48 +0200
committerEugen Wissner <belka@caraus.de>2020-08-26 18:58:48 +0200
commite6a6926e18a032a129936794184b518189207648 (patch)
tree374923eca07e95edd41dd2811cfb5924c33c9fe2 /src/Language/GraphQL/AST/Document.hs
parent73555332681a3702db5e277f21a53c628c3a524f (diff)
downloadgraphql-e6a6926e18a032a129936794184b518189207648.tar.gz
Validate anonymous operation definitions
Diffstat (limited to 'src/Language/GraphQL/AST/Document.hs')
-rw-r--r--src/Language/GraphQL/AST/Document.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Language/GraphQL/AST/Document.hs b/src/Language/GraphQL/AST/Document.hs
index f60ddda..72d39bb 100644
--- a/src/Language/GraphQL/AST/Document.hs
+++ b/src/Language/GraphQL/AST/Document.hs
@@ -62,6 +62,12 @@ data Location = Location
, column :: Word
} deriving (Eq, Show)
+instance Ord Location where
+ compare (Location thisLine thisColumn) (Location thatLine thatColumn)
+ | thisLine < thatLine = LT
+ | thisLine > thatLine = GT
+ | otherwise = compare thisColumn thatColumn
+
-- ** Document
-- | GraphQL document.