Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- fetchActionLogResponses :: (MonadError QErr m, MonadMetadataStorage (MetadataStorageT m), Foldable t) => t ActionId -> m (ActionLogResponseMap, Bool)
- runActionExecution :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m, MonadTrace m, MonadMetadataStorage (MetadataStorageT m)) => UserInfo -> ActionExecutionPlan -> m (DiffTime, (EncJSON, Maybe ResponseHeaders))
- asSingleRowJsonResp :: Query -> [PrepArg] -> TxE QErr EncJSON
- resolveActionExecution :: Environment -> Logger Hasura -> UserInfo -> AnnActionExecution Void -> ActionExecContext -> Maybe GQLQueryText -> ActionExecution
- throwUnexpected :: MonadError QErr m => Text -> m ()
- validateResponseObject :: MonadError QErr m => KeyMap Value -> ActionOutputFields -> m ()
- validateResponse :: MonadError QErr m => Value -> GraphQLType -> ActionOutputFields -> m ()
- makeActionResponseNoRelations :: ActionFields -> GraphQLType -> ActionOutputFields -> Bool -> ActionWebhookResponse -> Value
- gTypeContains :: (GType -> ActionOutputFields -> Bool) -> GType -> ActionOutputFields -> Bool
- isCustomScalar :: GType -> ActionOutputFields -> Bool
- resolveActionMutationAsync :: MonadMetadataStorage m => AnnActionMutationAsync -> [Header] -> SessionVariables -> m ActionId
- resolveAsyncActionQuery :: UserInfo -> AnnActionAsyncQuery ('Postgres 'Vanilla) Void -> AsyncActionQueryExecution (UnpreparedValue ('Postgres 'Vanilla))
- asyncActionsProcessor :: forall m. (MonadIO m, MonadBaseControl IO m, Forall (Pure m), HasReporter m, MonadMetadataStorage (MetadataStorageT m)) => Environment -> Logger Hasura -> IO SchemaCache -> TVar (Set LockedActionEventId) -> Manager -> Milliseconds -> Maybe GQLQueryText -> m (Forever m)
- callWebhook :: forall m r. (MonadIO m, MonadError QErr m, MonadTrace m, MonadReader r m, Has (Logger Hasura) r) => Environment -> Manager -> GraphQLType -> ActionOutputFields -> [Header] -> [HeaderConf] -> Bool -> EnvRecord ResolvedWebhook -> ActionWebhookPayload -> Timeout -> Maybe RequestTransform -> Maybe MetadataResponseTransform -> m (ActionWebhookResponse, ResponseHeaders)
- processOutputSelectionSet :: ArgumentExp v -> GraphQLType -> [(PGCol, PGScalarType)] -> ActionFields -> StringifyNumbers -> AnnSimpleSelectG ('Postgres 'Vanilla) Void v
- actionFieldToAnnField :: ActionFieldG Void -> AnnFieldG ('Postgres 'Vanilla) Void v
- mkJsonAggSelect :: GraphQLType -> JsonAggSelect
- insertActionTx :: ActionName -> SessionVariables -> [Header] -> Value -> TxE QErr ActionId
- fetchUndeliveredActionEventsTx :: TxE QErr [ActionLogItem]
- setActionStatusTx :: ActionId -> AsyncActionStatus -> TxE QErr ()
- fetchActionResponseTx :: ActionId -> TxE QErr ActionLogResponse
- clearActionDataTx :: ActionName -> TxE QErr ()
- setProcessingActionLogsToPendingTx :: LockedActionIdArray -> TxE QErr ()
Documentation
fetchActionLogResponses :: (MonadError QErr m, MonadMetadataStorage (MetadataStorageT m), Foldable t) => t ActionId -> m (ActionLogResponseMap, Bool) Source #
runActionExecution :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m, MonadTrace m, MonadMetadataStorage (MetadataStorageT m)) => UserInfo -> ActionExecutionPlan -> m (DiffTime, (EncJSON, Maybe ResponseHeaders)) Source #
asSingleRowJsonResp :: Query -> [PrepArg] -> TxE QErr EncJSON Source #
This function is generally used on the result of selectQuerySQL
,
selectAggregateQuerySQL
or connectionSelectSQL
to run said query and get
back the resulting JSON.
resolveActionExecution :: Environment -> Logger Hasura -> UserInfo -> AnnActionExecution Void -> ActionExecContext -> Maybe GQLQueryText -> ActionExecution Source #
Synchronously execute webhook handler and resolve response to action "output"
throwUnexpected :: MonadError QErr m => Text -> m () Source #
validateResponseObject :: MonadError QErr m => KeyMap Value -> ActionOutputFields -> m () Source #
validateResponse :: MonadError QErr m => Value -> GraphQLType -> ActionOutputFields -> m () Source #
makeActionResponseNoRelations :: ActionFields -> GraphQLType -> ActionOutputFields -> Bool -> ActionWebhookResponse -> Value Source #
Build action response from the Webhook JSON response when there are no relationships defined
gTypeContains :: (GType -> ActionOutputFields -> Bool) -> GType -> ActionOutputFields -> Bool Source #
isCustomScalar :: GType -> ActionOutputFields -> Bool Source #
resolveActionMutationAsync :: MonadMetadataStorage m => AnnActionMutationAsync -> [Header] -> SessionVariables -> m ActionId Source #
Resolve asynchronous action mutation which returns only the action uuid
resolveAsyncActionQuery :: UserInfo -> AnnActionAsyncQuery ('Postgres 'Vanilla) Void -> AsyncActionQueryExecution (UnpreparedValue ('Postgres 'Vanilla)) Source #
See Note: [Resolving async action query]
asyncActionsProcessor :: forall m. (MonadIO m, MonadBaseControl IO m, Forall (Pure m), HasReporter m, MonadMetadataStorage (MetadataStorageT m)) => Environment -> Logger Hasura -> IO SchemaCache -> TVar (Set LockedActionEventId) -> Manager -> Milliseconds -> Maybe GQLQueryText -> m (Forever m) Source #
Process async actions from hdb_catalog.hdb_action_log table. This functions is executed in a background thread. See Note [Async action architecture] above
callWebhook :: forall m r. (MonadIO m, MonadError QErr m, MonadTrace m, MonadReader r m, Has (Logger Hasura) r) => Environment -> Manager -> GraphQLType -> ActionOutputFields -> [Header] -> [HeaderConf] -> Bool -> EnvRecord ResolvedWebhook -> ActionWebhookPayload -> Timeout -> Maybe RequestTransform -> Maybe MetadataResponseTransform -> m (ActionWebhookResponse, ResponseHeaders) Source #
processOutputSelectionSet :: ArgumentExp v -> GraphQLType -> [(PGCol, PGScalarType)] -> ActionFields -> StringifyNumbers -> AnnSimpleSelectG ('Postgres 'Vanilla) Void v Source #
actionFieldToAnnField :: ActionFieldG Void -> AnnFieldG ('Postgres 'Vanilla) Void v Source #
insertActionTx :: ActionName -> SessionVariables -> [Header] -> Value -> TxE QErr ActionId Source #
setActionStatusTx :: ActionId -> AsyncActionStatus -> TxE QErr () Source #
fetchActionResponseTx :: ActionId -> TxE QErr ActionLogResponse Source #
clearActionDataTx :: ActionName -> TxE QErr () Source #
setProcessingActionLogsToPendingTx :: LockedActionIdArray -> TxE QErr () Source #