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

Hasura.Eventing.HTTP

Description

Hasura.Eventing.HTTP

This module is an utility module providing HTTP utilities for Hasura.Eventing.EventTriggers and Hasura.Eventing.ScheduledTriggers.

The event triggers and scheduled triggers share the event delivery mechanism using the tryWebhook function defined in this module.

Synopsis

Documentation

data HTTPResp (a :: TriggerTypes) Source #

Constructors

HTTPResp 

Instances

Instances details
ToJSON (HTTPResp a) Source # 
Instance details

Defined in Hasura.Eventing.HTTP

Generic (HTTPResp a) Source # 
Instance details

Defined in Hasura.Eventing.HTTP

Associated Types

type Rep (HTTPResp a) :: Type -> Type #

Methods

from :: HTTPResp a -> Rep (HTTPResp a) x #

to :: Rep (HTTPResp a) x -> HTTPResp a #

Show (HTTPResp a) Source # 
Instance details

Defined in Hasura.Eventing.HTTP

Methods

showsPrec :: Int -> HTTPResp a -> ShowS #

show :: HTTPResp a -> String #

showList :: [HTTPResp a] -> ShowS #

ToEngineLog (HTTPResp 'EventType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (HTTPResp 'ScheduledType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

type Rep (HTTPResp a) Source # 
Instance details

Defined in Hasura.Eventing.HTTP

type Rep (HTTPResp a) = D1 ('MetaData "HTTPResp" "Hasura.Eventing.HTTP" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "HTTPResp" 'PrefixI 'True) ((S1 ('MetaSel ('Just "hrsStatus") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "hrsHeaders") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [HeaderConf])) :*: (S1 ('MetaSel ('Just "hrsBody") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SerializableBlob) :*: S1 ('MetaSel ('Just "hrsSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int64))))

data RequestDetails Source #

Instances

Instances details
ToJSON RequestDetails Source # 
Instance details

Defined in Hasura.Eventing.HTTP

Generic RequestDetails Source # 
Instance details

Defined in Hasura.Eventing.HTTP

Associated Types

type Rep RequestDetails :: Type -> Type #

type Rep RequestDetails Source # 
Instance details

Defined in Hasura.Eventing.HTTP

type Rep RequestDetails = D1 ('MetaData "RequestDetails" "Hasura.Eventing.HTTP" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RequestDetails" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_rdOriginalRequest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Request) :*: (S1 ('MetaSel ('Just "_rdOriginalSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int64) :*: S1 ('MetaSel ('Just "_rdTransformedRequest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Request)))) :*: (S1 ('MetaSel ('Just "_rdTransformedSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int64)) :*: (S1 ('MetaSel ('Just "_rdReqTransformCtx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RequestContext)) :*: S1 ('MetaSel ('Just "_rdSessionVars") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe SessionVariables))))))

mkRequest Source #

Arguments

:: MonadError (TransformableRequestError a) m 
=> [Header] 
-> ResponseTimeout 
-> ByteString

the request body. It is passed as a Bytestring because we need to log the request size. As the logging happens outside the function, we pass it the final request body, instead of Value

-> Maybe RequestTransform 
-> ResolvedWebhook 
-> m RequestDetails 

prepareHeaders :: [EventHeaderInfo] -> ([Header], [HeaderConf]) Source #

Encodes given request headers along with our defaultHeaders and returns them along with the re-decoded set of headers (for logging purposes).