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 errorscompileTimeSchemaValidation :
morpheus validates schema at runtime (after the schema derivation).
to be ensure that only correct api is compiled.
we can use template haskell methodcompileTimeSchemaValidation
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
exposesRootResolverConstraint
Data.Morpheus.Server
exposeshttpPlayground
๐
httpPubApp
supportsGQLRequest -> GQLResponse
๐
morpheus-graphql-core
support ofschema
. issue #412schema { 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 to
ResolverContext'- ๐จ 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 #412schema { 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
exportsConfig
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> |]
generatesSchema 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 #412schema { query: MyQuery}
๐ฅ Breaking Changes
Context' renamed to
ResolverContext'- โ removed :
EventCon
fromData.Morpheus.Core
- ๐จ internal refactoring: changed AST.
Schema AST Types now need parameterstage = 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)