graphql-engine/server/src-lib/Hasura/RQL/DDL/ApiLimit.hs
Antoine Leblanc 3cbcbd9291 Remove RQL/Types.hs
## Description

This PR removes `RQL.Types`, which was now only re-exporting a bunch of unrelated modules.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4363
GitOrigin-RevId: 894f29a19bff70b3dad8abc5d9858434d5065417
2022-04-27 13:58:47 +00:00

36 lines
820 B
Haskell

module Hasura.RQL.DDL.ApiLimit
( runRemoveApiLimits,
runSetApiLimits,
)
where
import Control.Lens ((.~))
import Hasura.Base.Error
import Hasura.EncJSON
import Hasura.Prelude
import Hasura.RQL.Types.ApiLimit
import Hasura.RQL.Types.Common
import Hasura.RQL.Types.Metadata
import Hasura.RQL.Types.SchemaCache.Build
runSetApiLimits ::
(MonadError QErr m, MetadataM m, CacheRWM m) =>
ApiLimit ->
m EncJSON
runSetApiLimits al = do
withNewInconsistentObjsCheck $
buildSchemaCache $
MetadataModifier $
metaApiLimits .~ al
return successMsg
runRemoveApiLimits ::
(MonadError QErr m, MetadataM m, CacheRWM m) =>
m EncJSON
runRemoveApiLimits = do
withNewInconsistentObjsCheck $
buildSchemaCache $
MetadataModifier $
metaApiLimits .~ emptyApiLimit
return successMsg