graphql-engine/server/src-lib/Hasura/RQL/DDL/Deps.hs
Antoine Leblanc 2152911e24 server: introduce Hasura.Base (take 2)
GitOrigin-RevId: 0dd10f1ccd338b1cf382ebff59b6ee7f209d39a1
2021-05-11 15:19:33 +00:00

27 lines
695 B
Haskell

module Hasura.RQL.DDL.Deps
( reportDeps
, reportDepsExt
)
where
import Hasura.Prelude
import Data.Text.Extended
import Hasura.Base.Error
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 ()
reportDepsExt deps unknownDeps =
throw400 DependencyError $
"cannot drop due to the following dependent objects : " <> depObjsTxt
where
depObjsTxt = commaSeparated $ reportSchemaObjs deps:unknownDeps