From 7131d1c142dc9c9fc5331ee3ebf90cf9154f85d9 Mon Sep 17 00:00:00 2001 From: Danny Navarro Date: Wed, 17 Feb 2016 12:59:35 +0100 Subject: Initial support for aliases in `execute` --- tests/Test/StarWars/QueryTests.hs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/Test') 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) + ] + ] ] -- cgit v1.2.3