graphql-engine/server/src-lib/Hasura/NativeQuery/IR.hs
Daniel Harvey 4418d294f9 [server] parse native query in metadata call
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7731
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 96d60c72da05970f5b34f310f9fe71d9f67387a1
2023-02-01 08:46:19 +00:00

27 lines
907 B
Haskell

-- | This module contains the default types and functions that model Native
-- Queries.
module Hasura.NativeQuery.IR
( NativeQueryImpl (..),
)
where
import Hasura.NativeQuery.Metadata
import Hasura.Prelude
import Hasura.RQL.Types.Backend
import Hasura.RQL.Types.Column (ColumnValue)
-- | The default implementation of an invocation of a native query.
data NativeQueryImpl b field = NativeQueryImpl
{ -- | The defined name of the native query.
nqRootFieldName :: NativeQueryNameImpl,
-- | The raw sql to use in the query
nqInterpolatedQuery :: InterpolatedQuery field,
-- | The arguments passed to the native query, if any.
nqArgs :: HashMap NativeQueryArgumentName (ColumnValue b)
}
deriving (Functor, Foldable, Traversable)
deriving instance (Backend b, Eq field) => Eq (NativeQueryImpl b field)
deriving instance (Backend b, Show field) => Show (NativeQueryImpl b field)