graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.RQL.Types.SourceCustomization

Synopsis

Documentation

data RootFieldsCustomization Source #

Instances

Instances details
Eq RootFieldsCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Show RootFieldsCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Generic RootFieldsCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Associated Types

type Rep RootFieldsCustomization :: Type -> Type #

FromJSON RootFieldsCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Methods

parseJSON :: Value -> Parser RootFieldsCustomization

parseJSONList :: Value -> Parser [RootFieldsCustomization]

ToJSON RootFieldsCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Cacheable RootFieldsCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

type Rep RootFieldsCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

type Rep RootFieldsCustomization = D1 ('MetaData "RootFieldsCustomization" "Hasura.RQL.Types.SourceCustomization" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RootFieldsCustomization" 'PrefixI 'True) (S1 ('MetaSel ('Just "_rootfcNamespace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Name)) :*: (S1 ('MetaSel ('Just "_rootfcPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Name)) :*: S1 ('MetaSel ('Just "_rootfcSuffix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Name)))))

data SourceTypeCustomization Source #

Constructors

SourceTypeCustomization 

Fields

Instances

Instances details
Eq SourceTypeCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Show SourceTypeCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Generic SourceTypeCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Associated Types

type Rep SourceTypeCustomization :: Type -> Type #

FromJSON SourceTypeCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Methods

parseJSON :: Value -> Parser SourceTypeCustomization

parseJSONList :: Value -> Parser [SourceTypeCustomization]

ToJSON SourceTypeCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Cacheable SourceTypeCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

type Rep SourceTypeCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

type Rep SourceTypeCustomization = D1 ('MetaData "SourceTypeCustomization" "Hasura.RQL.Types.SourceCustomization" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "SourceTypeCustomization" 'PrefixI 'True) (S1 ('MetaSel ('Just "_stcPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Name)) :*: S1 ('MetaSel ('Just "_stcSuffix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Name))))

applyTypeCust :: Maybe SourceTypeCustomization -> NamingCase -> Name -> Name Source #

apply prefix and suffix to type name according to the source customization

applyFieldCust :: Maybe RootFieldsCustomization -> NamingCase -> Name -> Name Source #

apply prefix and suffix to field name according to the source customization

applyTypeNameCaseCust :: NamingCase -> Name -> Name Source #

apply naming convention to type name

applyFieldNameCaseCust :: NamingCase -> Name -> Name Source #

apply naming convention to field name

getTextFieldName :: NamingCase -> GQLNameIdentifier -> Text Source #

returns field name according to the naming conventions as Text

applyTypeNameCaseIdentifier :: NamingCase -> GQLNameIdentifier -> Name Source #

applies naming convention and returns field name

Note: This can't possibly fail as GQLNameIdentifier contains already validated identifiers

getTextTypeName :: NamingCase -> GQLNameIdentifier -> Text Source #

returns type name according to the naming conventions as Text

applyFieldNameCaseIdentifier :: NamingCase -> GQLNameIdentifier -> Name Source #

applies naming convention and returns type name

Note: This can't possibly fail as GQLNameIdentifier contains already validated identifiers

applyPrefixSuffix :: Maybe Name -> Maybe Name -> NamingCase -> Bool -> Name -> Name Source #

appendprepend the suffixprefix in the graphql name

data SourceCustomization Source #

Instances

Instances details
Eq SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Show SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Generic SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Associated Types

type Rep SourceCustomization :: Type -> Type #

HasCodec SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

FromJSON SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Methods

parseJSON :: Value -> Parser SourceCustomization

parseJSONList :: Value -> Parser [SourceCustomization]

ToJSON SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

Cacheable SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

type Rep SourceCustomization Source # 
Instance details

Defined in Hasura.RQL.Types.SourceCustomization

type Rep SourceCustomization = D1 ('MetaData "SourceCustomization" "Hasura.RQL.Types.SourceCustomization" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "SourceCustomization" 'PrefixI 'True) (S1 ('MetaSel ('Just "_scRootFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RootFieldsCustomization)) :*: (S1 ('MetaSel ('Just "_scTypeNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe SourceTypeCustomization)) :*: S1 ('MetaSel ('Just "_scNamingConvention") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe NamingCase)))))

withSourceCustomization :: forall m r a. (MonadReader r m, Has MkTypename r, Has NamingCase r, MonadError QErr m) => SourceCustomization -> SupportedNamingCase -> Maybe NamingCase -> m a -> m a Source #

Inject NamingCase, typename and root field name customizations from SourceCustomization into the environment.

withNamingCaseCustomization :: forall m r a. (MonadReader r m, Has NamingCase r) => NamingCase -> m a -> m a Source #