Validate fragments are input types

This commit is contained in:
2020-09-20 06:59:27 +02:00
parent 21a7d9cce4
commit 38c3097bcf
6 changed files with 80 additions and 36 deletions

View File

@ -456,3 +456,18 @@ spec =
, locations = [AST.Location 2 39, AST.Location 2 63]
}
in validate queryString `shouldBe` Seq.singleton expected
it "rejects non-input types as variables" $
let queryString = [r|
query takesDogBang($dog: Dog!) {
dog {
isHousetrained(atOtherHomes: $dog)
}
}
|]
expected = Error
{ message =
"Variable \"$dog\" cannot be non-input type \"Dog\"."
, locations = [AST.Location 2 34]
}
in validate queryString `shouldBe` Seq.singleton expected