mirror of
https://github.com/hasura/graphql-engine.git
synced 2025-01-01 20:12:08 +03:00
4f835623b1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4400 GitOrigin-RevId: 2d90542f95ef4dad70c8dfe1ca3b4c1f3bdaa527
29 lines
875 B
Haskell
29 lines
875 B
Haskell
module Hasura.Backends.DataConnector.RQLGenerator.GenTablePermG
|
|
( genTablePermG,
|
|
)
|
|
where
|
|
|
|
import Hasura.Backends.DataConnector.RQLGenerator.GenCommon (genAnnBoolExpFld, genTableName)
|
|
import Hasura.Generator.Common (defaultRange)
|
|
import Hasura.Prelude (pure, ($))
|
|
import Hasura.RQL.IR.Generator (genAnnBoolExp)
|
|
import Hasura.RQL.IR.Select (TablePermG (TablePerm))
|
|
import Hasura.SQL.Backend
|
|
( BackendType (DataConnector),
|
|
)
|
|
import Hedgehog (MonadGen)
|
|
import Hedgehog.Gen
|
|
( integral,
|
|
maybe,
|
|
)
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Exported
|
|
|
|
genTablePermG :: MonadGen m => m a -> m (TablePermG 'DataConnector a)
|
|
genTablePermG genA = do
|
|
let genV = genAnnBoolExpFld genA
|
|
gBoolExp <- genAnnBoolExp @_ @_ @('DataConnector) genV genTableName
|
|
limit <- maybe (integral defaultRange)
|
|
pure $ TablePerm gBoolExp limit
|