diff options
Diffstat (limited to 'tests/Language/GraphQL/ValidateSpec.hs')
| -rw-r--r-- | tests/Language/GraphQL/ValidateSpec.hs | 14 |
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] |
