Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data RebuildableAppContext impl = RebuildableAppContext {
- lastBuiltAppContext :: AppContext
- _racInvalidationMap :: InvalidationKeys
- _racRebuild :: Rule (ReaderT (Logger Hasura, Manager) (ExceptT QErr IO)) (ServeOptions impl, Environment, InvalidationKeys) AppContext
- data AppEnv = AppEnv {
- appEnvPort :: Port
- appEnvHost :: HostPreference
- appEnvMetadataDbPool :: PGPool
- appEnvIntrospectionDbPool :: Maybe PGPool
- appEnvManager :: Manager
- appEnvLoggers :: Loggers
- appEnvMetadataVersionRef :: TMVar MetadataResourceVersion
- appEnvInstanceId :: InstanceId
- appEnvEnableMaintenanceMode :: MaintenanceMode ()
- appEnvLoggingSettings :: LoggingSettings
- appEnvEventingMode :: EventingMode
- appEnvEnableReadOnlyMode :: ReadOnlyMode
- appEnvServerMetrics :: ServerMetrics
- appEnvShutdownLatch :: ShutdownLatch
- appEnvMetaVersionRef :: TMVar MetadataResourceVersion
- appEnvPrometheusMetrics :: PrometheusMetrics
- appEnvTraceSamplingPolicy :: SamplingPolicy
- appEnvSubscriptionState :: SubscriptionsState
- appEnvLockedEventsCtx :: LockedEventsCtx
- appEnvConnParams :: ConnParams
- appEnvTxIso :: TxIsolation
- appEnvConsoleAssetsDir :: Maybe Text
- appEnvConsoleSentryDsn :: Maybe Text
- appEnvConnectionOptions :: ConnectionOptions
- appEnvWebSocketKeepAlive :: KeepAliveDelay
- appEnvWebSocketConnectionInitTimeout :: WSConnectionInitTimeout
- appEnvGracefulShutdownTimeout :: Refined NonNegative Seconds
- appEnvSchemaPollInterval :: OptionalInterval
- appEnvCheckFeatureFlag :: CheckFeatureFlag
- appEnvLicenseKeyCache :: Maybe (CredentialCache AgentLicenseKey)
- appEnvMaxTotalHeaderLength :: Int
- data AppContext = AppContext {
- acAuthMode :: AuthMode
- acSQLGenCtx :: SQLGenCtx
- acEnabledAPIs :: HashSet API
- acEnableAllowlist :: AllowListStatus
- acResponseInternalErrorsConfig :: ResponseInternalErrorsConfig
- acEnvironment :: Environment
- acRemoteSchemaPermsCtx :: RemoteSchemaPermissions
- acFunctionPermsCtx :: InferFunctionPermissions
- acExperimentalFeatures :: HashSet ExperimentalFeature
- acDefaultNamingConvention :: NamingCase
- acMetadataDefaults :: MetadataDefaults
- acLiveQueryOptions :: LiveQueriesOptions
- acStreamQueryOptions :: StreamQueriesOptions
- acCorsPolicy :: CorsPolicy
- acConsoleStatus :: ConsoleStatus
- acEnableTelemetry :: TelemetryStatus
- acEventEngineCtx :: EventEngineCtx
- acAsyncActionsFetchInterval :: OptionalInterval
- acApolloFederationStatus :: ApolloFederationStatus
- acCloseWebsocketsOnMetadataChangeStatus :: CloseWebsocketsOnMetadataChangeStatus
- data Loggers = Loggers {}
- class Monad m => HasAppEnv m where
- buildRebuildableAppContext :: (Logger Hasura, Manager) -> ServeOptions impl -> Environment -> ExceptT QErr IO (RebuildableAppContext impl)
- rebuildRebuildableAppContext :: (MonadIO m, MonadError QErr m) => (Logger Hasura, Manager) -> RebuildableAppContext impl -> ServeOptions impl -> Environment -> m (RebuildableAppContext impl)
- initSQLGenCtx :: HashSet ExperimentalFeature -> StringifyNumbers -> DangerouslyCollapseBooleans -> SQLGenCtx
- buildCacheStaticConfig :: AppEnv -> CacheStaticConfig
- buildCacheDynamicConfig :: AppContext -> CacheDynamicConfig
Documentation
data RebuildableAppContext impl Source #
RebuildableAppContext | |
|
Represents the Read-Only Hasura State, these fields are immutable and the state cannot be changed during runtime.
data AppContext Source #
Represents the Dynamic Hasura State, these field are mutable and can be changed during runtime.
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.
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
rebuildRebuildableAppContext :: (MonadIO m, MonadError QErr m) => (Logger Hasura, Manager) -> RebuildableAppContext impl -> ServeOptions impl -> Environment -> m (RebuildableAppContext impl) Source #
Function to rebuild the AppContext
from a given RebuildableAppContext
and a new ServeOptions