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

Hasura.Server.Init.Config

Description

Types and classes related to configuration when the server is initialised

Synopsis

Documentation

data Option def Source #

The collected default value, env var, and help message for an option. If there should be no default value then use 'Option ()'.

Constructors

Option 

Fields

Instances

Instances details
Functor Option Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

fmap :: (a -> b) -> Option a -> Option b #

(<$) :: a -> Option b -> Option a #

optionPP :: Option a -> (String, String) Source #

Helper function for pretty printing Option a.

data HGEOptionsRaw impl Source #

Raw HGE Options from the arg parser and the env.

data HGEOptions impl Source #

The final processed HGE options.

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.

Constructors

PostgresConnInfo 

Instances

Instances details
Foldable PostgresConnInfo Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

fold :: Monoid m => PostgresConnInfo m -> m #

foldMap :: Monoid m => (a -> m) -> PostgresConnInfo a -> m #

foldMap' :: Monoid m => (a -> m) -> PostgresConnInfo a -> m #

foldr :: (a -> b -> b) -> b -> PostgresConnInfo a -> b #

foldr' :: (a -> b -> b) -> b -> PostgresConnInfo a -> b #

foldl :: (b -> a -> b) -> b -> PostgresConnInfo a -> b #

foldl' :: (b -> a -> b) -> b -> PostgresConnInfo a -> b #

foldr1 :: (a -> a -> a) -> PostgresConnInfo a -> a #

foldl1 :: (a -> a -> a) -> PostgresConnInfo a -> a #

toList :: PostgresConnInfo a -> [a] #

null :: PostgresConnInfo a -> Bool #

length :: PostgresConnInfo a -> Int #

elem :: Eq a => a -> PostgresConnInfo a -> Bool #

maximum :: Ord a => PostgresConnInfo a -> a #

minimum :: Ord a => PostgresConnInfo a -> a #

sum :: Num a => PostgresConnInfo a -> a #

product :: Num a => PostgresConnInfo a -> a #

Traversable PostgresConnInfo Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

traverse :: Applicative f => (a -> f b) -> PostgresConnInfo a -> f (PostgresConnInfo b) #

sequenceA :: Applicative f => PostgresConnInfo (f a) -> f (PostgresConnInfo a) #

mapM :: Monad m => (a -> m b) -> PostgresConnInfo a -> m (PostgresConnInfo b) #

sequence :: Monad m => PostgresConnInfo (m a) -> m (PostgresConnInfo a) #

Functor PostgresConnInfo Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

fmap :: (a -> b) -> PostgresConnInfo a -> PostgresConnInfo b #

(<$) :: a -> PostgresConnInfo b -> PostgresConnInfo a #

Show a => Show (PostgresConnInfo a) Source # 
Instance details

Defined in Hasura.Server.Init.Config

Eq a => Eq (PostgresConnInfo a) Source # 
Instance details

Defined in Hasura.Server.Init.Config

data PostgresConnInfoRaw Source #

Postgres Connection info in the form of a templated URI string or structured data.

data PostgresConnDetailsRaw Source #

Structured Postgres connection information as provided by the arg parser or env vars.

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

Instances details
Show a => Show (HGECommand a) Source # 
Instance details

Defined in Hasura.Server.Init.Config

Eq a => Eq (HGECommand a) Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

(==) :: HGECommand a -> HGECommand a -> Bool #

(/=) :: HGECommand a -> HGECommand a -> Bool #

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'.

Constructors

ServeOptionsRaw 

Fields

data ConsoleStatus Source #

Whether or not to serve Console assets.

Instances

Instances details
FromJSON ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep ConsoleStatus :: Type -> Type #

Show ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

NFData ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

rnf :: ConsoleStatus -> () #

Eq ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Ord ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Hashable ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep ConsoleStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep ConsoleStatus = D1 ('MetaData "ConsoleStatus" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "ConsoleEnabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ConsoleDisabled" 'PrefixI 'False) (U1 :: Type -> Type))

data AdminInternalErrorsStatus Source #

Whether or not internal errors will be sent in response to admin.

Instances

Instances details
FromJSON AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep AdminInternalErrorsStatus :: Type -> Type #

Show AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

NFData AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Eq AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Ord AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromEnv AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Env

Hashable AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep AdminInternalErrorsStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep AdminInternalErrorsStatus = D1 ('MetaData "AdminInternalErrorsStatus" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "AdminInternalErrorsEnabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AdminInternalErrorsDisabled" 'PrefixI 'False) (U1 :: Type -> Type))

data AllowListStatus Source #

A representation of whether or not to enable the GraphQL Query AllowList.

See: https://hasura.io/docs/latest/security/allow-list/#enable-allow-list

Instances

Instances details
FromJSON AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep AllowListStatus :: Type -> Type #

Show AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

NFData AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

rnf :: AllowListStatus -> () #

Eq AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Ord AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Hashable AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep AllowListStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep AllowListStatus = D1 ('MetaData "AllowListStatus" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "AllowListEnabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AllowListDisabled" 'PrefixI 'False) (U1 :: Type -> Type))

data DevModeStatus Source #

A representation of whether or not to enable Hasura Dev Mode.

See: https://hasura.io/docs/latest/deployment/graphql-engine-flags/config-examples/#dev-mode

Instances

Instances details
FromJSON DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep DevModeStatus :: Type -> Type #

Show DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

NFData DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

rnf :: DevModeStatus -> () #

Eq DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Ord DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Hashable DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep DevModeStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep DevModeStatus = D1 ('MetaData "DevModeStatus" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "DevModeEnabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DevModeDisabled" 'PrefixI 'False) (U1 :: Type -> Type))

data TelemetryStatus Source #

A representation of whether or not to enable telemetry that is isomorphic to Bool.

Instances

Instances details
FromJSON TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep TelemetryStatus :: Type -> Type #

Show TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

NFData TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

rnf :: TelemetryStatus -> () #

Eq TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Ord TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromEnv TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Env

Hashable TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep TelemetryStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep TelemetryStatus = D1 ('MetaData "TelemetryStatus" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "TelemetryEnabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TelemetryDisabled" 'PrefixI 'False) (U1 :: Type -> Type))

data WsReadCookieStatus Source #

A representation of whether or not to read the websocket cookie on initial handshake that is isomorphic to Bool. See wsReadCookieOption for more details.

Instances

Instances details
FromJSON WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep WsReadCookieStatus :: Type -> Type #

Show WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

NFData WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

rnf :: WsReadCookieStatus -> () #

Eq WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromEnv WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Env

Hashable WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep WsReadCookieStatus Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep WsReadCookieStatus = D1 ('MetaData "WsReadCookieStatus" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "WsReadCookieEnabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WsReadCookieDisabled" 'PrefixI 'False) (U1 :: Type -> Type))

data Port Source #

An Int representing a Port number in the range 0 to 65536.

Instances

Instances details
FromJSON Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep Port :: Type -> Type #

Methods

from :: Port -> Rep Port x #

to :: Rep Port x -> Port #

Show Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

showsPrec :: Int -> Port -> ShowS #

show :: Port -> String #

showList :: [Port] -> ShowS #

NFData Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

rnf :: Port -> () #

Eq Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

(==) :: Port -> Port -> Bool #

(/=) :: Port -> Port -> Bool #

Ord Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

compare :: Port -> Port -> Ordering #

(<) :: Port -> Port -> Bool #

(<=) :: Port -> Port -> Bool #

(>) :: Port -> Port -> Bool #

(>=) :: Port -> Port -> Bool #

max :: Port -> Port -> Port #

min :: Port -> Port -> Port #

FromEnv Port Source # 
Instance details

Defined in Hasura.Server.Init.Env

Hashable Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

type Rep Port = D1 ('MetaData "Port" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'True) (C1 ('MetaCons "Port" 'PrefixI 'True) (S1 ('MetaSel ('Just "_getPort") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data API Source #

Instances

Instances details
FromJSON API Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Generic API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Associated Types

type Rep API :: Type -> Type #

Methods

from :: API -> Rep API x #

to :: Rep API x -> API #

Read API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Show API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

showsPrec :: Int -> API -> ShowS #

show :: API -> String #

showList :: [API] -> ShowS #

Eq API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

(==) :: API -> API -> Bool #

(/=) :: API -> API -> Bool #

Hashable API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

hashWithSalt :: Int -> API -> Int Source #

hash :: API -> Int Source #

FromEnv (HashSet API) Source # 
Instance details

Defined in Hasura.Server.Init.Env

type Rep API Source # 
Instance details

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 ConnParamsRaw Source #

The Raw configuration data from the Arg and Env parsers needed to construct a ConnParams

Constructors

ConnParamsRaw 

Fields

Instances

Instances details
Show ConnParamsRaw Source # 
Instance details

Defined in Hasura.Server.Init.Config

Eq ConnParamsRaw Source # 
Instance details

Defined in Hasura.Server.Init.Config

newtype WSConnectionInitTimeout Source #

The timeout duration in Seconds for a WebSocket connection.

Instances

Instances details
FromJSON WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

ToJSON WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

Show WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

Eq WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

Ord WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromEnv WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Env

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.

Constructors

ServeOptions 

Fields

data DowngradeOptions Source #

The Downgrade Command options. These are only sourced from the Arg Parser and are used directly in Migrate.

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)