summaryrefslogtreecommitdiff
path: root/tests/Language/GraphQL/Validate/RulesSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Language/GraphQL/Validate/RulesSpec.hs')
-rw-r--r--tests/Language/GraphQL/Validate/RulesSpec.hs18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/Language/GraphQL/Validate/RulesSpec.hs b/tests/Language/GraphQL/Validate/RulesSpec.hs
index 02b14ae..f75aef6 100644
--- a/tests/Language/GraphQL/Validate/RulesSpec.hs
+++ b/tests/Language/GraphQL/Validate/RulesSpec.hs
@@ -847,7 +847,7 @@ spec =
}
in validate queryString `shouldBe` [expected]
- context "providedRequiredArgumentsRule" $
+ context "providedRequiredArgumentsRule" $ do
it "checks for (non-)nullable arguments" $
let queryString = [r|
{
@@ -944,3 +944,19 @@ spec =
, locations = [AST.Location 3 46]
}
in validate queryString `shouldBe` [expected]
+
+ it "checks for required list members" $
+ let queryString = [r|
+ {
+ cat {
+ doesKnowCommands(catCommands: [null])
+ }
+ }
+ |]
+ expected = Error
+ { message =
+ "List of non-null values of type \"CatCommand\" \
+ \cannot contain null values."
+ , locations = [AST.Location 4 54]
+ }
+ in validate queryString `shouldBe` [expected]