Initial support for aliases in execute

This commit is contained in:
Danny Navarro
2016-02-17 12:59:35 +01:00
parent a0f12455c5
commit 7131d1c142
2 changed files with 35 additions and 2 deletions

View File

@ -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)
]
]
]