mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 12:31:52 +03:00
2152911e24
GitOrigin-RevId: 0dd10f1ccd338b1cf382ebff59b6ee7f209d39a1
32 lines
705 B
Haskell
32 lines
705 B
Haskell
-- |
|
|
|
|
module Hasura.RQL.DDL.ApiLimit where
|
|
|
|
import Hasura.Prelude
|
|
|
|
import Control.Lens ((.~))
|
|
import Hasura.Base.Error
|
|
import Hasura.EncJSON
|
|
import Hasura.RQL.Types
|
|
|
|
|
|
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
|