| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hasura.RQL.DDL.Warnings
Description
Warnings for metadata APIs
This module provides a mechanism for metadata APIs to emit warnings. An example use of MonadWarnings to emit
warnings with success message is given below:
import Hasura.RQL.DDL.Warnings someMetadataAPIHandler :: args -> m EncJSON someMetadataAPIHandler args = successMsgWithWarnings $ do -- do some stuff let warning = MetadataWarning (MOSource defaultSource) "some warning message" warn $ warning -- do some more stuff pure ()
Synopsis
- data AllowWarnings
- data WarningCode
- data MetadataWarning = MetadataWarning {}
- type MetadataWarnings = Seq MetadataWarning
- class Monad m => MonadWarnings m where
- warn :: MetadataWarning -> m ()
- runMetadataWarnings :: StateT MetadataWarnings m a -> m (a, MetadataWarnings)
- mkSuccessResponseWithWarnings :: MetadataWarnings -> EncJSON
- successMsgWithWarnings :: Monad m => StateT MetadataWarnings m () -> m EncJSON
Documentation
data AllowWarnings Source #
Allow/Disallow metadata warnings
Constructors
| AllowWarnings | |
| DisallowWarnings |
Instances
| FromJSON AllowWarnings Source # | |
Defined in Hasura.RQL.DDL.Warnings Methods parseJSON :: Value -> Parser AllowWarnings Source # parseJSONList :: Value -> Parser [AllowWarnings] Source # | |
| ToJSON AllowWarnings Source # | |
Defined in Hasura.RQL.DDL.Warnings Methods toJSON :: AllowWarnings -> Value Source # toEncoding :: AllowWarnings -> Encoding Source # toJSONList :: [AllowWarnings] -> Value Source # toEncodingList :: [AllowWarnings] -> Encoding Source # | |
| Show AllowWarnings Source # | |
Defined in Hasura.RQL.DDL.Warnings Methods showsPrec :: Int -> AllowWarnings -> ShowS # show :: AllowWarnings -> String # showList :: [AllowWarnings] -> ShowS # | |
| Eq AllowWarnings Source # | |
Defined in Hasura.RQL.DDL.Warnings Methods (==) :: AllowWarnings -> AllowWarnings -> Bool # (/=) :: AllowWarnings -> AllowWarnings -> Bool # | |
data WarningCode Source #
Constructors
| WCSourceCleanupFailed | |
| WCIllegalEventTriggerName | |
| WCTimeLimitExceededSystemLimit | |
| WCTrackTableFailed | |
| WCUntrackTableFailed |
Instances
| ToJSON WarningCode Source # | |
Defined in Hasura.RQL.DDL.Warnings Methods toJSON :: WarningCode -> Value Source # toEncoding :: WarningCode -> Encoding Source # toJSONList :: [WarningCode] -> Value Source # toEncodingList :: [WarningCode] -> Encoding Source # | |
| Eq WarningCode Source # | |
Defined in Hasura.RQL.DDL.Warnings | |
| Ord WarningCode Source # | |
Defined in Hasura.RQL.DDL.Warnings Methods compare :: WarningCode -> WarningCode -> Ordering # (<) :: WarningCode -> WarningCode -> Bool # (<=) :: WarningCode -> WarningCode -> Bool # (>) :: WarningCode -> WarningCode -> Bool # (>=) :: WarningCode -> WarningCode -> Bool # max :: WarningCode -> WarningCode -> WarningCode # min :: WarningCode -> WarningCode -> WarningCode # | |
data MetadataWarning Source #
Constructors
| MetadataWarning | |
Fields | |
Instances
type MetadataWarnings = Seq MetadataWarning Source #
class Monad m => MonadWarnings m where Source #
Instances
| Monad m => MonadWarnings (StateT MetadataWarnings m) Source # | |
Defined in Hasura.RQL.DDL.Warnings Methods warn :: MetadataWarning -> StateT MetadataWarnings m () Source # | |
runMetadataWarnings :: StateT MetadataWarnings m a -> m (a, MetadataWarnings) Source #
successMsgWithWarnings :: Monad m => StateT MetadataWarnings m () -> m EncJSON Source #