2023-02-22 16:45:27 +03:00
|
|
|
-- | The RQL IR representation of an invocation of a logical model.
|
2023-02-22 12:22:22 +03:00
|
|
|
module Hasura.LogicalModel.IR
|
2023-02-22 16:45:27 +03:00
|
|
|
( LogicalModel (..),
|
2023-01-19 14:25:52 +03:00
|
|
|
)
|
|
|
|
where
|
|
|
|
|
2023-03-27 19:54:27 +03:00
|
|
|
import Hasura.CustomReturnType
|
2023-02-22 12:22:22 +03:00
|
|
|
import Hasura.LogicalModel.Metadata
|
2023-01-19 14:25:52 +03:00
|
|
|
import Hasura.Prelude
|
2023-01-30 19:04:56 +03:00
|
|
|
import Hasura.RQL.Types.Backend
|
2023-01-19 14:25:52 +03:00
|
|
|
import Hasura.RQL.Types.Column (ColumnValue)
|
|
|
|
|
2023-02-22 16:45:27 +03:00
|
|
|
-- | The RQL IR representation of an invocation of a logical model.
|
|
|
|
data LogicalModel b field = LogicalModel
|
|
|
|
{ -- | The graphql name of the logical model.
|
|
|
|
lmRootFieldName :: LogicalModelName,
|
2023-01-27 17:36:35 +03:00
|
|
|
-- | The raw sql to use in the query
|
2023-02-22 16:45:27 +03:00
|
|
|
lmInterpolatedQuery :: InterpolatedQuery field,
|
|
|
|
-- | The arguments passed to the query, if any.
|
2023-03-27 19:54:27 +03:00
|
|
|
lmArgs :: HashMap LogicalModelArgumentName (ColumnValue b),
|
|
|
|
-- | The return type of the logical model
|
|
|
|
lmReturnType :: CustomReturnType b
|
2023-01-19 14:25:52 +03:00
|
|
|
}
|
2023-01-30 19:04:56 +03:00
|
|
|
deriving (Functor, Foldable, Traversable)
|
|
|
|
|
2023-02-22 16:45:27 +03:00
|
|
|
deriving instance (Backend b, Eq field) => Eq (LogicalModel b field)
|
2023-01-30 19:04:56 +03:00
|
|
|
|
2023-02-22 16:45:27 +03:00
|
|
|
deriving instance (Backend b, Show field) => Show (LogicalModel b field)
|