morpheus-graphql-0.14.0
Pre-releasemorpheus-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 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 Undefined rootResolver = 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)