2023-04-13 19:10:38 +03:00
|
|
|
-- | The RQL IR representation of an invocation of a native query.
|
|
|
|
module Hasura.NativeQuery.IR
|
|
|
|
( NativeQuery (..),
|
|
|
|
)
|
|
|
|
where
|
|
|
|
|
2023-04-19 12:03:36 +03:00
|
|
|
import Hasura.LogicalModel.IR
|
2023-04-13 19:10:38 +03:00
|
|
|
import Hasura.NativeQuery.Metadata
|
|
|
|
import Hasura.Prelude
|
|
|
|
import Hasura.RQL.Types.Backend
|
|
|
|
|
|
|
|
-- | The RQL IR representation of an invocation of a native query.
|
|
|
|
data NativeQuery b field = NativeQuery
|
|
|
|
{ -- | The graphql name of the native query.
|
|
|
|
nqRootFieldName :: NativeQueryName,
|
|
|
|
-- | The raw sql to use in the query
|
|
|
|
nqInterpolatedQuery :: InterpolatedQuery field,
|
|
|
|
-- | The return type of the native query
|
2023-04-19 12:03:36 +03:00
|
|
|
nqLogicalModel :: LogicalModel b
|
2023-04-13 19:10:38 +03:00
|
|
|
}
|
|
|
|
deriving (Functor, Foldable, Traversable)
|
|
|
|
|
|
|
|
deriving instance (Backend b, Eq field) => Eq (NativeQuery b field)
|
|
|
|
|
|
|
|
deriving instance (Backend b, Show field) => Show (NativeQuery b field)
|