summaryrefslogtreecommitdiff
path: root/tests/Language
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Language')
-rw-r--r--tests/Language/GraphQL/ValidateSpec.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Language/GraphQL/ValidateSpec.hs b/tests/Language/GraphQL/ValidateSpec.hs
index 53f63aa..dfc3a4d 100644
--- a/tests/Language/GraphQL/ValidateSpec.hs
+++ b/tests/Language/GraphQL/ValidateSpec.hs
@@ -413,3 +413,18 @@ spec =
, locations = [AST.Location 7 15]
}
in validate queryString `shouldBe` Seq.fromList [error1, error2]
+
+ it "rejects duplicate field arguments" $ do
+ let queryString = [r|
+ {
+ dog {
+ isHousetrained(atOtherHomes: true, atOtherHomes: true)
+ }
+ }
+ |]
+ expected = Error
+ { message =
+ "There can be only one argument named \"atOtherHomes\"."
+ , locations = [AST.Location 4 34, AST.Location 4 54]
+ }
+ in validate queryString `shouldBe` Seq.singleton expected