All Versions
Latest Version
Avg Release Cycle
16 days
Latest Release

Changelog History
Page 1

  • v0.17.0 Changes

    ๐Ÿ†• new features

    • ๐Ÿ‘ (issue #543 & #558): GQLTypeOptions supports new option typeNameModifier. Before the schema failed if you wanted to use the same type for input and output, and the user had no control over the eventual GraphQL type name of the generated schema. Now with this option you can provide a function of type Bool -> String -> String that generates a custom GraphQL type name. The first argument is a Bool that is True if the type is an input, and False otherwise. The second argument is a String representing the initial, auto-generated GraphQL type name. The function returns the desired type name. thanks @nalchevanidze & @bradsherman

    e.g this schema will not fail. morpheus will generate types: Deity and InputDeity

      data Deity = Deity
      { name :: Text,
        age :: Int
      deriving (Show, Generic)
      deityTypeNameModifier isInput original
        | isInput = "Input" ++ original
        | otherwise = original
      instance GQLType Deity where
        typeOptions _ opt = opt {typeNameModifier = deityTypeNameModifier}
      newtype DeityArgs = DeityArgs
        { input :: Deity
        deriving (Show, Generic, GQLType)
      newtype Query (m :: * -> *) = Query
        { deity :: DeityArgs -> m Deity
        deriving (Generic, GQLType)
    • ๐Ÿ”ฆ exposed EncodeWrapper and DecodeWrapper type-classes.

    ๐Ÿ’ฅ Breaking Changes

    • Map k v is now represented as just [Pair k v]
    • GQLScalar was replaced with EncodeScalar and DecodeScalar type-classes.
    • Exclusive input objects: Sum types used as input types are represented as input objects, where only one field must have a value. Namespaced constructors (i.e., where referenced type name concatenated with union type name is equal to constructor name) are unpacked. Furthermore, empty constructors are represented as fields with the unit type.

    for example:

          data Device
            | DevicePC PC
            | Laptops { macAdress :: ID }
            | Smartphone

    this type will generate the following SDL:

      enum Unit {
      input Laptop {
        macAdress: ID
      input Device {
        PC: PC
        Laptops: Laptops
        Smartphone: Unit
    • For each nullary constructor will be defined GQL object type with a single field _: Unit (since GraphQL does not allow empty objects).

    for example:

      data Person = Client { name :: Text } | Accountant | Developer

    this type will generate the following SDL:

      enum Unit {
      type Student {
        name: String!
      type Accountant {
        _: Unit!
      type Developer {
        _: Unit!
      union Person = Client | Accountant | Developer
    • ๐Ÿ”„ changed signature of GQLType.typeOptions from f a -> GQLTypeOptions to f a -> GQLTypeOptions -> GQLTypeOptions.

    now you can write:

        typeOptions _ options = options { fieldLabelModifier = <my function> }

    0๏ธโƒฃ whre argument options is default gql options.

    • deexposed constructor of GQLTypeOptions.
    • Type name for parametrized types like One (Two Three) will be generated directly, concatenating them OneTwoThree instead of One_Two_Three.
    • Haskell Float was renamed to custom scalar type Float32.
    • Haskell Double now represents GraphQL Float.

    Minor Changes

    • ๐Ÿ—„ deprecated kinds INPUT, ENUM and OUTPUT in favor of more generalized kind TYPE. now you can derive INPUT, ENUM and OUTPUT automatically with deriving (Generic, GQLType).
    • more likely to rebuild when a file loaded by importGQLDocument or importGQLDocumentWithNamespace is changed
  • v0.16.0 Changes

    November 05, 2020


    ๐Ÿ’ฅ Breaking changes

    • subscriptions are extracted in morpheus-graphql-subscriptions.
    • ๐Ÿšš Event, httpPubApp and webSocketsApp moved Data.Morpheus.Subscriptions

    ๐Ÿ†• New Features

    Data.Morpheus.Subscriptions provides:

    • runPubApp: generalized version of httpPubApp

    - runSubApp: generalized version of webSocketsApp

    ๐Ÿ†• New encode and decode instances for Set, NonEmpty, Seq and Vector
    Set and NonEmpty throw a graphql error when a duplicate is found (Set)
    or when an empty list is sent (NonEmpty).
    Beware : Right now, all these types are advertised as lists in the introspection query.
    This is something we are trying to change by submitting a proposal to the graphql spec.


    ๐Ÿ’ฅ Breaking Changes

    signature changes:

    a -> Text
    โœ… to a -> ByteString

    ๐Ÿ“œ parseTypeSystemDefinition :
    Text -> Eventless (Schema VALID)
    โœ… to ByteString -> Eventless (Schema VALID)

    ๐Ÿ“œ parseTypeDefinitions:
    Text -> Eventless [TypeDefinition ANY CONST]
    โœ… to ByteString -> Eventless [TypeDefinition ANY CONST]

    Minor Changes

    • ๐ŸŽ parser performance optimization


    Minor Changes

    • ๐ŸŽ parser performance optimization
    • ๐Ÿ›  fixed #514: json parser selects interface type as fallback
    • ๐Ÿ›  fixed #546: defineByIntrospectionFile support custom (Query,Mutation,Subscription)
  • v0.15.1 Changes

    September 12, 2020

    ๐Ÿ“œ relaxed upper boundary of megaparsec up to 10.0.0

  • v0.15.0 Changes

    September 12, 2020

    ๐Ÿ†• new features

    • custom operation root types: e.g
      RootResolver IO () MyQuery MyMutation Undefined

    creates app with:

      schema {
        query: MyQuery
        mutation: MyMutation
    • type : App event m and deriveApp
      app :: App EVENT IO
      app = runApp (deriveApp root)
      api :: a -> IO b
      api = runApp (deriveApp root)
    • ๐Ÿ‘ App supports semigroup(schema Stitching): if whe have two graphql apps
      mergedApi :: a -> m b
      mergedApi = runApp (deriveApp root <> deriveApp root2)
    • GQLType exposes typeOptions to modify labels: typeOptions :: f a -> GQLTypeOptions


       GQLTypeOptions {
          fieldLabelModifier :: String -> String,
          constructorTagModifier :: String -> String
    • you can use GQLType.getDescriptions to document field or enum Values

    • with importGQLDocumentWithNamespace now you can use Enums with Colliding Values:

      enum X {
      enum Y {

    they will be namespaced to. XA and YA

    ๐Ÿ’ฅ Breaking Changes

    • importGQLDocumentWithNamespace they will be namespaced enum Values
    • Argument types must have GQLType instances
    • in Data.Morpheus.Server:

      • removed subscriptionApp
      • changed webSocketsApp type to App e m -> m (ServerApp, e -> m ())
      • changed httpPubApp type to [e -> m ()] -> App e m -> a -> m b
    • โœ‚ removed Stream from Data.Morpheus.Types

    • โœ‚ removed class Interpreter, interpreter is now just regular function.

      interpreter = runApp . deriveApp

    Minor Changes

    • ๐Ÿ”จ internal refactoring
  • v0.14.1 Changes

    August 16, 2020
    • ๐Ÿ›  fixed Build error during testing #5602
  • v0.14.0 Changes

    August 15, 2020


    ๐Ÿ†• new features

    • ๐Ÿ‘ query validation supports interfaces
    • debugInterpreter: displays internal context on grahql errors
    • compileTimeSchemaValidation :
      morpheus validates schema at runtime (after the schema derivation).
      to be ensure that only correct api is compiled.
      we can use template haskell method compileTimeSchemaValidation

      import Morpheus.Graphql.Server(compileTimeSchemaValidation)_validateSchema :: ()_validateSchema = $(compileTimeSchemaValidation (Identity gqlRoot))

    directive Validation for Document (TypeSystem).

    ๐Ÿ‘Œ supports of block string values. e.g:

    query { createDeity( name: """ powerqwe bla \n sd blu \\ dete""" ) { name } }

    Data.Morpheus.Document exposes RootResolverConstraint

    Data.Morpheus.Server exposes httpPlayground

    ๐Ÿ‘ httpPubApp supports GQLRequest -> GQLResponse

    ๐Ÿ‘ morpheus-graphql-core support of schema. issue #412

    schema { query: Query}

    note that this does not affect morpheus-graphql-server at all. since it has its own schema derivation. you still need to provide:

    rootResolver :: RootResolver () IO Query Undefined UndefinedrootResolver = RootResolver \<resolvers ...\>

    ๐Ÿ‘ Subscription Resolver supports Monad.

    nested Subscription Resolvers.

    ๐Ÿ’ฅ Breaking Changes

    • Context' renamed toResolverContext'
    • ๐Ÿ”จ internal refactoring: changed AST
    • root subscribtion fields must be wrapped with SubscriptionField. e.g:

      data Subscription (m :: * -> *) = Subscription{ newDeity :: SubscriptionField (m Deity), newHuman :: HumanArgs -> SubscriptionField (m Human) }deriving (Generic)

    • signature of subscribe is changed. now you can use it as followed:

      resolveNewAdress :: SubscriptionField (ResolverS EVENT IO Address) resolveNewAdress = subscribe ADDRESS $ do-- executed only once-- immediate response on failures requireAuthorized pure $ (Event _ content) -> do-- exectues on every event lift (getDBAddress content)

    • โœ‚ removed from Data.Morpheus.Types

      • SubField
      • ComposedSubField


    ๐Ÿ†• new features

    ๐Ÿ‘Œ supports interfaces.

    ๐Ÿ‘Œ supports of block string values.

    ๐Ÿ‘Œ support of schema. issue #412

    schema { query: MyQuery}

    generated types have instance of class Eq

    ๐Ÿ’ฅ breaking changes

    • custom scalars Should Provide instance of class Eq

    0.13.0 - 22.06.2020


    ๐Ÿ†• new features

    ๐Ÿ‘ query validation supports interfaces

    ๐Ÿ”ฆ exposed: Data.Morpheus.Types.SelectionTree

    ๐Ÿ”ง configurable api: Data.Morpheus.Core exports

    • Config
    • defaultConfig

    - debugConfig

    ๐Ÿ‘ for better debuging, internal errors messages will display resolving state:

    • current TypeName
    • current Selection
    • OperationDefinition

    - SchemaDefinition

    rendering graphql "AST". e.g render ( slection :: Selection VALID) will render

    { user(arg1: 1) { name } }
    • quasiqouter [dsl| <type definitions> |] generates Schema VALID.
    • ๐Ÿ“œ parser supports custom directive definition. e.g

      directive @MyDirective on FIELD_DEFINITION | OBJECT

    directive Validation for Document (TypeSystem).

    ๐Ÿ‘Œ supports of block string values. e.g:

    query { createDeity( name: """ powerqwe bla \n sd blu \\ dete""" ) { name } }

    ๐Ÿ‘Œ support of schema. issue #412

    schema { query: MyQuery}

    ๐Ÿ’ฅ Breaking Changes

    • Context' renamed toResolverContext'
    • โœ‚ removed : EventCon from Data.Morpheus.Core
    • ๐Ÿ”จ internal refactoring: changed AST.
      Schema AST Types now need parameter stage = RAW | CONST | VALID.
      • Schema VALID
      • TypeDefinition VALID
      • FieldDefinition IN VALID
      • ...
    • โš™ runApi requires argument config

      runApi ::Schema s ->RootResModel event m ->Config ->GQLRequest ->ResponseStream event m (Value VALID)

  • v0.13.0 Changes

    June 22, 2020

    0.13.0 - 22.06.2020


    ๐Ÿ’ฅ breaking changes

    • ๐Ÿ“‡ renamed GQLRootResolver -> RootResolver

    ๐Ÿ†• new features

    • importGQLDocument automatically defines GQLType instances for scalar definitions
    • ๐Ÿ‘Œ supports default values


    ๐Ÿ†• new features

    • ๐Ÿ”ฆ exposed: Data.Morpheus.Types.GQLScalar
    • ๐Ÿ”ฆ exposed: Data.Morpheus.Types.ID
    • finished interface validation
    • ๐Ÿ‘Œ supports default values

    minor changes

    • ๐Ÿ”จ internal refactoring
    • โž• added dependency mtl
    • validates strings as enum from JSON value


    ๐Ÿ’ฅ breaking changes

    ๐Ÿ‘€ from now you should provide for every custom graphql scalar definition coresponoding haskell type definition and GQLScalar implementation fot it. for details see examples-client

    input fields and query arguments are imported without namespacing

  • v0.12.0 Changes

    May 21, 2020


    ๐Ÿ’ฅ Breaking Changes

    ๐Ÿ“ฆ Package was extracted as:

    ๐Ÿ“œ morpheus-graphql-core: core components like: parser, validator, executor, utils.

    • Data.Morpheus.Core
    • Data.Morpheus.QuasiQuoter
    • Data.Morpheus.Error
    • Data.Morpheus.Internal.TH
    • Data.Morpheus.Internal.Utils
    • Data.Morpheus.Types.Internal.Resolving
    • Data.Morpheus.Types.Internal.Operation
    • Data.Morpheus.Types.Internal.AST

    - Data.Morpheus.Types.IO

    morpheus-graphql-client: lightweight version of morpheus client without server implementation

    - Data.Morpheus.Client

    morpheus-graphql: morpheus graphql server

    • Data.Morpheus
    • Data.Morpheus.Kind
    • Data.Morpheus.Types
    • Data.Morpheus.Server
    • Data.Morpheus.Document

    ๐Ÿ—„ deprecated:

    • Res, IORes, ResolveQ : use ResolverQ
    • MutRes, IOMutRes, ResolveM : use ResolverM
    • SubRes, IOSubRes, ResolveS: use ResolverS
    • failRes: use MonadFail

    ๐Ÿ†• New Feature

    ๐Ÿ‘ Semigroup support for Resolver

    ๐Ÿ‘ MonadFail Support for Resolver

    flexible resolvers: ResolverO, ResolverQ , RwsolverM, ResolverS
    they can handle object and scalar types:

    -- if we have record and regular Intdata Object m = Object { field :: m Int }-- we canwrite-- handes kind : (\* -\> \*) -\> \*resolveObject :: ResolverO o EVENT IO Object-- is alias to: Resolver o () IO (Object (Resolver o () IO))-- or-- handes kind : \*resolveInt :: ResolverO o EVENT IO Int-- is alias to: Resolver o () IO Int

    the resolvers : ResolverQ , RwsolverM, ResolverS , are like
    ResolverO but with QUERY , MUTATION and SUBSCRIPTION as argument.

    flexible compsed Resolver Type alias: ComposedResolver. extends ResolverO with
    parameter (f :: * -> *). so that you can compose Resolvers e.g:

    resolveList :: ComposedResolver o EVENT IO [] Object-- is alias to: Resolver o () IO [Object (Resolver o () IO))]resolveList :: ComposedResolver o EVENT IO Maybe Int-- is alias to: Resolver o () IO (Maybe Int)

    ๐Ÿ‘€ server supports interfaces (see Readme):

    1. define interface with Haskell Types (runtime validation):

    2. define interface with importGQLDocument and DSL (compile time validation):

    ๐Ÿ‘Œ support default directives: @skip and @include

    SelectionTree interface


    • ๐Ÿ›  fixed subscription sessions, srarting new session does not affects old ones.
    • โž• added tests for subscriptions


    0.12.0 - 21.05.2020

    ๐Ÿ†• New features

    ๐Ÿ“œ parser supports implemnets interfaces seperated with empty spaces

    type T implements A , B C & D {

    introspection can render interfaces

  • v0.11.0 Changes

    May 01, 2020

    ๐Ÿ’ฅ Breaking Changes

    ๐Ÿ›  Client generated enum data constructors are now prefixed with with the type name to avoid name conflicts.

    for Variant selection inputUnion uses inputname insead of __typename

    in Data.Morpheus.Server

    • gqlSocketApp and gqlSocketMonadIOApp are replaced with webSocketsApp

    - removed initGQLState, GQLState

    ๐Ÿ‘ for better control of subscriptions

    • replaced instance interpreter gqlRoot state with
      interpreter gqlRoot.
    • added: Input, Stream, httpPubApp

    from now on you can define API that can be
    ๐Ÿ‘‰ used in websockets as well as in http servers

    api :: Input api -\> Stream api EVENT IOapi = interpreter gqlRootserver :: IO ()server = do (wsApp, publish) \<- webSocketsApp api let httpApp = httpPubApp api publish ... runBoth wsApp httpApp

    where publish :: e -> m ()

    websockets and http app do not have to be on the same server.
    e.g. you can pass events between servers with webhooks.

    subscription can select only one top level field (based on the GraphQL specification).

    ๐Ÿ†• New features

    • ๐Ÿ”€ Instead of rejecting conflicting selections, they are merged (based on the GraphQL specification).
    • ๐Ÿ‘Œ Support for input lists separated by newlines. thanks @charlescrain
    • conflicting variable , fragment ... validation
    • issue #411: Aeson FromJSON ToJSON instances for ID


    • ๐Ÿ”„ changes to internal types
    • ๐Ÿ›  fixed validation of apollo websockets requests
  • v0.10.1 Changes

    โž• Added

    • ๐Ÿ‘Œ Support for input lists separated by newlines. thanks @charlescrain