Combine Resolver and ActionT in ResolverT

This commit is contained in:
2020-06-29 13:14:23 +02:00
parent 9798b08b4c
commit 705e506c13
13 changed files with 127 additions and 107 deletions

View File

@ -15,8 +15,9 @@ import qualified Language.GraphQL.Type.Out as Out
hatType :: Out.ObjectType IO
hatType = Out.ObjectType "Hat" Nothing []
$ HashMap.singleton "circumference"
$ Out.Resolver (Out.Field Nothing (Out.NamedScalarType int) mempty)
$ pure $ Int 60
$ Out.Field Nothing (Out.NamedScalarType int) mempty
$ pure
$ Int 60
schema :: Schema IO
schema = Schema
@ -27,10 +28,10 @@ schema = Schema
[ ("circumference", Int 60)
]
incrementField = HashMap.singleton "incrementCircumference"
$ Out.Resolver (Out.Field Nothing (Out.NamedScalarType int) mempty)
$ Out.Field Nothing (Out.NamedScalarType int) mempty
$ pure $ Int 61
hatField = HashMap.singleton "garment"
$ Out.Resolver (Out.Field Nothing (Out.NamedObjectType hatType) mempty) garment
$ Out.Field Nothing (Out.NamedObjectType hatType) mempty garment
spec :: Spec
spec =