diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-05-26 11:13:55 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-05-26 11:13:55 +0200 |
| commit | c06d0b8e95ea4b87eab69da085cb32dbd052c1f0 (patch) | |
| tree | 12bcabe076d873f2676b33c6f510dba566352756 /tests | |
| parent | 61dbe6c7280a899b485146aa8557948417e78360 (diff) | |
| download | graphql-c06d0b8e95ea4b87eab69da085cb32dbd052c1f0.tar.gz | |
Add Union and Interface type definitions
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Test/DirectiveSpec.hs | 2 | ||||
| -rw-r--r-- | tests/Test/FragmentSpec.hs | 6 | ||||
| -rw-r--r-- | tests/Test/RootOperationSpec.hs | 6 | ||||
| -rw-r--r-- | tests/Test/StarWars/Schema.hs | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/tests/Test/DirectiveSpec.hs b/tests/Test/DirectiveSpec.hs index 9ff8d8c..67264c2 100644 --- a/tests/Test/DirectiveSpec.hs +++ b/tests/Test/DirectiveSpec.hs @@ -17,7 +17,7 @@ experimentalResolver :: Schema IO experimentalResolver = Schema { query = queryType, mutation = Nothing } where resolver = pure $ Out.Int 5 - queryType = Out.ObjectType "Query" Nothing + queryType = Out.ObjectType "Query" Nothing [] $ HashMap.singleton "experimentalField" $ Out.Field Nothing (Out.NamedScalarType int) mempty resolver diff --git a/tests/Test/FragmentSpec.hs b/tests/Test/FragmentSpec.hs index 2fb12d2..1f765a4 100644 --- a/tests/Test/FragmentSpec.hs +++ b/tests/Test/FragmentSpec.hs @@ -51,14 +51,14 @@ hasErrors (Object object') = HashMap.member "errors" object' hasErrors _ = True shirtType :: Out.ObjectType IO -shirtType = Out.ObjectType "Shirt" Nothing +shirtType = Out.ObjectType "Shirt" Nothing [] $ HashMap.singleton resolverName $ Out.Field Nothing (Out.NamedScalarType string) mempty resolve where (Schema.Resolver resolverName resolve) = size hatType :: Out.ObjectType IO -hatType = Out.ObjectType "Hat" Nothing +hatType = Out.ObjectType "Hat" Nothing [] $ HashMap.singleton resolverName $ Out.Field Nothing (Out.NamedScalarType int) mempty resolve where @@ -69,7 +69,7 @@ toSchema (Schema.Resolver resolverName resolve) = Schema { query = queryType, mutation = Nothing } where unionMember = if resolverName == "Hat" then hatType else shirtType - queryType = Out.ObjectType "Query" Nothing + queryType = Out.ObjectType "Query" Nothing [] $ HashMap.singleton resolverName $ Out.Field Nothing (Out.NamedObjectType unionMember) mempty resolve diff --git a/tests/Test/RootOperationSpec.hs b/tests/Test/RootOperationSpec.hs index a20dc51..291b5f2 100644 --- a/tests/Test/RootOperationSpec.hs +++ b/tests/Test/RootOperationSpec.hs @@ -15,7 +15,7 @@ import qualified Language.GraphQL.Type.Out as Out import Language.GraphQL.Type.Schema hatType :: Out.ObjectType IO -hatType = Out.ObjectType "Hat" Nothing +hatType = Out.ObjectType "Hat" Nothing [] $ HashMap.singleton resolverName $ Out.Field Nothing (Out.NamedScalarType int) mempty resolve where @@ -24,8 +24,8 @@ hatType = Out.ObjectType "Hat" Nothing schema :: Schema IO schema = Schema - (Out.ObjectType "Query" Nothing hatField) - (Just $ Out.ObjectType "Mutation" Nothing incrementField) + (Out.ObjectType "Query" Nothing [] hatField) + (Just $ Out.ObjectType "Mutation" Nothing [] incrementField) where garment = pure $ Schema.object [ Schema.Resolver "circumference" $ pure $ Out.Int 60 diff --git a/tests/Test/StarWars/Schema.hs b/tests/Test/StarWars/Schema.hs index f32c031..e58d33b 100644 --- a/tests/Test/StarWars/Schema.hs +++ b/tests/Test/StarWars/Schema.hs @@ -25,7 +25,7 @@ import Test.StarWars.Data schema :: Schema Identity schema = Schema { query = queryType, mutation = Nothing } where - queryType = Out.ObjectType "Query" Nothing $ HashMap.fromList + queryType = Out.ObjectType "Query" Nothing [] $ HashMap.fromList [ ("hero", Out.Field Nothing (Out.NamedScalarType string) mempty hero) , ("human", Out.Field Nothing (Out.NamedScalarType string) mempty human) , ("droid", Out.Field Nothing (Out.NamedScalarType string) mempty droid) |
