Skip to content

morpheus-graphql-0.14.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@nalchevanidze nalchevanidze released this 15 Aug 13:23
8c26315

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 Undefined
    rootResolver = 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)