summaryrefslogtreecommitdiff
path: root/tests/Language
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2021-04-12 07:09:39 +0200
committerEugen Wissner <belka@caraus.de>2021-04-12 07:09:39 +0200
commit5654b78935b38a88f3dd4998eb8667a2695aea14 (patch)
treea81993de154da6fd7b4f56f176f38ea4fe2df2ac /tests/Language
parentd6dda14cfd1486c6a5648a0a1086a5b5302f1954 (diff)
downloadgraphql-5654b78935b38a88f3dd4998eb8667a2695aea14.tar.gz
Traverse input object properties once
Diffstat (limited to 'tests/Language')
-rw-r--r--tests/Language/GraphQL/Validate/RulesSpec.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Language/GraphQL/Validate/RulesSpec.hs b/tests/Language/GraphQL/Validate/RulesSpec.hs
index ce12138..02b14ae 100644
--- a/tests/Language/GraphQL/Validate/RulesSpec.hs
+++ b/tests/Language/GraphQL/Validate/RulesSpec.hs
@@ -929,3 +929,18 @@ spec =
, locations = [AST.Location 4 54]
}
in validate queryString `shouldBe` [expected]
+
+ it "validates input object properties once" $
+ let queryString = [r|
+ {
+ findDog(complex: { name: 3 }) {
+ name
+ }
+ }
+ |]
+ expected = Error
+ { message =
+ "Value 3 cannot be coerced to type \"!String\"."
+ , locations = [AST.Location 3 46]
+ }
+ in validate queryString `shouldBe` [expected]