From 7c0b0ace4dacbb581669f88b83b9643a83fc797a Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 7 Oct 2020 05:24:51 +0200 Subject: Collect types once the schema is created --- tests/Test/RootOperationSpec.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/Test/RootOperationSpec.hs') diff --git a/tests/Test/RootOperationSpec.hs b/tests/Test/RootOperationSpec.hs index 33b5d3b..1921ec9 100644 --- a/tests/Test/RootOperationSpec.hs +++ b/tests/Test/RootOperationSpec.hs @@ -24,13 +24,10 @@ hatType = Out.ObjectType "Hat" Nothing [] $ pure $ Int 60 garmentSchema :: Schema IO -garmentSchema = Schema - { query = Out.ObjectType "Query" Nothing [] hatFieldResolver - , mutation = Just $ Out.ObjectType "Mutation" Nothing [] incrementFieldResolver - , subscription = Nothing - , directives = HashMap.empty - } +garmentSchema = schema queryType (Just mutationType) Nothing mempty where + queryType = Out.ObjectType "Query" Nothing [] hatFieldResolver + mutationType = Out.ObjectType "Mutation" Nothing [] incrementFieldResolver garment = pure $ Object $ HashMap.fromList [ ("circumference", Int 60) ] -- cgit v1.2.3