morpheus-graphql-0.3.0
Pre-release
Pre-release
Added
-
user can import GraphQL Document and generate types with it.
importGQLDocument "API.gql"
this will generate types defined in
API.gql
Fixed
-
String
defined in GQLDcoument will be converted toText
by template haskell -
importGQLDocument
andgqlDocument
supports Mutation, Subscription and Resolvers with custom Monadfor example. if we have:
type Deity { name: String! power: Power! }
where
Power
is another object defined by gql schema.
template haskell will represent this type as:data Deity m = Deity { name :: () -> m Text, power :: () -> m (Power m) }
where
m
is resolver Monad. -
importGQLDocumentWithNamespace
generates namespaced haskell records. so that you have no more problem with name collision.
from this gql type:type Deity { name: (id:Int)String! power: Power! }
will be generated.
data Deity m = Deity { deityName :: DeityNameArgs -> m Text, deityPower :: () -> m (Power m) } data DeityNameArgs = DeityNameArgs { deityNameArgsId :: Int }
Changed
-
GQLType
is mandatory for every GQL Type (including Query, Mutation and Subscription) -
subscription Resolver changed
from:
Subscription {newDeity = \args -> Event {channels = [ChannelA], content = newDeityResolver } }
to:
Subscription {newDeity = \args -> SubResolver {subChannels = [ChannelA], subResolver = newDeityResolver } }