morpheus-graphql v0.14.0 Release Notes

Release Date: 2020-08-15 // over 3 years ago
  • morpheus-graphql

    ๐Ÿ†• 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

    morpheus-graphql-client

    ๐Ÿ†• 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

    morpheus-graphql-core

    ๐Ÿ†• 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)