graphql-engine/server/src-lib/Hasura/StoredProcedure/IR.hs
Gil Mizrahi e8d2d4f364 Refer to a stored procedure by name in commands interface
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9014
GitOrigin-RevId: 64f51811770d88ad6d5b298fc4c71170ffd7182c
2023-05-02 13:32:01 +00:00

29 lines
997 B
Haskell

-- | The RQL IR representation of an invocation of a stored procedure.
module Hasura.StoredProcedure.IR
( StoredProcedure (..),
)
where
import Hasura.LogicalModel.IR
import Hasura.Prelude
import Hasura.RQL.Types.Backend
import Hasura.StoredProcedure.Metadata
import Language.GraphQL.Draft.Syntax qualified as G
-- | The RQL IR representation of an invocation of a stored procedure.
data StoredProcedure b field = StoredProcedure
{ -- | The SQL name of the stored procedure.
spStoredProcedure :: FunctionName b,
-- | The graphql name of the stored procedure.
spGraphqlName :: G.Name,
-- | The arguments passed to the query, if any.
spArgs :: HashMap ArgumentName (ScalarType b, field),
-- | The return type of the stored procedure
spLogicalModel :: LogicalModel b
}
deriving (Functor, Foldable, Traversable)
deriving instance (Backend b, Eq field) => Eq (StoredProcedure b field)
deriving instance (Backend b, Show field) => Show (StoredProcedure b field)