-- 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-server @version 0.28.0 module Data.Morpheus.Server.CodeGen.Internal -- | The class Typeable allows a concrete representation of a type -- to be calculated. class () => Typeable (a :: k) -- | A space efficient, packed, unboxed Unicode text type. data () => Text -- | Representable types of kind *. This class is derivable in GHC -- with the DeriveGeneric flag on. -- -- A Generic instance must satisfy the following laws: -- --
-- from . to ≡ id -- to . from ≡ id --class () => Generic a module Data.Morpheus.Server.Resolvers class (ToJSON (Dependency a)) => ResolveNamed (m :: Type -> Type) (a :: Type) where { type Dep a :: Type; } resolveBatched :: (ResolveNamed m a, MonadError GQLError m) => [Dependency a] -> m [Maybe a] -- | Deprecated: use: resolveBatched resolveNamed :: (ResolveNamed m a, MonadError GQLError m) => Dependency a -> m a data NamedResolverT (m :: Type -> Type) a [NamedResolverT] :: ResolveNamed m (Target a) => m (NamedRef a) -> NamedResolverT m a resolve :: ResolveNamed m (Target a) => m (NamedRef a) -> NamedResolverT m 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) -- | 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) defaultRootResolver :: RootResolver m event Undefined Undefined Undefined type ResolverO o e m a = Flexible (Resolver o e m) a type ComposedResolver o e m f a = Composed (Resolver o e m) f a constRes :: MonadResolver m => b -> a -> m b type ResolverQ e m a = ResolverO QUERY e m a type ResolverM e m a = ResolverO MUTATION e m a type ResolverS e m a = ResolverO SUBSCRIPTION e m a -- | Deprecated: this function is obsolete useBatched :: (ResolveNamed m a, MonadError GQLError m) => Dependency a -> m a ignoreBatching :: Monad m => (a -> m b) -> [a] -> m [Maybe b] type Flexible (m :: Type -> Type) a :: Type type Composed (m :: Type -> Type) f a :: Type instance Data.Morpheus.Server.Resolvers.FlexibleResolver f a instance Data.Morpheus.Server.Resolvers.FlexibleResolver f a -- | GQL Types module Data.Morpheus.Server.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 -- directives _ = typeDirective (Describe "some text") -- --class GQLType a where { type KIND a :: DerivingKind; type KIND a = TYPE; } directives :: GQLType a => f a -> DirectiveUsages -- | 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 ScalarValue and -- ScalarValue values, serialized always as ScalarValue newtype () => ID ID :: Text -> ID [unpackID] :: ID -> Text -- | Primitive Values for GQLScalar: ScalarValue, -- ScalarValue, ScalarValue, Boolean. for -- performance reason type Text represents GraphQl -- ScalarValue value data () => ScalarValue Int :: Int -> ScalarValue Float :: Double -> ScalarValue String :: Text -> ScalarValue Boolean :: Bool -> ScalarValue Value :: Value -> ScalarValue data Undefined (m :: Type -> Type) data () => Resolver (o :: OperationType) event (m :: Type -> Type) value type QUERY = 'OPERATION_QUERY type MUTATION = 'OPERATION_MUTATION type SUBSCRIPTION = 'OPERATION_SUBSCRIPTION -- | Lift a computation from the argument monad to the constructed monad. lift :: (MonadTrans t, Monad m) => m a -> t m a type WithOperation (o :: OperationType) = LiftOperation o 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 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 () => GQLError -- | a custom GraphQL directive for adding or removing of prefixes data Prefixes Prefixes :: Text -> Text -> Prefixes [addPrefix] :: Prefixes -> Text [removePrefix] :: Prefixes -> Text -- | a custom GraphQL directive for adding or removing of suffixes data Suffixes Suffixes :: Text -> Text -> Suffixes [addSuffix] :: Suffixes -> Text [removeSuffix] :: Suffixes -> Text class VisitType a -- | Construct a new type name depending on whether it is an input, and -- being given the original type name. visitTypeName :: VisitType a => a -> Bool -> Text -> Text visitTypeDescription :: VisitType a => a -> Maybe Text -> Maybe Text -- | Function applied to field labels. Handy for removing common record -- prefixes for example. visitFieldNames :: VisitType a => a -> Text -> Text -- | Function applied to enum values Handy for removing common enum -- prefixes for example. visitEnumNames :: VisitType a => a -> Text -> Text class VisitField a visitFieldName :: VisitField a => a -> Text -> Text visitFieldDescription :: VisitField a => a -> Maybe Text -> Maybe Text visitFieldDefaultValue :: VisitField a => a -> Maybe (Value CONST) -> Maybe (Value CONST) class VisitEnum a visitEnumName :: VisitEnum a => a -> Text -> Text visitEnumDescription :: VisitEnum a => a -> Maybe Text -> Maybe Text typeDirective :: DirectiveConstraint a => a -> DirectiveUsages fieldDirective :: DirectiveConstraint a => FieldName -> a -> DirectiveUsages enumDirective :: DirectiveConstraint a => TypeName -> a -> DirectiveUsages fieldDirective' :: DirectiveConstraint a => Name -> a -> DirectiveUsages enumDirective' :: DirectiveConstraint a => Name -> a -> DirectiveUsages class (ToLocations (DIRECTIVE_LOCATIONS a), Typeable a, WITH_VISITOR a VISIT_TYPE TYPE_VISITOR_KIND, WITH_VISITOR a VISIT_FIELD FIELD_VISITOR_KIND, WITH_VISITOR a VISIT_ENUM ENUM_VISITOR_KIND) => GQLDirective a where { type DIRECTIVE_LOCATIONS a :: [DirectiveLocation]; } excludeFromSchema :: GQLDirective a => f a -> Bool newtype Deprecated Deprecated :: Maybe Text -> Deprecated [reason] :: Deprecated -> Maybe Text newtype Describe Describe :: Text -> Describe [text] :: Describe -> Text -- | GraphQL Scalar: Int, Float, String, Boolean or any user defined custom -- Scalar type type SCALAR = 'DERIVING_SCALAR data DerivingKind -- | GraphQL input, type, union , enum type TYPE = 'DERIVING_TYPE -- | GraphQL Custom Types type CUSTOM = 'DERIVING_CUSTOM -- | GraphQL Arrays , Resolvers and NonNull fields type WRAPPER = 'DERIVING_WRAPPER -- | GraphQL Arrays , Resolvers and NonNull fields type DIRECTIVE = 'DERIVING_DIRECTIVE -- | 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) defaultRootResolver :: RootResolver m event Undefined Undefined Undefined -- | a custom GraphQL directive for adding or removing of prefixes newtype Rename Rename :: Text -> Rename [newName] :: Rename -> Text newtype InputTypeNamespace InputTypeNamespace :: Text -> InputTypeNamespace [inputTypeNamespace] :: InputTypeNamespace -> Text newtype DropNamespace DropNamespace :: Text -> DropNamespace [dropNamespace] :: DropNamespace -> Text newtype DefaultValue DefaultValue :: Value CONST -> DefaultValue [defaultValue] :: DefaultValue -> Value CONST data () => Value (stage :: Stage) [ResolvedVariable] :: Ref FieldName -> Variable VALID -> Value 'CONST [VariableValue] :: Ref FieldName -> Value 'RAW [Object] :: forall (stage :: Stage). Object stage -> Value stage [List] :: forall (stage :: Stage). [Value stage] -> Value stage [Enum] :: forall (stage :: Stage). TypeName -> Value stage [Scalar] :: forall (stage :: Stage). ScalarValue -> Value stage [Null] :: forall (stage :: Stage). Value stage data () => DirectiveLocation LOCATION_QUERY :: DirectiveLocation LOCATION_MUTATION :: DirectiveLocation LOCATION_SUBSCRIPTION :: DirectiveLocation LOCATION_FIELD :: DirectiveLocation LOCATION_FRAGMENT_DEFINITION :: DirectiveLocation LOCATION_FRAGMENT_SPREAD :: DirectiveLocation LOCATION_INLINE_FRAGMENT :: DirectiveLocation LOCATION_SCHEMA :: DirectiveLocation LOCATION_SCALAR :: DirectiveLocation LOCATION_OBJECT :: DirectiveLocation LOCATION_FIELD_DEFINITION :: DirectiveLocation LOCATION_ARGUMENT_DEFINITION :: DirectiveLocation LOCATION_INTERFACE :: DirectiveLocation LOCATION_UNION :: DirectiveLocation LOCATION_ENUM :: DirectiveLocation LOCATION_ENUM_VALUE :: DirectiveLocation LOCATION_INPUT_OBJECT :: DirectiveLocation LOCATION_INPUT_FIELD_DEFINITION :: DirectiveLocation class (Monad m, MonadReader ResolverContext m, MonadFail m, MonadError GQLError m, Monad MonadParam m) => MonadResolver (m :: Type -> Type) where { type family MonadOperation (m :: Type -> Type) :: OperationType; type family MonadEvent (m :: Type -> Type); type family MonadQuery (m :: Type -> Type) :: Type -> Type; type family MonadMutation (m :: Type -> Type) :: Type -> Type; type family MonadSubscription (m :: Type -> Type) :: Type -> Type; type family MonadParam (m :: Type -> Type) :: Type -> Type; } liftState :: MonadResolver m => ResolverState a -> m a getArguments :: MonadResolver m => m (Arguments VALID) subscribe :: (MonadResolver m, MonadOperation m ~ SUBSCRIPTION) => Channel (MonadEvent m) -> MonadQuery m (MonadEvent m -> m a) -> SubscriptionField (m a) publish :: MonadResolver m => [MonadEvent m] -> m () runResolver :: MonadResolver m => Maybe (Selection VALID -> ResolverState (Channel (MonadEvent m))) -> m ValidValue -> ResolverContext -> ResponseStream (MonadEvent m) (MonadParam m) ValidValue class (MonadResolver m, MonadIO m) => MonadIOResolver (m :: Type -> Type) type Flexible (m :: Type -> Type) a :: Type type Composed (m :: Type -> Type) f a :: Type -- | 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 :: SCHEMA 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 = (DERIVE_RESOLVERS (Resolver QUERY e m) query mutation subscription, SCHEMA query mutation subscription, Monad m) -- | 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 disableIntrospection :: forall e (m :: Type -> Type). App e m -> App e m