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

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

Documentation

class Monad m => MonadWarnings m where Source #

Methods

warn :: MetadataWarning -> m () Source #

Add a warning to the current context

Instances

Instances details
Monad m => MonadWarnings (StateT MetadataWarnings m) Source # 
Instance details

Defined in Hasura.RQL.DDL.Warnings