graphql-engine/server/src-lib/Hasura/LogicalModel/IR.hs
Daniel Harvey 79682e0598 chore(server): move custom types out of logical models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8565
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: 38bf56cc420a6c818a9ca7d6f846f5018535c808
2023-03-31 15:35:13 +00:00

29 lines
986 B
Haskell

-- | The RQL IR representation of an invocation of a logical model.
module Hasura.LogicalModel.IR
( LogicalModel (..),
)
where
import Hasura.CustomReturnType.IR
import Hasura.LogicalModel.Metadata
import Hasura.Prelude
import Hasura.RQL.Types.Backend
import Hasura.RQL.Types.Column (ColumnValue)
-- | 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,
-- | The raw sql to use in the query
lmInterpolatedQuery :: InterpolatedQuery field,
-- | The arguments passed to the query, if any.
lmArgs :: HashMap LogicalModelArgumentName (ColumnValue b),
-- | The return type of the logical model
lmReturnType :: CustomReturnType b
}
deriving (Functor, Foldable, Traversable)
deriving instance (Backend b, Eq field) => Eq (LogicalModel b field)
deriving instance (Backend b, Show field) => Show (LogicalModel b field)