| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hasura.RQL.DDL.Webhook.Transform.Method
Synopsis
- newtype Method = Method (CI Text)
- newtype MethodTransformFn = Replace Method
- applyMethodTransformFn :: MonadError TransformErrorBundle m => MethodTransformFn -> RequestTransformCtx -> Method -> m Method
- validateMethodTransformFn :: TemplatingEngine -> MethodTransformFn -> Validation TransformErrorBundle ()
Documentation
The actual request method we are transforming.
This newtype is necessary because otherwise we end up with an orphan instance.
Constructors
| Method (CI Text) |
Instances
newtype MethodTransformFn Source #
The defunctionalized transformation on Method.
Instances
applyMethodTransformFn :: MonadError TransformErrorBundle m => MethodTransformFn -> RequestTransformCtx -> Method -> m Method Source #
Provide an implementation for the transformations defined by
MethodTransformFn.
If one views MethodTransformFn as an interface describing HTTP method
transformations, this can be seen as an implementation of these
transformations as normal Haskell functions.
validateMethodTransformFn :: TemplatingEngine -> MethodTransformFn -> Validation TransformErrorBundle () Source #
Validate that the provided MethodTransformFn 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 MethodTransformFn.
XXX: Do we want to validate the HTTP method verb?