graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.App.State

Synopsis

Documentation

data AppEnv Source #

Represents the Read-Only Hasura State, these fields are immutable and the state cannot be changed during runtime.

Instances

Instances details
MonadReader AppEnv AppM Source # 
Instance details

Defined in Hasura.App

Methods

ask :: AppM AppEnv #

local :: (AppEnv -> AppEnv) -> AppM a -> AppM a #

reader :: (AppEnv -> a) -> AppM a #

data Loggers Source #

Collection of the LoggerCtx, the regular Logger and the PGLogger

class Monad m => HasAppEnv m where Source #

Provides access to the AppEnv.

This class is nothing more than an equivalent of MonadReader AppEnv m, but it abstracts it, so that application code can be written without explicitly relying on an explicit implementation of the app monad. It allows for the app env to be passed implicitly instead of explictly in all of the app init code.

This class is not meant to be used across the entirety of the codebase, as using it brings in scope the types of all fields, creating dependencies between unrelated parts of the codebase. It is only meant to be used at the top level; more specific parts of the code should only rely on the relevant subset of the environment, exposed by small, local typeclasses. For instance, at time of writing, this can be used to implement HasServerConfigCtx, as a first step towards breaking it down.

Methods

askAppEnv :: m AppEnv Source #

Instances

Instances details
HasAppEnv AppM Source # 
Instance details

Defined in Hasura.App

HasAppEnv m => HasAppEnv (Handler m) Source # 
Instance details

Defined in Hasura.Server.App

HasAppEnv m => HasAppEnv (ExceptT e m) Source # 
Instance details

Defined in Hasura.App.State

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

Defined in Hasura.App.State

buildRebuildableAppContext :: (Logger Hasura, Manager) -> ServeOptions impl -> Environment -> ExceptT QErr IO (RebuildableAppContext impl) Source #

Function to build the AppContext (given the ServeOptions) for the first time