morpheus-graphql 0.27.3 → 0.28.0
raw patch · 5 files changed
+71/−29 lines, 5 filesdep +attoparsec-aesondep ~bytestringdep ~containersdep ~morpheus-graphqlPVP ok
version bump matches the API change (PVP)
Dependencies added: attoparsec-aeson
Dependency ranges changed: bytestring, containers, morpheus-graphql, morpheus-graphql-app, morpheus-graphql-code-gen, morpheus-graphql-core, morpheus-graphql-server, morpheus-graphql-subscriptions, morpheus-graphql-tests, tasty
API changes (from Hackage documentation)
+ Data.Morpheus.Types: Suffixes :: Text -> Text -> Suffixes
+ Data.Morpheus.Types: [addSuffix] :: Suffixes -> Text
+ Data.Morpheus.Types: [removeSuffix] :: Suffixes -> Text
+ Data.Morpheus.Types: data () => Suffixes
- Data.Morpheus: data App event (m :: Type -> Type)
+ Data.Morpheus: data () => App event (m :: Type -> Type)
- Data.Morpheus.Kind: data DerivingKind
+ Data.Morpheus.Kind: data () => DerivingKind
- Data.Morpheus.NamedResolvers: data NamedResolverT (m :: Type -> Type) a
+ Data.Morpheus.NamedResolvers: data () => NamedResolverT (m :: Type -> Type) a
- Data.Morpheus.Types: class DecodeScalar a
+ Data.Morpheus.Types: class () => DecodeScalar a
- Data.Morpheus.Types: class DecodeWrapper (f :: Type -> Type)
+ Data.Morpheus.Types: class () => DecodeWrapper (f :: Type -> Type)
- Data.Morpheus.Types: class EncodeScalar a
+ Data.Morpheus.Types: class () => EncodeScalar a
- Data.Morpheus.Types: class EncodeWrapper (wrapper :: Type -> Type)
+ Data.Morpheus.Types: class () => EncodeWrapper (wrapper :: Type -> Type)
- Data.Morpheus.Types: class GQLType a where {
+ Data.Morpheus.Types: class () => GQLType a where {
- Data.Morpheus.Types: class RenderGQL a
+ Data.Morpheus.Types: class () => RenderGQL a
- Data.Morpheus.Types: class VisitEnum a
+ Data.Morpheus.Types: class () => VisitEnum a
- Data.Morpheus.Types: class VisitField a
+ Data.Morpheus.Types: class () => VisitField a
- Data.Morpheus.Types: class VisitType a
+ Data.Morpheus.Types: class () => VisitType a
- Data.Morpheus.Types: data App event (m :: Type -> Type)
+ Data.Morpheus.Types: data () => App event (m :: Type -> Type)
- Data.Morpheus.Types: data DirectiveLocation
+ Data.Morpheus.Types: data () => DirectiveLocation
- Data.Morpheus.Types: data GQLError
+ Data.Morpheus.Types: data () => GQLError
- Data.Morpheus.Types: data GQLRequest
+ Data.Morpheus.Types: data () => GQLRequest
- Data.Morpheus.Types: data GQLResponse
+ Data.Morpheus.Types: data () => GQLResponse
- Data.Morpheus.Types: data NamedResolvers (m :: Type -> Type) event (qu :: Type -> Type -> Type) (mu :: Type -> Type -> Type) (su :: Type -> Type -> Type)
+ Data.Morpheus.Types: data () => NamedResolvers (m :: Type -> Type) event (qu :: Type -> Type -> Type) (mu :: Type -> Type -> Type) (su :: Type -> Type -> Type)
- Data.Morpheus.Types: data Prefixes
+ Data.Morpheus.Types: data () => Prefixes
- Data.Morpheus.Types: data Resolver (o :: OperationType) event (m :: Type -> Type) value
+ Data.Morpheus.Types: data () => Resolver (o :: OperationType) event (m :: Type -> Type) value
- Data.Morpheus.Types: data ResolverContext
+ Data.Morpheus.Types: data () => ResolverContext
- Data.Morpheus.Types: data RootResolver (m :: Type -> Type) event (query :: Type -> Type -> Type) (mutation :: Type -> Type -> Type) (subscription :: Type -> Type -> Type)
+ Data.Morpheus.Types: data () => RootResolver (m :: Type -> Type) event (query :: Type -> Type -> Type) (mutation :: Type -> Type -> Type) (subscription :: Type -> Type -> Type)
- Data.Morpheus.Types: data ScalarValue
+ Data.Morpheus.Types: data () => ScalarValue
- Data.Morpheus.Types: data SubscriptionField a
+ Data.Morpheus.Types: data () => SubscriptionField a
- Data.Morpheus.Types: data TypeGuard interface union
+ Data.Morpheus.Types: data () => TypeGuard interface union
- Data.Morpheus.Types: data Undefined (m :: Type -> Type)
+ Data.Morpheus.Types: data () => Undefined (m :: Type -> Type)
- Data.Morpheus.Types: enumDirective :: forall a (gql :: Type -> Constraint) (args :: Type -> Constraint). (GQLDirective a, gql a, args a) => TypeName -> a -> GDirectiveUsages gql args
+ Data.Morpheus.Types: enumDirective :: DirectiveConstraint a => TypeName -> a -> DirectiveUsages
- Data.Morpheus.Types: fieldDirective :: forall a (gql :: Type -> Constraint) (args :: Type -> Constraint). (GQLDirective a, gql a, args a) => FieldName -> a -> GDirectiveUsages gql args
+ Data.Morpheus.Types: fieldDirective :: DirectiveConstraint a => FieldName -> a -> DirectiveUsages
- Data.Morpheus.Types: newtype Arg (name :: Symbol) a
+ Data.Morpheus.Types: newtype () => Arg (name :: Symbol) a
- Data.Morpheus.Types: newtype DefaultValue
+ Data.Morpheus.Types: newtype () => DefaultValue
- Data.Morpheus.Types: newtype Deprecated
+ Data.Morpheus.Types: newtype () => Deprecated
- Data.Morpheus.Types: newtype Describe
+ Data.Morpheus.Types: newtype () => Describe
- Data.Morpheus.Types: newtype DropNamespace
+ Data.Morpheus.Types: newtype () => DropNamespace
- Data.Morpheus.Types: newtype ID
+ Data.Morpheus.Types: newtype () => ID
- Data.Morpheus.Types: newtype Rename
+ Data.Morpheus.Types: newtype () => Rename
- Data.Morpheus.Types: typeDirective :: forall a (gql :: Type -> Constraint) (args :: Type -> Constraint). (GQLDirective a, gql a, args a) => a -> GDirectiveUsages gql args
+ Data.Morpheus.Types: typeDirective :: DirectiveConstraint a => a -> DirectiveUsages
Files
- morpheus-graphql.cabal +20/−18
- src/Data/Morpheus/Types.hs +2/−0
- test/Subscription/Case/ApolloRequest.hs +24/−5
- test/Subscription/Case/Publishing.hs +3/−1
- test/Subscription/Utils.hs +22/−5
morpheus-graphql.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.0.+-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: morpheus-graphql-version: 0.27.3+version: 0.28.0 synopsis: Morpheus GraphQL description: Build GraphQL APIs with your favourite functional language! category: web, graphql@@ -229,13 +229,14 @@ ghc-options: -Wall build-depends: aeson >=1.4.4 && <3.0.0+ , attoparsec-aeson >=2.1.0.0 && <3.0.0 , base >=4.7.0 && <5.0.0- , bytestring >=0.10.4 && <0.12.0- , containers >=0.4.2.1 && <0.7.0- , morpheus-graphql-app >=0.27.0 && <0.28.0- , morpheus-graphql-code-gen >=0.27.0 && <0.28.0- , morpheus-graphql-core >=0.27.0 && <0.28.0- , morpheus-graphql-server >=0.27.0 && <0.28.0+ , bytestring >=0.10.4 && <0.15.0+ , containers >=0.4.2.1 && <=0.7+ , morpheus-graphql-app >=0.28.0 && <0.29.0+ , morpheus-graphql-code-gen >=0.28.0 && <0.29.0+ , morpheus-graphql-core >=0.28.0 && <0.29.0+ , morpheus-graphql-server >=0.28.0 && <0.29.0 , mtl >=2.0.0 && <3.0.0 , relude >=0.3.0 && <2.0.0 , template-haskell >=2.0.0 && <3.0.0@@ -264,19 +265,20 @@ ghc-options: -Wall build-depends: aeson >=1.4.4 && <3.0.0+ , attoparsec-aeson >=2.1.0.0 && <3.0.0 , base >=4.7.0 && <5.0.0- , bytestring >=0.10.4 && <0.12.0- , containers >=0.4.2.1 && <0.7.0- , morpheus-graphql- , morpheus-graphql-app >=0.27.0 && <0.28.0- , morpheus-graphql-code-gen >=0.27.0 && <0.28.0- , morpheus-graphql-core >=0.27.0 && <0.28.0- , morpheus-graphql-server >=0.27.0 && <0.28.0- , morpheus-graphql-subscriptions >=0.27.0 && <0.28.0- , morpheus-graphql-tests >=0.27.0 && <0.28.0+ , bytestring >=0.10.4 && <0.15.0+ , containers >=0.4.2.1 && <=0.7+ , morpheus-graphql >=0.28.0 && <0.29.0+ , morpheus-graphql-app >=0.28.0 && <0.29.0+ , morpheus-graphql-code-gen >=0.28.0 && <0.29.0+ , morpheus-graphql-core >=0.28.0 && <0.29.0+ , morpheus-graphql-server >=0.28.0 && <0.29.0+ , morpheus-graphql-subscriptions >=0.28.0 && <0.29.0+ , morpheus-graphql-tests >=0.28.0 && <0.29.0 , mtl >=2.0.0 && <3.0.0 , relude >=0.3.0 && <2.0.0- , tasty >=0.1.0 && <1.5.0+ , tasty >=0.1.0 && <=1.5 , tasty-hunit >=0.1.0 && <1.0.0 , template-haskell >=2.0.0 && <3.0.0 , text >=1.2.3 && <3.0.0
src/Data/Morpheus/Types.hs view
@@ -41,6 +41,7 @@ -- * GQL directives API Prefixes (..),+ Suffixes (..), VisitType (..), VisitField (..), Describe (..),@@ -96,6 +97,7 @@ SUBSCRIPTION, ScalarValue (..), SubscriptionField,+ Suffixes (..), TypeGuard (..), Undefined, VisitEnum (..),
test/Subscription/Case/ApolloRequest.hs view
@@ -18,7 +18,10 @@ import Subscription.Utils ( SimulationState (..), SubM,+ apolloConnectionAck, apolloInit,+ apolloPing,+ apolloPong, apolloStart, apolloStop, inputsAreConsumed,@@ -50,7 +53,7 @@ "unknown request type" [ inputsAreConsumed inputs, testResponse- ["Unknown Request type \"bla\"."]+ ["Error in $.type: Invalid type encountered."] outputs, storeIsEmpty store ]@@ -66,12 +69,27 @@ "connection init" [ inputsAreConsumed inputs, testResponse- []+ [apolloConnectionAck] outputs, stored input store, storedSingle store ] +testPingPong ::+ (Eq ch, Show ch, Hashable ch) =>+ App (Event ch a) (SubM (Event ch a)) ->+ IO TestTree+testPingPong = testSimulation test [apolloInit, apolloPing]+ where+ test _ SimulationState {inputs, outputs} =+ testGroup+ "ping pong"+ [ inputsAreConsumed inputs,+ testResponse+ [apolloConnectionAck, apolloPong]+ outputs+ ]+ startSub :: ByteString -> ByteString startSub = apolloStart "subscription MySubscription { newDeity { name }}" @@ -92,7 +110,7 @@ "subscription start" [ inputsAreConsumed inputs, testResponse- []+ [apolloConnectionAck] outputs, storeSubscriptions input@@ -118,7 +136,7 @@ "stop subscription" [ inputsAreConsumed inputs, testResponse- []+ [apolloConnectionAck] outputs, storeSubscriptions input@@ -137,5 +155,6 @@ [ testUnknownType, testConnectionInit, testSubscriptionStart,- testSubscriptionStop+ testSubscriptionStop,+ testPingPong ]
test/Subscription/Case/Publishing.hs view
@@ -28,6 +28,7 @@ ) import Subscription.Utils ( SimulationState (..),+ apolloConnectionAck, apolloInit, apolloRes, apolloStart,@@ -83,7 +84,8 @@ [ inputsAreConsumed inputs, testResponse -- triggers subscriptions by channels- [ apolloRes+ [ apolloConnectionAck,+ apolloRes "2" "{\"newDeity\":{\"name\":\"Zeus\",\"age\":1200}}", apolloRes
test/Subscription/Utils.hs view
@@ -19,6 +19,10 @@ apolloStop, apolloRes, apolloInit,+ apolloConnectionAck,+ apolloConnectionErr,+ apolloPing,+ apolloPong, testSimulation, ) where@@ -159,7 +163,7 @@ | otherwise = testCase "stored single connection" $ assertFailure $- "connectionStore must store single connection"+ "connectionStore must store single connection, but stored: " <> show cStore @@ -209,13 +213,26 @@ cStore apolloStart :: ByteString -> ByteString -> ByteString-apolloStart query sid = "{\"id\":\"" <> sid <> "\",\"type\":\"start\",\"payload\":{\"variables\":{},\"operationName\":\"MySubscription\",\"query\":\"" <> query <> "\"}}"+apolloStart query sid =+ "{\"id\":\"" <> sid <> "\",\"type\":\"subscribe\",\"payload\":{\"variables\":{},\"operationName\":\"MySubscription\",\"query\":\"" <> query <> "\"}}" apolloStop :: ByteString -> ByteString-apolloStop x = "{\"id\":\"" <> x <> "\",\"type\":\"stop\"}"+apolloStop x = "{\"id\":\"" <> x <> "\",\"type\":\"complete\"}" apolloRes :: ByteString -> ByteString -> ByteString-apolloRes sid value = "{\"id\":\"" <> sid <> "\",\"type\":\"data\",\"payload\":{\"data\":" <> value <> "}}"+apolloRes sid value = "{\"id\":\"" <> sid <> "\",\"type\":\"next\",\"payload\":{\"data\":" <> value <> "}}" apolloInit :: ByteString-apolloInit = "{ \"type\":\"connection_init\" }"+apolloInit = "{\"type\":\"connection_init\"}"++apolloConnectionAck :: ByteString+apolloConnectionAck = "{\"type\":\"connection_ack\"}"++apolloConnectionErr :: ByteString+apolloConnectionErr = "{\"type\":\"connection_error\"}"++apolloPing :: ByteString+apolloPing = "{\"type\":\"ping\"}"++apolloPong :: ByteString+apolloPong = "{\"type\":\"pong\"}"