diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-09-17 10:33:37 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-09-17 10:33:37 +0200 |
| commit | 497b93c41b2534ec2b92b49e93267178417bef56 (patch) | |
| tree | 58e05d08b0d5af77028daaa00142b610df83bb25 /tests | |
| parent | 6e644c5b4b3a8284ed0a1f0a84fef775f70a68d6 (diff) | |
| download | graphql-497b93c41b2534ec2b92b49e93267178417bef56.tar.gz | |
Validate arguments have unique names
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Language/GraphQL/ValidateSpec.hs | 15 |
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 |
