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

Hasura.RQL.DDL.Webhook.Transform.Body

Synopsis

Documentation

data Body Source #

HTTP message body being transformed.

Constructors

JSONBody (Maybe Value) 
RawBody ByteString 

Instances

Instances details
Eq Body Source # 
Instance details

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

Methods

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

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

Show Body Source # 
Instance details

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

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

Transform Body Source # 
Instance details

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

Associated Types

data TransformFn Body Source #

Eq (TransformFn Body) Source # 
Instance details

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

Show (TransformFn Body) Source # 
Instance details

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

Generic (TransformFn Body) Source # 
Instance details

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

Associated Types

type Rep (TransformFn Body) :: Type -> Type #

NFData (TransformFn Body) Source # 
Instance details

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

Methods

rnf :: TransformFn Body -> () #

FromJSON (TransformFn Body) Source # 
Instance details

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

Methods

parseJSON :: Value -> Parser (TransformFn Body)

parseJSONList :: Value -> Parser [TransformFn Body]

ToJSON (TransformFn Body) Source # 
Instance details

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

Methods

toJSON :: TransformFn Body -> Value

toEncoding :: TransformFn Body -> Encoding

toJSONList :: [TransformFn Body] -> Value

toEncodingList :: [TransformFn Body] -> Encoding

Cacheable (TransformFn Body) Source # 
Instance details

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

newtype TransformFn Body Source # 
Instance details

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

type Rep (TransformFn Body) Source # 
Instance details

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

type Rep (TransformFn Body) = D1 ('MetaData "TransformFn" "Hasura.RQL.DDL.Webhook.Transform.Body" "graphql-engine-1.0.0-inplace" 'True) (C1 ('MetaCons "BodyTransformFn_" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BodyTransformFn)))

data BodyTransformFn Source #

The transformations which can be applied to an HTTP message body.

Constructors

Remove

Remove the HTTP message body.

ModifyAsJSON Template

Modify the JSON message body by applying a Template transformation.

ModifyAsFormURLEncoded (HashMap Text UnescapedTemplate)

Modify the JSON message body by applying UnescapedTemplate transformations to each field with a matching Text key.

Instances

Instances details
Eq BodyTransformFn Source # 
Instance details

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

Show BodyTransformFn Source # 
Instance details

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

Generic BodyTransformFn Source # 
Instance details

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

Associated Types

type Rep BodyTransformFn :: Type -> Type #

NFData BodyTransformFn Source # 
Instance details

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

Methods

rnf :: BodyTransformFn -> () #

FromJSON BodyTransformFn Source # 
Instance details

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

Methods

parseJSON :: Value -> Parser BodyTransformFn

parseJSONList :: Value -> Parser [BodyTransformFn]

ToJSON BodyTransformFn Source # 
Instance details

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

Methods

toJSON :: BodyTransformFn -> Value

toEncoding :: BodyTransformFn -> Encoding

toJSONList :: [BodyTransformFn] -> Value

toEncodingList :: [BodyTransformFn] -> Encoding

Cacheable BodyTransformFn Source # 
Instance details

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

type Rep BodyTransformFn Source # 
Instance details

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

type Rep BodyTransformFn = D1 ('MetaData "BodyTransformFn" "Hasura.RQL.DDL.Webhook.Transform.Body" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "Remove" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ModifyAsJSON" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Template)) :+: C1 ('MetaCons "ModifyAsFormURLEncoded" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HashMap Text UnescapedTemplate)))))

applyBodyTransformFn :: MonadError TransformErrorBundle m => BodyTransformFn -> RequestTransformCtx -> Body -> m Body Source #

Provide an implementation for the transformations defined by BodyTransformFn.

If one views BodyTransformFn as an interface describing HTTP message body transformations, this can be seen as an implementation of these transformations as normal Haskell functions.

validateBodyTransformFn :: TemplatingEngine -> BodyTransformFn -> Validation TransformErrorBundle () Source #

Validate that the provided BodyTransformFn is correct in the context of a particular TemplatingEngine.

This is a product of the fact that the correctness of a given transformation may be dependent on zero, one, or more of the templated transformations encoded within the given BodyTransformFn.

foldFormEncoded :: HashMap Text ByteString -> ByteString Source #

Fold a HashMap of header key/value pairs into an x-www-form-urlencoded message body.

escapeURIText :: Text -> Text Source #

URI-escape Text blobs.

escapeURIBS :: ByteString -> ByteString Source #

URI-escape ByteString blobs, which are presumed to represent Text.

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