graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
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

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.

horCommand :: Lens' (HGEOptionsRaw impl) (HGECommand impl) Source #

data HGEOptions impl Source #

The final processed HGE options.

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.

Constructors

PostgresConnInfo 

Instances

Instances details
Functor PostgresConnInfo Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

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

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

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) #

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

Defined in Hasura.Server.Init.Config

Show a => Show (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
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 #

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

Defined in Hasura.Server.Init.Config

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

Constructors

ServeOptionsRaw 

Fields

newtype Port Source #

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

Constructors

Port 

Fields

Instances

Instances details
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 #

Show Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

showsPrec :: Int -> Port -> ShowS #

show :: Port -> String #

showList :: [Port] -> ShowS #

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 #

NFData Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

rnf :: Port -> () #

Hashable Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

hashWithSalt :: Int -> Port -> Int

hash :: Port -> Int

FromJSON Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

parseJSON :: Value -> Parser Port

parseJSONList :: Value -> Parser [Port]

ToJSON Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

toJSON :: Port -> Value

toEncoding :: Port -> Encoding

toJSONList :: [Port] -> Value

toEncodingList :: [Port] -> Encoding

Cacheable Port Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

unchanged :: Accesses -> Port -> Port -> Bool Source #

FromEnv Port Source # 
Instance details

Defined in Hasura.Server.Init.Env

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
Eq API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

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

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

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 #

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 #

Hashable API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

hashWithSalt :: Int -> API -> Int

hash :: API -> Int

FromJSON API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

parseJSON :: Value -> Parser API

parseJSONList :: Value -> Parser [API]

ToJSON API Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

toJSON :: API -> Value

toEncoding :: API -> Encoding

toJSONList :: [API] -> Value

toEncodingList :: [API] -> Encoding

FromEnv (HashSet API) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

fromEnv :: String -> Either String (HashSet API) Source #

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

Constructors

AuthHookRaw 

Fields

data OptionalInterval Source #

Sleep time interval for recurring activities such as (@asyncActionsProcessor) Presently msToOptionalInterval interprets `0` as Skip.

Constructors

Skip

No polling

Interval (NonNegative Milliseconds)

Interval time

Instances

Instances details
Eq OptionalInterval Source # 
Instance details

Defined in Hasura.Server.Init.Config

Show OptionalInterval Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromJSON OptionalInterval Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

parseJSON :: Value -> Parser OptionalInterval

parseJSONList :: Value -> Parser [OptionalInterval]

ToJSON OptionalInterval Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromEnv OptionalInterval Source # 
Instance details

Defined in Hasura.Server.Init.Env

data ConnParamsRaw Source #

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

Constructors

ConnParamsRaw 

Fields

Instances

Instances details
Eq ConnParamsRaw Source # 
Instance details

Defined in Hasura.Server.Init.Config

Show ConnParamsRaw Source # 
Instance details

Defined in Hasura.Server.Init.Config

newtype KeepAliveDelay Source #

Instances

Instances details
Eq KeepAliveDelay Source # 
Instance details

Defined in Hasura.Server.Init.Config

Show KeepAliveDelay Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromJSON KeepAliveDelay Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

parseJSON :: Value -> Parser KeepAliveDelay

parseJSONList :: Value -> Parser [KeepAliveDelay]

ToJSON KeepAliveDelay Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

toJSON :: KeepAliveDelay -> Value

toEncoding :: KeepAliveDelay -> Encoding

toJSONList :: [KeepAliveDelay] -> Value

toEncodingList :: [KeepAliveDelay] -> Encoding

FromEnv KeepAliveDelay Source # 
Instance details

Defined in Hasura.Server.Init.Env

newtype WSConnectionInitTimeout Source #

The timeout duration in Seconds for a WebSocket connection.

Instances

Instances details
Eq WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

Ord WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

Show WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

FromJSON WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Config

Methods

parseJSON :: Value -> Parser WSConnectionInitTimeout

parseJSONList :: Value -> Parser [WSConnectionInitTimeout]

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

Constructors

DowngradeOptions 

Fields

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)