-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Morpheus GraphQL -- -- Build GraphQL APIs with your favourite functional language! @package morpheus-graphql @version 0.19.2 -- | associating types to GraphQL Kinds module Data.Morpheus.Kind -- | GraphQL Scalar: Int, Float, String, Boolean or any user defined custom -- Scalar type type SCALAR = 'SCALAR -- | Deprecated: use: deriving(GQLType), will be automatically -- inferred type OBJECT = 'TYPE -- | Deprecated: use: deriving(GQLType), will be automatically -- inferred type ENUM = 'TYPE -- | GraphQL Arrays , Resolvers and NonNull fields type WRAPPER = 'WRAPPER -- | Deprecated: use: deriving(GQLType), IMPORTANT: only types with -- constructor namename will sustain their form, other -- union constructors will be wrapped inside an new object type UNION = 'TYPE -- | Deprecated: use: deriving(GQLType), will be automatically -- inferred type INPUT_OBJECT = 'TYPE data DerivingKind SCALAR :: DerivingKind TYPE :: DerivingKind WRAPPER :: DerivingKind CUSTOM :: DerivingKind -- | Deprecated: use: DerivingKind type GQL_KIND = DerivingKind -- | Deprecated: use: deriving(GQLType), will be automatically -- inferred type OUTPUT = 'TYPE -- | Deprecated: use: deriving(GQLType), will be automatically -- inferred type INPUT = 'TYPE -- | Deprecated: use: deriving(GQLType), will be automatically -- inferred type INTERFACE = 'TYPE -- | GraphQL input, type, union , enum type TYPE = 'TYPE type CUSTOM = 'CUSTOM instance GHC.Show.Show Data.Morpheus.Kind.DerivingKind module Data.Morpheus.NamedResolvers class (ToJSON (Dep a)) => ResolveNamed (m :: Type -> Type) a where { type family Dep a :: Type; } resolveNamed :: (ResolveNamed m a, Monad m) => Dep a -> m a data NamedResolverT (m :: Type -> Type) a [Ref] :: ResolveNamed m a => m (Dep a) -> NamedResolverT m a [Refs] :: ResolveNamed m a => m [Dep a] -> NamedResolverT m [a] [Value] :: m a -> NamedResolverT m a resolve :: forall m a b. ResolveByType (RES_TYPE a b) m a b => Monad m => m a -> NamedResolverT m b instance (Data.Morpheus.NamedResolvers.ResolveNamed m a, Data.Morpheus.NamedResolvers.Dep a GHC.Types.~ a) => Data.Morpheus.NamedResolvers.ResolveByType 'Data.Morpheus.NamedResolvers.VALUE m a a instance (Data.Morpheus.NamedResolvers.ResolveNamed m b, Data.Morpheus.NamedResolvers.Dep b GHC.Types.~ a) => Data.Morpheus.NamedResolvers.ResolveByType 'Data.Morpheus.NamedResolvers.LIST m [a] [b] instance (Data.Morpheus.NamedResolvers.ResolveNamed m b, Data.Morpheus.NamedResolvers.Dep b GHC.Types.~ a) => Data.Morpheus.NamedResolvers.ResolveByType 'Data.Morpheus.NamedResolvers.REF m a b instance GHC.Base.Monad m => Data.Morpheus.NamedResolvers.ResolveNamed m Data.Morpheus.Types.ID.ID instance GHC.Base.Monad m => Data.Morpheus.NamedResolvers.ResolveNamed m Data.Text.Internal.Text instance Data.Morpheus.NamedResolvers.ResolveNamed m a => Data.Morpheus.NamedResolvers.ResolveNamed m (GHC.Maybe.Maybe a) instance Data.Morpheus.NamedResolvers.ResolveNamed m a => Data.Morpheus.NamedResolvers.ResolveNamed m [a] -- | GQL Types module Data.Morpheus.Types -- | GraphQL type, every graphQL type should have an instance of -- Generic and GQLType. -- --
-- ... deriving (Generic, GQLType) -- ---- -- if you want to add description -- --
-- ... deriving (Generic) -- -- instance GQLType ... where -- description = const "your description ..." -- --class GQLType a where { type family KIND a :: DerivingKind; type KIND a = TYPE; } -- | A description of the type. -- -- Used for documentation in the GraphQL schema. description :: GQLType a => f a -> Maybe Text -- | A dictionary of descriptions for fields, keyed on field name. -- -- Used for documentation in the GraphQL schema. getDescriptions :: GQLType a => f a -> Map Text Description typeOptions :: GQLType a => f a -> GQLTypeOptions -> GQLTypeOptions getDirectives :: GQLType a => f a -> Map Text (Directives CONST) defaultValues :: GQLType a => f a -> Map Text (Value CONST) -- | GraphQL Scalar Serializer class EncodeScalar a encodeScalar :: EncodeScalar a => a -> ScalarValue -- | GraphQL Wrapper Serializer class EncodeWrapper (wrapper :: Type -> Type) encodeWrapper :: (EncodeWrapper wrapper, Monad m) => (a -> m (ResolverValue m)) -> wrapper a -> m (ResolverValue m) -- | GraphQL Scalar parser class DecodeScalar a decodeScalar :: DecodeScalar a => ScalarValue -> Either Text a -- | GraphQL Wrapper Deserializer class DecodeWrapper (f :: Type -> Type) decodeWrapper :: (DecodeWrapper f, Monad m, DecodeWrapperConstraint f a) => (ValidValue -> m a) -> ValidValue -> ExceptT GQLError m (f a) -- | GraphQL HTTP Request Body data GQLRequest GQLRequest :: Maybe FieldName -> Text -> Maybe Value -> GQLRequest [operationName] :: GQLRequest -> Maybe FieldName [query] :: GQLRequest -> Text [variables] :: GQLRequest -> Maybe Value -- | GraphQL Response data GQLResponse Data :: ValidValue -> GQLResponse Errors :: [GQLError] -> GQLResponse -- | default GraphQL type, parses only String and Int values, -- serialized always as String newtype ID ID :: Text -> ID [unpackID] :: ID -> Text -- | Primitive Values for GQLScalar: Int, Float, -- String, Boolean. for performance reason type Text -- represents GraphQl String value data ScalarValue Int :: Int -> ScalarValue Float :: Double -> ScalarValue String :: Text -> ScalarValue Boolean :: Bool -> ScalarValue Value :: Value -> ScalarValue -- | GraphQL Root resolver, also the interpreter generates a GQL schema -- from it. queryResolver is required, mutationResolver and -- subscriptionResolver are optional, if your schema does not -- supports mutation or subscription , you can use -- () for it. data RootResolver (m :: Type -> Type) event (query :: (Type -> Type) -> Type) (mutation :: (Type -> Type) -> Type) (subscription :: (Type -> Type) -> Type) RootResolver :: query (Resolver QUERY event m) -> mutation (Resolver MUTATION event m) -> subscription (Resolver SUBSCRIPTION event m) -> RootResolver (m :: Type -> Type) event (query :: (Type -> Type) -> Type) (mutation :: (Type -> Type) -> Type) (subscription :: (Type -> Type) -> Type) [queryResolver] :: RootResolver (m :: Type -> Type) event (query :: (Type -> Type) -> Type) (mutation :: (Type -> Type) -> Type) (subscription :: (Type -> Type) -> Type) -> query (Resolver QUERY event m) [mutationResolver] :: RootResolver (m :: Type -> Type) event (query :: (Type -> Type) -> Type) (mutation :: (Type -> Type) -> Type) (subscription :: (Type -> Type) -> Type) -> mutation (Resolver MUTATION event m) [subscriptionResolver] :: RootResolver (m :: Type -> Type) event (query :: (Type -> Type) -> Type) (mutation :: (Type -> Type) -> Type) (subscription :: (Type -> Type) -> Type) -> subscription (Resolver SUBSCRIPTION event m) constRes :: (WithOperation o, Monad m) => b -> a -> Resolver o e m b constMutRes :: Monad m => [e] -> a -> args -> ResolverM e m a data Undefined (m :: Type -> Type) Undefined :: Undefined (m :: Type -> Type) data Resolver (o :: OperationType) event (m :: Type -> Type) value type QUERY = 'Query type MUTATION = 'Mutation type SUBSCRIPTION = 'Subscription -- | Lift a computation from the argument monad to the constructed monad. lift :: (MonadTrans t, Monad m) => m a -> t m a liftEither :: (MonadTrans t, Monad (t m), MonadError GQLError (t m)) => Monad m => m (Either String a) -> t m a -- | Deprecated: use "fail" from MonadFail failRes :: (Monad m, WithOperation o) => String -> Resolver o e m a type WithOperation (o :: OperationType) = LiftOperation o publish :: Monad m => [e] -> Resolver MUTATION e m () subscribe :: forall (m :: Type -> Type) e a. Monad m => Channel e -> Resolver QUERY e m (e -> Resolver SUBSCRIPTION e m a) -> SubscriptionField (Resolver SUBSCRIPTION e m a) -- | A function to return the internal ResolverContext within a -- resolver's monad. Using the ResolverContext itself is unsafe -- because it exposes internal structures of the AST, but you can use the -- Data.Morpheus.Types.SelectionTree typeClass to manipulate the -- internal AST with a safe interface. unsafeInternalContext :: forall (m :: Type -> Type) (o :: OperationType) e. (Monad m, LiftOperation o) => Resolver o e m ResolverContext data ResolverContext ResolverContext :: Selection VALID -> Schema VALID -> Operation VALID -> Config -> TypeDefinition ANY VALID -> ResolverContext [currentSelection] :: ResolverContext -> Selection VALID [schema] :: ResolverContext -> Schema VALID [operation] :: ResolverContext -> Operation VALID [config] :: ResolverContext -> Config [currentType] :: ResolverContext -> TypeDefinition ANY VALID type ResolverO o e m a = (WithOperation o) => Flexible (Resolver o e m) a type ComposedResolver o e m f a = (WithOperation o) => Composed (Resolver o e m) f a type ResolverQ e m a = Flexible (Resolver QUERY e m) a type ResolverM e m a = Flexible (Resolver MUTATION e m) a type ResolverS e m a = Flexible (Resolver SUBSCRIPTION e m) a -- | Deprecated: use ResolverQ type ResolveQ e m a = ResolverQ e m a -- | Deprecated: use ResolverM type ResolveM e m a = ResolverM e m a -- | Deprecated: use ResolverS type ResolveS e m a = ResolverS e m a -- | Deprecated: use ResolverQ type Res = Resolver QUERY -- | Deprecated: use ResolverM type MutRes = Resolver MUTATION -- | Deprecated: use ResolverS type SubRes = Resolver SUBSCRIPTION -- | Deprecated: use ResolverQ type IORes e = Res e IO -- | Deprecated: use ResolverM type IOMutRes e = MutRes e IO -- | Deprecated: use ResolverS type IOSubRes e = SubRes e IO data SubscriptionField a data App event (m :: Type -> Type) class RenderGQL a render :: RenderGQL a => a -> ByteString data TypeGuard interface union ResolveInterface :: interface -> TypeGuard interface union ResolveType :: union -> TypeGuard interface union newtype Arg (name :: Symbol) a Arg :: a -> Arg (name :: Symbol) a [argValue] :: Arg (name :: Symbol) a -> a data NamedResolvers (m :: Type -> Type) event (qu :: (Type -> Type) -> Type) (mu :: (Type -> Type) -> Type) (su :: (Type -> Type) -> Type) NamedResolvers :: NamedResolvers (m :: Type -> Type) event (qu :: (Type -> Type) -> Type) (mu :: (Type -> Type) -> Type) (su :: (Type -> Type) -> Type) -- | Options that specify how to map GraphQL field, type, and constructor -- names to and from their Haskell equivalent. -- -- Options can be set using record syntax on defaultOptions with -- the fields below. data GQLTypeOptions -- | Default encoding GQLTypeOptions: -- --
-- GQLTypeOptions
-- { fieldLabelModifier = id
-- , constructorTagModifier = id
-- , typeNameModifier = const id
-- }
--
defaultTypeOptions :: GQLTypeOptions
-- | Function applied to field labels. Handy for removing common record
-- prefixes for example.
fieldLabelModifier :: GQLTypeOptions -> String -> String
-- | Function applied to constructor tags.
constructorTagModifier :: GQLTypeOptions -> String -> String
-- | Construct a new type name depending on whether it is an input, and
-- being given the original type name.
typeNameModifier :: GQLTypeOptions -> Bool -> String -> String
instance Data.Morpheus.Types.FlexibleResolver f a
instance Data.Morpheus.Types.FlexibleResolver f a
-- | GraphQL Wai Server Applications
module Data.Morpheus.Server
httpPlayground :: ByteString
-- | normal morpheus server validates schema at runtime (after the schema
-- derivation). this method allows you to validate it at compile time.
compileTimeSchemaValidation :: SchemaConstraints event m qu mu su => proxy (root m event qu mu su) -> Q Exp
-- | Generates schema.gql file from RootResolver
printSchema :: RootResolverConstraint m event query mut sub => proxy (RootResolver m event query mut sub) -> ByteString
type RootResolverConstraint m e query mutation subscription = (EncodeConstraints e m query mutation subscription, SchemaConstraints e m query mutation subscription, Monad m)
module Data.Morpheus.Document
-- | Deprecated: use Data.Morpheus.Server.printSchema
toGraphQLDocument :: RootResolverConstraint m event query mut sub => proxy (RootResolver m event query mut sub) -> ByteString
gqlDocument :: QuasiQuoter
importGQLDocument :: FilePath -> Q [Dec]
importGQLDocumentWithNamespace :: FilePath -> Q [Dec]
type RootResolverConstraint m e query mutation subscription = (EncodeConstraints e m query mutation subscription, SchemaConstraints e m query mutation subscription, Monad m)
-- | Build GraphQL APIs with your favorite functional language!
module Data.Morpheus
-- | main query processor and resolver
interpreter :: (MapAPI a b, RootResolverConstraint m e query mut sub) => RootResolver m e query mut sub -> a -> m b
debugInterpreter :: (MapAPI a b, RootResolverConstraint m e query mut sub) => RootResolver m e query mut sub -> a -> m b
data App event (m :: Type -> Type)
deriveApp :: DeriveApp f m event qu mu su => f m event qu mu su -> App event m
runApp :: (MapAPI a b, Monad m) => App e m -> a -> m b
withDebugger :: forall e (m :: Type -> Type). App e m -> App e m