Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
Instances
FromJSON AllowWarnings Source # | |
Defined in Hasura.RQL.DDL.Warnings parseJSON :: Value -> Parser AllowWarnings Source # parseJSONList :: Value -> Parser [AllowWarnings] Source # | |
ToJSON AllowWarnings Source # | |
Defined in Hasura.RQL.DDL.Warnings 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 showsPrec :: Int -> AllowWarnings -> ShowS # show :: AllowWarnings -> String # showList :: [AllowWarnings] -> ShowS # | |
Eq AllowWarnings Source # | |
Defined in Hasura.RQL.DDL.Warnings (==) :: AllowWarnings -> AllowWarnings -> Bool # (/=) :: AllowWarnings -> AllowWarnings -> Bool # |
data WarningCode Source #
WCSourceCleanupFailed | |
WCIllegalEventTriggerName | |
WCTimeLimitExceededSystemLimit | |
WCTrackTableFailed | |
WCUntrackTableFailed |
Instances
ToJSON WarningCode Source # | |
Defined in Hasura.RQL.DDL.Warnings 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 (==) :: WarningCode -> WarningCode -> Bool # (/=) :: WarningCode -> WarningCode -> Bool # | |
Ord WarningCode Source # | |
Defined in Hasura.RQL.DDL.Warnings 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 #
Instances
type MetadataWarnings = Seq MetadataWarning Source #
class Monad m => MonadWarnings m where Source #
warn :: MetadataWarning -> m () Source #
Add a warning to the current context
Instances
Monad m => MonadWarnings (StateT MetadataWarnings m) Source # | |
Defined in Hasura.RQL.DDL.Warnings warn :: MetadataWarning -> StateT MetadataWarnings m () Source # |
runMetadataWarnings :: StateT MetadataWarnings m a -> m (a, MetadataWarnings) Source #
successMsgWithWarnings :: Monad m => StateT MetadataWarnings m () -> m EncJSON Source #