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

Hasura.RQL.DDL.Webhook.Transform.Request

Description

Types and subroutines related to constructing transformations on HTTP requests.

Synopsis

Documentation

mkReqTransformCtx :: Text -> Maybe SessionVariables -> TemplatingEngine -> Request -> RequestTransformCtx Source #

A smart constructor for constructing the RequestTransformCtx

XXX: This function makes internal usage of decodeUtf8, which throws an impure exception when the supplied ByteString cannot be decoded into valid UTF8 text!

runRequestTemplateTransform :: Template -> RequestTransformCtx -> Either TransformErrorBundle Value Source #

A helper function for executing transformations from a Template and a RequestTransformCtx.

NOTE: This and all related funtions are hard-coded to Kriti at the moment. When we add additional template engines this function will need to take a TemplatingEngine parameter.

runUnescapedRequestTemplateTransform :: RequestTransformCtx -> UnescapedTemplate -> Either TransformErrorBundle ByteString Source #

A helper function for executing Kriti transformations from a UnescapedTemplate and a RequestTrasformCtx.

The difference from runRequestTemplateTransform is that this function will wrap the template text in double quotes before running Kriti.