summaryrefslogtreecommitdiff
path: root/tests/Test/StarWars
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-05-10 18:32:58 +0200
committerEugen Wissner <belka@caraus.de>2020-05-10 18:32:58 +0200
commit500cff20eb21b28359400b99a4dfda4009229b95 (patch)
tree37ccfe12ef99c29905934cde2339dad6a3900279 /tests/Test/StarWars
parent387d158bd1192e459d06c29e2ae923b7b30ffa4a (diff)
downloadgraphql-500cff20eb21b28359400b99a4dfda4009229b95.tar.gz
Separate Query and Mutation resolvers
Fixes #33 .
Diffstat (limited to 'tests/Test/StarWars')
-rw-r--r--tests/Test/StarWars/Schema.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/Test/StarWars/Schema.hs b/tests/Test/StarWars/Schema.hs
index 7986a30..cd25599 100644
--- a/tests/Test/StarWars/Schema.hs
+++ b/tests/Test/StarWars/Schema.hs
@@ -10,8 +10,11 @@ module Test.StarWars.Schema
import Control.Monad.Trans.Except (throwE)
import Control.Monad.Trans.Class (lift)
import Data.Functor.Identity (Identity)
+import Data.HashMap.Strict (HashMap)
+import qualified Data.HashMap.Strict as HashMap
import Data.List.NonEmpty (NonEmpty(..))
import Data.Maybe (catMaybes)
+import Data.Text (Text)
import qualified Language.GraphQL.Schema as Schema
import Language.GraphQL.Trans
import qualified Language.GraphQL.Type as Type
@@ -19,8 +22,8 @@ import Test.StarWars.Data
-- See https://github.com/graphql/graphql-js/blob/master/src/__tests__/starWarsSchema.js
-schema :: NonEmpty (Schema.Resolver Identity)
-schema = hero :| [human, droid]
+schema :: HashMap Text (NonEmpty (Schema.Resolver Identity))
+schema = HashMap.singleton "Query" $ hero :| [human, droid]
hero :: Schema.Resolver Identity
hero = Schema.object "hero" $ do