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

Hasura.RQL.DDL.Webhook.Transform.Class

Description

The Transform typeclass with various types and helper functions for evaluating transformations.

Synopsis

Documentation

class Transform a where Source #

Transform describes how to reify a defunctionalized transformation for a particular request field.

Methods

transform :: MonadError TransformErrorBundle m => TransformFn a -> TransformCtx a -> a -> m a Source #

transform is a function which takes TransformFn of a and reifies it into a function of the form:

  ReqTransformCtx -> a -> m a

validate :: TemplatingEngine -> TransformFn a -> Validation TransformErrorBundle () Source #

Validate a TransformFn of a.

Instances

Instances details
Transform Body Source # 
Instance details

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

Transform Headers Source # 
Instance details

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

Transform Method Source # 
Instance details

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

Transform QueryParams Source # 
Instance details

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

Transform Url Source # 
Instance details

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

throwErrorBundle :: MonadError TransformErrorBundle m => Text -> Maybe Value -> m a Source #

A helper function for serializing transformation errors to JSON.

encodeScalar :: MonadError TransformErrorBundle m => Value -> m ByteString Source #

Encode a JSON Scalar Value as a ByteString. If a non-Scalar value is provided, will return a TrnasformErrorBundle