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

Hasura.RQL.DDL.Webhook.Transform.Validation

Description

We validate TransformFn terms inside RequestTransform before dispatching Metadata actions in runMetadataQueryV1M. Validation follows the same HKD pattern from applyRequestTransform but using btraverseC to call validate from the Transform class on all the HKD fields.

Synopsis

Documentation

type Tuple1 a b = Compose ((,) a) b Source #

type ValidationFields = RequestFields (OptionalTuple1 TemplatingEngine TransformFn) Source #

A variation on RequestTransformFn where TransformFn is tupled with TemplatingEngine. This is necessary to validate the TransformFn.

TODO: In the future we most likely want to embed the TemplatingEngine in the TransformFn or the Template/UnwrappedTemplate, in which case we would not need this alias for validation.

transformFns :: Lens' RequestTransform ValidationFields Source #

A lens for zipping our defunctionalized transform with the TemplatingEngine for validation.

newtype Unvalidated a Source #

Used to annotate that a RequestTransform, or some record containing a RequestTransform has not yet been validated.

Constructors

Unvalidated 

Fields

Instances

Instances details
FromJSON a => FromJSON (Unvalidated a) Source # 
Instance details

Defined in Hasura.RQL.DDL.Webhook.Transform.Validation

Methods

parseJSON :: Value -> Parser (Unvalidated a)

parseJSONList :: Value -> Parser [Unvalidated a]

ToJSON a => ToJSON (Unvalidated a) Source # 
Instance details

Defined in Hasura.RQL.DDL.Webhook.Transform.Validation

Methods

toJSON :: Unvalidated a -> Value

toEncoding :: Unvalidated a -> Encoding

toJSONList :: [Unvalidated a] -> Value

toEncodingList :: [Unvalidated a] -> Encoding

unUnvalidate :: Lens' (Unvalidated a) a Source #

A lens for focusing through Unvalidated in validateTransforms.

newtype Unvalidated1 (f :: k -> Type) (a :: k) Source #

Used to annotate that a higher kinded type containing a RequestTransform has not yet been validated.

This is needed specifically for CreateEventTriggerQuery and any other type that is paramterized by a BackendType.

Constructors

Unvalidated1 

Fields

Instances

Instances details
FromJSON (f a) => FromJSON (Unvalidated1 f a) Source # 
Instance details

Defined in Hasura.RQL.DDL.Webhook.Transform.Validation

Methods

parseJSON :: Value -> Parser (Unvalidated1 f a)

parseJSONList :: Value -> Parser [Unvalidated1 f a]

ToJSON (f a) => ToJSON (Unvalidated1 f a) Source # 
Instance details

Defined in Hasura.RQL.DDL.Webhook.Transform.Validation

Methods

toJSON :: Unvalidated1 f a -> Value

toEncoding :: Unvalidated1 f a -> Encoding

toJSONList :: [Unvalidated1 f a] -> Value

toEncodingList :: [Unvalidated1 f a] -> Encoding

unUnvalidate1 :: Lens' (Unvalidated1 f a) (f a) Source #

A lens for focusing through Unvalidated1 in validateTransforms.

validateTransforms :: MonadError QErr m => LensLike (Either TransformErrorBundle) api api RequestTransform RequestTransform -> (api -> m EncJSON) -> api -> m EncJSON Source #

Used to focus into a records in RQLMetadataV1 and validate any RequestTransform terms present.