summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-09-29 06:21:32 +0200
committerEugen Wissner <belka@caraus.de>2020-09-29 06:21:32 +0200
commit466416d4b00ab48aaab36eea9623a8aaad366fa8 (patch)
tree409d86ca6d6851b8b84f8e1099e076a5d0692682 /tests
parent4602eb1df3a713989b155f0140ff8909eb0370cf (diff)
downloadgraphql-466416d4b00ab48aaab36eea9623a8aaad366fa8.tar.gz
Validate directives are defined
Diffstat (limited to 'tests')
-rw-r--r--tests/Language/GraphQL/ValidateSpec.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Language/GraphQL/ValidateSpec.hs b/tests/Language/GraphQL/ValidateSpec.hs
index 84bdfba..fd53145 100644
--- a/tests/Language/GraphQL/ValidateSpec.hs
+++ b/tests/Language/GraphQL/ValidateSpec.hs
@@ -576,3 +576,17 @@ spec =
, locations = [AST.Location 4 63]
}
in validate queryString `shouldBe` [expected]
+
+ it "rejects undefined directives" $
+ let queryString = [r|
+ {
+ dog {
+ isHousetrained(atOtherHomes: true) @ignore(if: true)
+ }
+ }
+ |]
+ expected = Error
+ { message = "Unknown directive \"@ignore\"."
+ , locations = [AST.Location 4 54]
+ }
+ in validate queryString `shouldBe` [expected]