graphql-engine/server/src-lib/Hasura/RQL/DDL/Deps.hs

25 lines
659 B
Haskell
Raw Normal View History

2018-06-27 16:11:32 +03:00
module Hasura.RQL.DDL.Deps
( reportDeps
2018-06-27 16:11:32 +03:00
, reportDepsExt
)
where
import Hasura.Prelude
import Data.Text.Extended
2018-06-27 16:11:32 +03:00
import Hasura.RQL.Types
reportDeps :: (QErrM m) => [SchemaObjId] -> m ()
reportDeps deps =
throw400 DependencyError $
"cannot drop due to the following dependent objects : "
<> reportSchemaObjs deps
reportDepsExt :: (QErrM m) => [SchemaObjId] -> [Text] -> m ()
2018-06-27 16:11:32 +03:00
reportDepsExt deps unknownDeps =
throw400 DependencyError $
"cannot drop due to the following dependent objects : " <> depObjsTxt
where
depObjsTxt = commaSeparated $ reportSchemaObjs deps:unknownDeps