diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-10-07 05:24:51 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-10-07 05:24:51 +0200 |
| commit | 7c0b0ace4dacbb581669f88b83b9643a83fc797a (patch) | |
| tree | ec9e5a55764c63203f09fc5c9b60990cd4b2aac7 /tests/Test/RootOperationSpec.hs | |
| parent | a91bc7f2d218ea2df308d3968587b60351625150 (diff) | |
| download | graphql-7c0b0ace4dacbb581669f88b83b9643a83fc797a.tar.gz | |
Collect types once the schema is created
Diffstat (limited to 'tests/Test/RootOperationSpec.hs')
| -rw-r--r-- | tests/Test/RootOperationSpec.hs | 9 |
1 files changed, 3 insertions, 6 deletions
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) ] |
