mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 21:12:09 +03:00
30 lines
668 B
Haskell
30 lines
668 B
Haskell
|
-- |
|
||
|
|
||
|
module Hasura.RQL.DDL.ApiLimit where
|
||
|
|
||
|
import Hasura.Prelude
|
||
|
|
||
|
import Control.Lens ((.~))
|
||
|
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
|