forked from OSS/graphql
Add homePlanet to test schema
This commit is contained in:
parent
afb2fc4eb9
commit
aa66236081
tests/Test/StarWars
@ -70,7 +70,7 @@ luke' = Human
|
|||||||
, _friends = ["1002","1003","2000","2001"]
|
, _friends = ["1002","1003","2000","2001"]
|
||||||
, _appearsIn = [4,5,6]
|
, _appearsIn = [4,5,6]
|
||||||
}
|
}
|
||||||
, homePlanet = "Tatoonie"
|
, homePlanet = "Tatooine"
|
||||||
}
|
}
|
||||||
|
|
||||||
vader :: Human
|
vader :: Human
|
||||||
|
@ -18,8 +18,6 @@ import Test.StarWars.Schema
|
|||||||
-- * Test
|
-- * Test
|
||||||
-- See https://github.com/graphql/graphql-js/blob/master/src/__tests__/starWarsQueryTests.js
|
-- See https://github.com/graphql/graphql-js/blob/master/src/__tests__/starWarsQueryTests.js
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test :: TestTree
|
test :: TestTree
|
||||||
test = testGroup "Star Wars Query Tests"
|
test = testGroup "Star Wars Query Tests"
|
||||||
[ testGroup "Basic Queries"
|
[ testGroup "Basic Queries"
|
||||||
@ -206,7 +204,7 @@ test = testGroup "Star Wars Query Tests"
|
|||||||
, "leia" .= object [leiaName]
|
, "leia" .= object [leiaName]
|
||||||
]]
|
]]
|
||||||
, testGroup "Fragments for complex queries"
|
, testGroup "Fragments for complex queries"
|
||||||
[ testCase "Aliases to query for duplicate content" . testQuery
|
[ testCase "Aliases to query for duplicate content" . testQuery
|
||||||
[r| query DuplicateFields {
|
[r| query DuplicateFields {
|
||||||
luke: human(id: "1000") {
|
luke: human(id: "1000") {
|
||||||
name
|
name
|
||||||
|
@ -42,5 +42,6 @@ character char =
|
|||||||
, Schema.scalar "name" $ name char
|
, Schema.scalar "name" $ name char
|
||||||
, Schema.array "friends" $ character <$> getFriends char
|
, Schema.array "friends" $ character <$> getFriends char
|
||||||
, Schema.enum "appearsIn" . traverse getEpisode $ appearsIn char
|
, Schema.enum "appearsIn" . traverse getEpisode $ appearsIn char
|
||||||
, Schema.scalar "secretBackstory" $ secretBackstory char
|
, Schema.scalar "secretBackstory" $ secretBackstory char
|
||||||
|
, Schema.scalar "homePlanet" $ either mempty homePlanet char
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user