graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.Server.App

Synopsis

Documentation

data APIHandler m a where Source #

API request handlers for different endpoints

Constructors

AHGet :: !(Handler m (HttpLogMetadata m, APIResp)) -> APIHandler m void

A simple GET request

AHPost :: !(a -> Handler m (HttpLogMetadata m, APIResp)) -> APIHandler m a

A simple POST request that expects a request body from which an a can be extracted

AHGraphQLRequest :: !(ReqsText -> Handler m (HttpLogMetadata m, APIResp)) -> APIHandler m ReqsText

A general GraphQL request (query or mutation) for which the content of the query is made available to the handler for authentication. This is a more specific version of the AHPost constructor.

boolToText :: Bool -> Text Source #

parseBody :: (FromJSON a, MonadError QErr m) => ByteString -> m (Value, a) Source #

setHeader :: MonadIO m => Header -> ActionT m () Source #

class Monad m => MonadMetadataApiAuthorization m where Source #

Typeclass representing the metadata API authorization effect

Instances

Instances details
MonadMetadataApiAuthorization m => MonadMetadataApiAuthorization (TraceT m) Source # 
Instance details

Defined in Hasura.Server.App

MonadMetadataApiAuthorization m => MonadMetadataApiAuthorization (MetadataStorageT m) Source # 
Instance details

Defined in Hasura.Server.App

Monad m => MonadMetadataApiAuthorization (PGMetadataStorageAppT m) Source # 
Instance details

Defined in Hasura.App

MonadMetadataApiAuthorization m => MonadMetadataApiAuthorization (ReaderT r m) Source # 
Instance details

Defined in Hasura.Server.App

class Monad m => MonadConfigApiHandler m where Source #

The config API (v1alpha1config) handler

Methods

runConfigApiHandler Source #

Arguments

:: ServerCtx 
-> Maybe Text

console assets directory

-> SpockCtxT () m () 

Instances

Instances details
(MonadIO m, MonadBaseControl IO m) => MonadConfigApiHandler (PGMetadataStorageAppT m) Source # 
Instance details

Defined in Hasura.App

Methods

runConfigApiHandler :: ServerCtx -> Maybe Text -> SpockCtxT () (PGMetadataStorageAppT m) () Source #

mapActionT :: (Monad m, Monad n) => (m (StT (ActionCtxT ()) a) -> n (StT (ActionCtxT ()) a)) -> ActionT m a -> ActionT n a Source #

mkSpockAction Source #

Arguments

:: (MonadIO m, MonadBaseControl IO m, FromJSON a, UserAuthentication (TraceT m), HttpLog m, HasReporter m, HasResourceLimits m) 
=> ServerCtx 
-> (Bool -> QErr -> Value)

QErr JSON encoder function

-> (QErr -> QErr)

QErr modifier

-> APIHandler (TraceT m) a 
-> ActionT m () 

consoleAssetsHandler :: (MonadIO m, HttpLog m) => Logger Hasura -> LoggingSettings -> Text -> FilePath -> ActionT m () Source #

class Monad m => ConsoleRenderer m where Source #

Methods

renderConsole :: Text -> AuthMode -> Bool -> Maybe Text -> m (Either String Text) Source #

Instances

Instances details
ConsoleRenderer m => ConsoleRenderer (TraceT m) Source # 
Instance details

Defined in Hasura.Server.App

Methods

renderConsole :: Text -> AuthMode -> Bool -> Maybe Text -> TraceT m (Either String Text) Source #

Monad m => ConsoleRenderer (PGMetadataStorageAppT m) Source # 
Instance details

Defined in Hasura.App

Methods

renderConsole :: Text -> AuthMode -> Bool -> Maybe Text -> PGMetadataStorageAppT m (Either String Text) Source #

renderHtmlTemplate :: Template -> Value -> Either String Text Source #

configApiGetHandler :: forall m. (MonadIO m, MonadBaseControl IO m, UserAuthentication (TraceT m), HttpLog m, HasReporter m, HasResourceLimits m) => ServerCtx -> Maybe Text -> SpockCtxT () m () Source #

Default implementation of the MonadConfigApiHandler

mkWaiApp Source #

Arguments

:: forall m. (MonadIO m, MonadFix m, MonadStateless IO m, Forall (Pure m), ConsoleRenderer m, HttpLog m, UserAuthentication (TraceT m), MonadMetadataApiAuthorization m, MonadGQLExecutionCheck m, MonadConfigApiHandler m, MonadQueryLog m, MonadWSLog m, HasReporter m, MonadExecuteQuery m, HasResourceLimits m, MonadMetadataStorage (MetadataStorageT m), MonadResolveSource m, MonadQueryTags m) 
=> (ServerCtx -> SpockT m ()) 
-> Environment

Set of environment variables for reference in UIs

-> Logger Hasura

a Hasura specific logger

-> SQLGenCtx 
-> Bool

is AllowList enabled - TODO: change this boolean to sumtype

-> Manager

HTTP manager so that we can re-use sessions

-> AuthMode

AuthMode in which the application should operate in

-> CorsConfig 
-> Bool

is console enabled - TODO: better type

-> Maybe Text

filepath to the console static assets directory - TODO: better type

-> Bool

is telemetry enabled

-> InstanceId

each application, when run, gets an InstanceId. this is used at various places including schema syncing and telemetry

-> HashSet API

set of the enabled APIs

-> LiveQueriesOptions 
-> StreamQueriesOptions 
-> ResponseInternalErrorsConfig 
-> Maybe SubscriptionPostPollHook 
-> SchemaCacheRef 
-> Store EmptyMetrics 
-> ServerMetrics 
-> PrometheusMetrics 
-> RemoteSchemaPermissions 
-> InferFunctionPermissions 
-> ConnectionOptions 
-> KeepAliveDelay 
-> MaintenanceMode () 
-> EventingMode 
-> ReadOnlyMode 
-> HashSet ExperimentalFeature

Set of the enabled experimental features

-> HashSet (EngineLogType Hasura) 
-> WSConnectionInitTimeout 
-> MetadataQueryLoggingMode

is metadata query logging in http-log enabled

-> Maybe NamingCase

default naming convention

-> m HasuraApp 

raiseGenericApiError :: (MonadIO m, HttpLog m) => Logger Hasura -> LoggingSettings -> [Header] -> QErr -> ActionT m () Source #