summaryrefslogtreecommitdiff
path: root/tests/Test/StarWars
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Test/StarWars')
-rw-r--r--tests/Test/StarWars/QueryTests.hs30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/Test/StarWars/QueryTests.hs b/tests/Test/StarWars/QueryTests.hs
index 1f7dc0d..5ffb4b0 100644
--- a/tests/Test/StarWars/QueryTests.hs
+++ b/tests/Test/StarWars/QueryTests.hs
@@ -165,4 +165,34 @@ test = testGroup "Star Wars Query Tests"
-- }
-- |]
-- $ object ["human" .= Aeson.Null]
+ , testCase "Luke with alias" . testQuery
+ [r| query FetchLukeAliased {
+ luke: human(id: "1000") {
+ name
+ }
+ }
+ |]
+ $ object [
+ "luke" .= object [
+ "name" .= ("Luke Skywalker" :: Text)
+ ]
+ ]
+ , testCase "Luke and Leia aliased" . testQuery
+ [r| query FetchLukeAndLeiaAliased {
+ luke: human(id: "1000") {
+ name
+ }
+ leia: human(id: "1003") {
+ name
+ }
+ }
+ |]
+ $ object [
+ "luke" .= object [
+ "name" .= ("Luke Skywalker" :: Text)
+ ]
+ , "leia" .= object [
+ "name" .= ("Leia Organa" :: Text)
+ ]
+ ]
]