Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types and classes related to configuration when the server is initialised
Synopsis
- data Option def = Option {
- _default :: def
- _envVar :: String
- _helpMessage :: String
- optionPP :: Option a -> (String, String)
- data HGEOptionsRaw impl = HGEOptionsRaw {}
- horDatabaseUrl :: Lens' (HGEOptionsRaw impl) (PostgresConnInfo (Maybe PostgresConnInfoRaw))
- horMetadataDbUrl :: Lens' (HGEOptionsRaw impl) (Maybe String)
- horCommand :: Lens' (HGEOptionsRaw impl) (HGECommand impl)
- data HGEOptions impl = HGEOptions {}
- hoCommand :: Lens' (HGEOptions impl) (HGECommand impl)
- data PostgresConnInfo a = PostgresConnInfo {
- _pciDatabaseConn :: a
- _pciRetries :: Maybe Int
- pciDatabaseConn :: Lens' (PostgresConnInfo a) a
- pciRetries :: Lens' (PostgresConnInfo a) (Maybe Int)
- data PostgresConnInfoRaw
- mkUrlConnInfo :: String -> PostgresConnInfoRaw
- _PGConnDatabaseUrl :: Prism' PostgresConnInfoRaw URLTemplate
- _PGConnDetails :: Prism' PostgresConnInfoRaw PostgresConnDetailsRaw
- rawConnDetailsToUrl :: PostgresConnDetailsRaw -> URLTemplate
- data PostgresConnDetailsRaw = PostgresConnDetailsRaw {
- connHost :: String
- connPort :: Int
- connUser :: String
- connPassword :: String
- connDatabase :: String
- connOptions :: Maybe String
- rawConnDetailsToUrlText :: PostgresConnDetailsRaw -> Text
- data HGECommand a
- _HCServe :: Prism' (HGECommand a) a
- data ServeOptionsRaw impl = ServeOptionsRaw {
- rsoPort :: Maybe Port
- rsoHost :: Maybe HostPreference
- rsoConnParams :: ConnParamsRaw
- rsoTxIso :: Maybe TxIsolation
- rsoAdminSecret :: Maybe AdminSecretHash
- rsoAuthHook :: AuthHookRaw
- rsoJwtSecret :: Maybe JWTConfig
- rsoUnAuthRole :: Maybe RoleName
- rsoCorsConfig :: Maybe CorsConfig
- rsoEnableConsole :: Bool
- rsoConsoleAssetsDir :: Maybe Text
- rsoEnableTelemetry :: Maybe Bool
- rsoWsReadCookie :: Bool
- rsoStringifyNum :: StringifyNumbers
- rsoDangerousBooleanCollapse :: Maybe DangerouslyCollapseBooleans
- rsoEnabledAPIs :: Maybe (HashSet API)
- rsoMxRefetchInt :: Maybe RefetchInterval
- rsoMxBatchSize :: Maybe BatchSize
- rsoStreamingMxRefetchInt :: Maybe RefetchInterval
- rsoStreamingMxBatchSize :: Maybe BatchSize
- rsoEnableAllowlist :: Bool
- rsoEnabledLogTypes :: Maybe (HashSet (EngineLogType impl))
- rsoLogLevel :: Maybe LogLevel
- rsoDevMode :: Bool
- rsoAdminInternalErrors :: Maybe Bool
- rsoEventsHttpPoolSize :: Maybe PositiveInt
- rsoEventsFetchInterval :: Maybe (NonNegative Milliseconds)
- rsoAsyncActionsFetchInterval :: Maybe OptionalInterval
- rsoEnableRemoteSchemaPermissions :: RemoteSchemaPermissions
- rsoWebSocketCompression :: Bool
- rsoWebSocketKeepAlive :: Maybe KeepAliveDelay
- rsoInferFunctionPermissions :: Maybe InferFunctionPermissions
- rsoEnableMaintenanceMode :: MaintenanceMode ()
- rsoSchemaPollInterval :: Maybe OptionalInterval
- rsoExperimentalFeatures :: Maybe (HashSet ExperimentalFeature)
- rsoEventsFetchBatchSize :: Maybe NonNegativeInt
- rsoGracefulShutdownTimeout :: Maybe (NonNegative Seconds)
- rsoWebSocketConnectionInitTimeout :: Maybe WSConnectionInitTimeout
- rsoEnableMetadataQueryLoggingEnv :: MetadataQueryLoggingMode
- rsoDefaultNamingConvention :: Maybe NamingCase
- rsoExtensionsSchema :: Maybe ExtensionsSchema
- newtype Port = Port {}
- mkPort :: Int -> Maybe Port
- unsafePort :: Int -> Port
- data API
- data AuthHookRaw = AuthHookRaw {
- ahrUrl :: Maybe Text
- ahrType :: Maybe AuthHookType
- data OptionalInterval
- msToOptionalInterval :: NonNegative Milliseconds -> OptionalInterval
- data ConnParamsRaw = ConnParamsRaw {}
- newtype KeepAliveDelay = KeepAliveDelay {}
- newtype WSConnectionInitTimeout = WSConnectionInitTimeout {}
- data ServeOptions impl = ServeOptions {
- soPort :: Port
- soHost :: HostPreference
- soConnParams :: ConnParams
- soTxIso :: TxIsolation
- soAdminSecret :: HashSet AdminSecretHash
- soAuthHook :: Maybe AuthHook
- soJwtSecret :: [JWTConfig]
- soUnAuthRole :: Maybe RoleName
- soCorsConfig :: CorsConfig
- soEnableConsole :: Bool
- soConsoleAssetsDir :: Maybe Text
- soEnableTelemetry :: Bool
- soStringifyNum :: StringifyNumbers
- soDangerousBooleanCollapse :: DangerouslyCollapseBooleans
- soEnabledAPIs :: HashSet API
- soLiveQueryOpts :: LiveQueriesOptions
- soStreamingQueryOpts :: StreamQueriesOptions
- soEnableAllowlist :: Bool
- soEnabledLogTypes :: HashSet (EngineLogType impl)
- soLogLevel :: LogLevel
- soResponseInternalErrorsConfig :: ResponseInternalErrorsConfig
- soEventsHttpPoolSize :: PositiveInt
- soEventsFetchInterval :: NonNegative Milliseconds
- soAsyncActionsFetchInterval :: OptionalInterval
- soEnableRemoteSchemaPermissions :: RemoteSchemaPermissions
- soConnectionOptions :: ConnectionOptions
- soWebSocketKeepAlive :: KeepAliveDelay
- soInferFunctionPermissions :: InferFunctionPermissions
- soEnableMaintenanceMode :: MaintenanceMode ()
- soSchemaPollInterval :: OptionalInterval
- soExperimentalFeatures :: HashSet ExperimentalFeature
- soEventsFetchBatchSize :: NonNegativeInt
- soDevMode :: Bool
- soGracefulShutdownTimeout :: NonNegative Seconds
- soWebSocketConnectionInitTimeout :: WSConnectionInitTimeout
- soEventingMode :: EventingMode
- soReadOnlyMode :: ReadOnlyMode
- soEnableMetadataQueryLogging :: MetadataQueryLoggingMode
- soDefaultNamingConvention :: Maybe NamingCase
- soExtensionsSchema :: ExtensionsSchema
- data ResponseInternalErrorsConfig
- shouldIncludeInternal :: RoleName -> ResponseInternalErrorsConfig -> Bool
- data DowngradeOptions = DowngradeOptions {
- dgoTargetVersion :: Text
- dgoDryRun :: Bool
Documentation
The collected default value, env var, and help message for an option. If there should be no default value then use 'Option ()'.
data HGEOptionsRaw impl Source #
Raw HGE Options from the arg parser and the env.
horDatabaseUrl :: Lens' (HGEOptionsRaw impl) (PostgresConnInfo (Maybe PostgresConnInfoRaw)) Source #
horMetadataDbUrl :: Lens' (HGEOptionsRaw impl) (Maybe String) Source #
horCommand :: Lens' (HGEOptionsRaw impl) (HGECommand impl) Source #
data HGEOptions impl Source #
The final processed HGE options.
HGEOptions | |
|
hoCommand :: Lens' (HGEOptions impl) (HGECommand impl) Source #
data PostgresConnInfo a Source #
Postgres connection info tupled with a retry count.
In practice, the a
here is one of the following:
1. 'Maybe PostgresConnInfoRaw'
2. 'Maybe UrlConf'
3. 'Maybe Text'
4. 'Maybe DatabaseUrl' where DatabaseUrl
is an alias for Text
If it contains a 'Maybe PostgresConnInfoRaw' then you have not yet processed your arg parser results.
Instances
pciDatabaseConn :: Lens' (PostgresConnInfo a) a Source #
pciRetries :: Lens' (PostgresConnInfo a) (Maybe Int) Source #
data PostgresConnInfoRaw Source #
Postgres Connection info in the form of a templated URI string or structured data.
Instances
Eq PostgresConnInfoRaw Source # | |
Defined in Hasura.Server.Init.Config (==) :: PostgresConnInfoRaw -> PostgresConnInfoRaw -> Bool # (/=) :: PostgresConnInfoRaw -> PostgresConnInfoRaw -> Bool # | |
Show PostgresConnInfoRaw Source # | |
Defined in Hasura.Server.Init.Config showsPrec :: Int -> PostgresConnInfoRaw -> ShowS # show :: PostgresConnInfoRaw -> String # showList :: [PostgresConnInfoRaw] -> ShowS # |
_PGConnDatabaseUrl :: Prism' PostgresConnInfoRaw URLTemplate Source #
data PostgresConnDetailsRaw Source #
Structured Postgres connection information as provided by the arg parser or env vars.
PostgresConnDetailsRaw | |
|
Instances
Eq PostgresConnDetailsRaw Source # | |
Defined in Hasura.Server.Init.Config | |
Read PostgresConnDetailsRaw Source # | |
Show PostgresConnDetailsRaw Source # | |
Defined in Hasura.Server.Init.Config showsPrec :: Int -> PostgresConnDetailsRaw -> ShowS # show :: PostgresConnDetailsRaw -> String # showList :: [PostgresConnDetailsRaw] -> ShowS # | |
FromJSON PostgresConnDetailsRaw Source # | |
Defined in Hasura.Server.Init.Config parseJSON :: Value -> Parser PostgresConnDetailsRaw parseJSONList :: Value -> Parser [PostgresConnDetailsRaw] | |
ToJSON PostgresConnDetailsRaw Source # | |
Defined in Hasura.Server.Init.Config toJSON :: PostgresConnDetailsRaw -> Value toEncoding :: PostgresConnDetailsRaw -> Encoding toJSONList :: [PostgresConnDetailsRaw] -> Value toEncodingList :: [PostgresConnDetailsRaw] -> Encoding |
rawConnDetailsToUrlText :: PostgresConnDetailsRaw -> Text Source #
data HGECommand a Source #
The HGE Arg parser Command choices.
This is polymorphic so that we can pack either ServeOptionsRaw
or
ProServeOptionsRaw
in it.
Instances
Eq a => Eq (HGECommand a) Source # | |
Defined in Hasura.Server.Init.Config (==) :: HGECommand a -> HGECommand a -> Bool # (/=) :: HGECommand a -> HGECommand a -> Bool # | |
Show a => Show (HGECommand a) Source # | |
Defined in Hasura.Server.Init.Config showsPrec :: Int -> HGECommand a -> ShowS # show :: HGECommand a -> String # showList :: [HGECommand a] -> ShowS # |
_HCServe :: Prism' (HGECommand a) a Source #
data ServeOptionsRaw impl Source #
The Serve Command options accumulated from the Arg and Env parsers.
NOTE: A Nothing
value indicates the absence of a particular
flag. Hence types such as 'Maybe (HashSet X)' or 'Maybe Bool'.
An Int
representing a Port number in the range 0 to 65536.
Instances
Eq Port Source # | |
Ord Port Source # | |
Show Port Source # | |
Generic Port Source # | |
NFData Port Source # | |
Defined in Hasura.Server.Init.Config | |
Hashable Port Source # | |
Defined in Hasura.Server.Init.Config | |
FromJSON Port Source # | |
Defined in Hasura.Server.Init.Config parseJSON :: Value -> Parser Port parseJSONList :: Value -> Parser [Port] | |
ToJSON Port Source # | |
Defined in Hasura.Server.Init.Config | |
Cacheable Port Source # | |
FromEnv Port Source # | |
type Rep Port Source # | |
Defined in Hasura.Server.Init.Config |
unsafePort :: Int -> Port Source #
Instances
Eq API Source # | |
Read API Source # | |
Show API Source # | |
Generic API Source # | |
Hashable API Source # | |
Defined in Hasura.Server.Init.Config | |
FromJSON API Source # | |
Defined in Hasura.Server.Init.Config parseJSON :: Value -> Parser API parseJSONList :: Value -> Parser [API] | |
ToJSON API Source # | |
Defined in Hasura.Server.Init.Config | |
FromEnv (HashSet API) Source # | |
type Rep API Source # | |
Defined in Hasura.Server.Init.Config type Rep API = D1 ('MetaData "API" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) ((C1 ('MetaCons "METADATA" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "GRAPHQL" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PGDUMP" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "DEVELOPER" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CONFIG" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "METRICS" 'PrefixI 'False) (U1 :: Type -> Type)))) |
data AuthHookRaw Source #
AuthHookRaw | |
|
data OptionalInterval Source #
Sleep time interval for recurring activities such as (@asyncActionsProcessor
)
Presently msToOptionalInterval
interprets `0` as Skip.
Skip | No polling |
Interval (NonNegative Milliseconds) | Interval time |
Instances
Eq OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config (==) :: OptionalInterval -> OptionalInterval -> Bool # (/=) :: OptionalInterval -> OptionalInterval -> Bool # | |
Show OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config showsPrec :: Int -> OptionalInterval -> ShowS # show :: OptionalInterval -> String # showList :: [OptionalInterval] -> ShowS # | |
FromJSON OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config parseJSON :: Value -> Parser OptionalInterval parseJSONList :: Value -> Parser [OptionalInterval] | |
ToJSON OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config toJSON :: OptionalInterval -> Value toEncoding :: OptionalInterval -> Encoding toJSONList :: [OptionalInterval] -> Value toEncodingList :: [OptionalInterval] -> Encoding | |
FromEnv OptionalInterval Source # | |
Defined in Hasura.Server.Init.Env |
data ConnParamsRaw Source #
The Raw configuration data from the Arg and Env parsers needed to
construct a ConnParams
ConnParamsRaw | |
|
Instances
Eq ConnParamsRaw Source # | |
Defined in Hasura.Server.Init.Config (==) :: ConnParamsRaw -> ConnParamsRaw -> Bool # (/=) :: ConnParamsRaw -> ConnParamsRaw -> Bool # | |
Show ConnParamsRaw Source # | |
Defined in Hasura.Server.Init.Config showsPrec :: Int -> ConnParamsRaw -> ShowS # show :: ConnParamsRaw -> String # showList :: [ConnParamsRaw] -> ShowS # |
newtype KeepAliveDelay Source #
Instances
Eq KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config (==) :: KeepAliveDelay -> KeepAliveDelay -> Bool # (/=) :: KeepAliveDelay -> KeepAliveDelay -> Bool # | |
Show KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config showsPrec :: Int -> KeepAliveDelay -> ShowS # show :: KeepAliveDelay -> String # showList :: [KeepAliveDelay] -> ShowS # | |
FromJSON KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config parseJSON :: Value -> Parser KeepAliveDelay parseJSONList :: Value -> Parser [KeepAliveDelay] | |
ToJSON KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config toJSON :: KeepAliveDelay -> Value toEncoding :: KeepAliveDelay -> Encoding toJSONList :: [KeepAliveDelay] -> Value toEncodingList :: [KeepAliveDelay] -> Encoding | |
FromEnv KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Env |
newtype WSConnectionInitTimeout Source #
The timeout duration in Seconds
for a WebSocket connection.
Instances
data ServeOptions impl Source #
The final Serve Command options accummulated from the Arg Parser and the Environment, fully processed and ready to apply when running the server.
data ResponseInternalErrorsConfig Source #
ResponseInternalErrorsConfig
represents the encoding of the
internal errors in the response to the client.
For more details, see this github comment: https://github.com/hasura/graphql-engine/issues/4031#issuecomment-609747705
Instances
data DowngradeOptions Source #
The Downgrade Command options. These are only sourced from the
Arg Parser and are used directly in Migrate
.
DowngradeOptions | |
|
Instances
Eq DowngradeOptions Source # | |
Defined in Hasura.Server.Init.Config (==) :: DowngradeOptions -> DowngradeOptions -> Bool # (/=) :: DowngradeOptions -> DowngradeOptions -> Bool # | |
Show DowngradeOptions Source # | |
Defined in Hasura.Server.Init.Config showsPrec :: Int -> DowngradeOptions -> ShowS # show :: DowngradeOptions -> String # showList :: [DowngradeOptions] -> ShowS # |
Note Experimental features:
The graphql-engine accepts a list of experimental features that can be enabled at the startup. Experimental features are a way to introduce new, but not stable features to our users in a manner in which they have the choice to enable or disable a certain feature(s).
The objective of an experimental feature should be that when the feature is disabled, the graphql-engine should work the same way as it worked before adding the said feature.
The experimental feature's flag is `--experimental-features` and the corresponding
environment variable is HASURA_GRAPHQL_EXPERIMENTAL_FEATURES
which expects a comma-seperated
value.
When an experimental feature is stable enough i.e. it's stable through multiple non-beta releases then we make the feature not experimental i.e. it will always be enabled. Note that when we do this we still have to support parsing of the experimental feature because users of the previous version will have it enabled and when they upgrade an error should not be thrown at the startup. For example:
The inherited roles was an experimental feature when introduced and it was enabled by
setting `--experimental-features` to inherited_roles
and then it was decided to make the inherited roles
a stable feature, so it was removed as an experimental feature but the code was modified such that
`--experimental-features inherited_roles` to not throw an error.
Note ReadOnly Mode:
This mode starts the server in a (database) read-only mode. That is, only read-only queries are allowed on users' database sources, and write queries throw a runtime error. The use-case is for failsafe operations. Metadata APIs are also disabled.
Following is the precise behaviour - 1. For any GraphQL API (relayhasura; httpwebsocket) - disable execution of mutations 2. Metadata API is disabled 3. v2query API - insert, delete, update, run_sql are disabled 4. v1query API - insert, delete, update, run_sql are disabled 5. No source catalog migrations are run 6. During build schema cache phase, building event triggers are disabled (as they create corresponding database triggers)