{-# LANGUAGE TemplateHaskell #-}

module Hasura.RQL.IR.Action
  ( ActionFieldG (..),
    ActionFieldsG,
    ActionFields,
    ActionRemoteRelationshipSelect (..),
    _ACFExpression,
    _ACFNestedObject,
    _ACFRemote,
    _ACFScalar,
    AnnActionExecution (..),
    aaeName,
    aaeOutputType,
    aaeFields,
    aaePayload,
    aaeOutputFields,
    aaeWebhook,
    aaeHeaders,
    aaeForwardClientHeaders,
    aaeTimeOut,
    aaeRequestTransform,
    aaeResponseTransform,
    AnnActionMutationAsync (..),
    AsyncActionQueryFieldG (..),
    _AsyncTypename,
    _AsyncOutput,
    _AsyncId,
    _AsyncCreatedAt,
    _AsyncErrors,
    AnnActionAsyncQuery (..),
    aaaqName,
    aaaqActionId,
    aaaqOutputType,
    aaaqFields,
    aaaqDefinitionList,
    aaaqStringifyNum,
    aaaqForwardClientHeaders,
    aaaqSource,
    ActionSourceInfo (..),
    ActionOutputFields,
    getActionOutputFields,
  )
where

import Control.Lens (makeLenses, makePrisms)
import Data.Aeson qualified as J
import Data.HashMap.Strict qualified as Map
import Data.Kind (Type)
import Hasura.GraphQL.Schema.Options (StringifyNumbers)
import Hasura.Prelude
import Hasura.RQL.DDL.Headers
import Hasura.RQL.DDL.Webhook.Transform (MetadataResponseTransform, RequestTransform)
import Hasura.RQL.Types.Action qualified as RQL
import Hasura.RQL.Types.Backend
import Hasura.RQL.Types.Common (EnvRecord, FieldName, Fields, ResolvedWebhook, SourceName, Timeout)
import Hasura.RQL.Types.CustomTypes
  ( AnnotatedObjectType (..),
    AnnotatedOutputType (..),
    GraphQLType (..),
    ObjectFieldDefinition (..),
    ObjectFieldName (..),
  )
import Hasura.SQL.Backend
import Language.GraphQL.Draft.Syntax qualified as G

-- | Internal representation for a selection of fields on the result of an action.
-- Type parameter r will be either
-- r ~ (RemoteRelationshipField UnpreparedValue) when the AST is emitted by the parser.
-- r ~ Void when an execution tree is constructed so that a backend is
-- absolved of dealing with remote relationships.
data ActionFieldG (r :: Type)
  = -- | Scalar value. G.Name is the original field name from the object type.
    ACFScalar G.Name
  | -- | Remote relationship
    ACFRemote (ActionRemoteRelationshipSelect r)
  | -- | Constant text value (used for __typename fields)
    ACFExpression Text
  | -- | Nested object. G.Name is the original field name from the object type.
    ACFNestedObject G.Name (ActionFieldsG r)
  deriving (ActionFieldG r -> ActionFieldG r -> Bool
(ActionFieldG r -> ActionFieldG r -> Bool)
-> (ActionFieldG r -> ActionFieldG r -> Bool)
-> Eq (ActionFieldG r)
forall r. Eq r => ActionFieldG r -> ActionFieldG r -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionFieldG r -> ActionFieldG r -> Bool
$c/= :: forall r. Eq r => ActionFieldG r -> ActionFieldG r -> Bool
== :: ActionFieldG r -> ActionFieldG r -> Bool
$c== :: forall r. Eq r => ActionFieldG r -> ActionFieldG r -> Bool
Eq, Int -> ActionFieldG r -> ShowS
[ActionFieldG r] -> ShowS
ActionFieldG r -> String
(Int -> ActionFieldG r -> ShowS)
-> (ActionFieldG r -> String)
-> ([ActionFieldG r] -> ShowS)
-> Show (ActionFieldG r)
forall r. Show r => Int -> ActionFieldG r -> ShowS
forall r. Show r => [ActionFieldG r] -> ShowS
forall r. Show r => ActionFieldG r -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionFieldG r] -> ShowS
$cshowList :: forall r. Show r => [ActionFieldG r] -> ShowS
show :: ActionFieldG r -> String
$cshow :: forall r. Show r => ActionFieldG r -> String
showsPrec :: Int -> ActionFieldG r -> ShowS
$cshowsPrec :: forall r. Show r => Int -> ActionFieldG r -> ShowS
Show, a -> ActionFieldG b -> ActionFieldG a
(a -> b) -> ActionFieldG a -> ActionFieldG b
(forall a b. (a -> b) -> ActionFieldG a -> ActionFieldG b)
-> (forall a b. a -> ActionFieldG b -> ActionFieldG a)
-> Functor ActionFieldG
forall a b. a -> ActionFieldG b -> ActionFieldG a
forall a b. (a -> b) -> ActionFieldG a -> ActionFieldG b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> ActionFieldG b -> ActionFieldG a
$c<$ :: forall a b. a -> ActionFieldG b -> ActionFieldG a
fmap :: (a -> b) -> ActionFieldG a -> ActionFieldG b
$cfmap :: forall a b. (a -> b) -> ActionFieldG a -> ActionFieldG b
Functor, ActionFieldG a -> Bool
(a -> m) -> ActionFieldG a -> m
(a -> b -> b) -> b -> ActionFieldG a -> b
(forall m. Monoid m => ActionFieldG m -> m)
-> (forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m)
-> (forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m)
-> (forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b)
-> (forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b)
-> (forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b)
-> (forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b)
-> (forall a. (a -> a -> a) -> ActionFieldG a -> a)
-> (forall a. (a -> a -> a) -> ActionFieldG a -> a)
-> (forall a. ActionFieldG a -> [a])
-> (forall a. ActionFieldG a -> Bool)
-> (forall a. ActionFieldG a -> Int)
-> (forall a. Eq a => a -> ActionFieldG a -> Bool)
-> (forall a. Ord a => ActionFieldG a -> a)
-> (forall a. Ord a => ActionFieldG a -> a)
-> (forall a. Num a => ActionFieldG a -> a)
-> (forall a. Num a => ActionFieldG a -> a)
-> Foldable ActionFieldG
forall a. Eq a => a -> ActionFieldG a -> Bool
forall a. Num a => ActionFieldG a -> a
forall a. Ord a => ActionFieldG a -> a
forall m. Monoid m => ActionFieldG m -> m
forall a. ActionFieldG a -> Bool
forall a. ActionFieldG a -> Int
forall a. ActionFieldG a -> [a]
forall a. (a -> a -> a) -> ActionFieldG a -> a
forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m
forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b
forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: ActionFieldG a -> a
$cproduct :: forall a. Num a => ActionFieldG a -> a
sum :: ActionFieldG a -> a
$csum :: forall a. Num a => ActionFieldG a -> a
minimum :: ActionFieldG a -> a
$cminimum :: forall a. Ord a => ActionFieldG a -> a
maximum :: ActionFieldG a -> a
$cmaximum :: forall a. Ord a => ActionFieldG a -> a
elem :: a -> ActionFieldG a -> Bool
$celem :: forall a. Eq a => a -> ActionFieldG a -> Bool
length :: ActionFieldG a -> Int
$clength :: forall a. ActionFieldG a -> Int
null :: ActionFieldG a -> Bool
$cnull :: forall a. ActionFieldG a -> Bool
toList :: ActionFieldG a -> [a]
$ctoList :: forall a. ActionFieldG a -> [a]
foldl1 :: (a -> a -> a) -> ActionFieldG a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> ActionFieldG a -> a
foldr1 :: (a -> a -> a) -> ActionFieldG a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> ActionFieldG a -> a
foldl' :: (b -> a -> b) -> b -> ActionFieldG a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b
foldl :: (b -> a -> b) -> b -> ActionFieldG a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b
foldr' :: (a -> b -> b) -> b -> ActionFieldG a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b
foldr :: (a -> b -> b) -> b -> ActionFieldG a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b
foldMap' :: (a -> m) -> ActionFieldG a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m
foldMap :: (a -> m) -> ActionFieldG a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m
fold :: ActionFieldG m -> m
$cfold :: forall m. Monoid m => ActionFieldG m -> m
Foldable, Functor ActionFieldG
Foldable ActionFieldG
Functor ActionFieldG
-> Foldable ActionFieldG
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ActionFieldG a -> f (ActionFieldG b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    ActionFieldG (f a) -> f (ActionFieldG a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ActionFieldG a -> m (ActionFieldG b))
-> (forall (m :: * -> *) a.
    Monad m =>
    ActionFieldG (m a) -> m (ActionFieldG a))
-> Traversable ActionFieldG
(a -> f b) -> ActionFieldG a -> f (ActionFieldG b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
ActionFieldG (m a) -> m (ActionFieldG a)
forall (f :: * -> *) a.
Applicative f =>
ActionFieldG (f a) -> f (ActionFieldG a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ActionFieldG a -> m (ActionFieldG b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ActionFieldG a -> f (ActionFieldG b)
sequence :: ActionFieldG (m a) -> m (ActionFieldG a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
ActionFieldG (m a) -> m (ActionFieldG a)
mapM :: (a -> m b) -> ActionFieldG a -> m (ActionFieldG b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ActionFieldG a -> m (ActionFieldG b)
sequenceA :: ActionFieldG (f a) -> f (ActionFieldG a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ActionFieldG (f a) -> f (ActionFieldG a)
traverse :: (a -> f b) -> ActionFieldG a -> f (ActionFieldG b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ActionFieldG a -> f (ActionFieldG b)
$cp2Traversable :: Foldable ActionFieldG
$cp1Traversable :: Functor ActionFieldG
Traversable)

type ActionFieldsG r = Fields (ActionFieldG r)

type ActionFields = ActionFieldsG Void

data ActionRemoteRelationshipSelect r = ActionRemoteRelationshipSelect
  { -- | The fields on the table that are required for the join condition
    -- of the remote relationship
    ActionRemoteRelationshipSelect r -> HashMap FieldName Name
_arrsLHSJoinFields :: HashMap FieldName G.Name,
    -- | The field that captures the relationship
    -- r ~ (RemoteRelationshipField UnpreparedValue) when the AST is emitted by the parser.
    -- r ~ Void when an execution tree is constructed so that a backend is
    -- absolved of dealing with remote relationships.
    ActionRemoteRelationshipSelect r -> r
_arrsRelationship :: r
  }
  deriving (ActionRemoteRelationshipSelect r
-> ActionRemoteRelationshipSelect r -> Bool
(ActionRemoteRelationshipSelect r
 -> ActionRemoteRelationshipSelect r -> Bool)
-> (ActionRemoteRelationshipSelect r
    -> ActionRemoteRelationshipSelect r -> Bool)
-> Eq (ActionRemoteRelationshipSelect r)
forall r.
Eq r =>
ActionRemoteRelationshipSelect r
-> ActionRemoteRelationshipSelect r -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionRemoteRelationshipSelect r
-> ActionRemoteRelationshipSelect r -> Bool
$c/= :: forall r.
Eq r =>
ActionRemoteRelationshipSelect r
-> ActionRemoteRelationshipSelect r -> Bool
== :: ActionRemoteRelationshipSelect r
-> ActionRemoteRelationshipSelect r -> Bool
$c== :: forall r.
Eq r =>
ActionRemoteRelationshipSelect r
-> ActionRemoteRelationshipSelect r -> Bool
Eq, Int -> ActionRemoteRelationshipSelect r -> ShowS
[ActionRemoteRelationshipSelect r] -> ShowS
ActionRemoteRelationshipSelect r -> String
(Int -> ActionRemoteRelationshipSelect r -> ShowS)
-> (ActionRemoteRelationshipSelect r -> String)
-> ([ActionRemoteRelationshipSelect r] -> ShowS)
-> Show (ActionRemoteRelationshipSelect r)
forall r.
Show r =>
Int -> ActionRemoteRelationshipSelect r -> ShowS
forall r. Show r => [ActionRemoteRelationshipSelect r] -> ShowS
forall r. Show r => ActionRemoteRelationshipSelect r -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionRemoteRelationshipSelect r] -> ShowS
$cshowList :: forall r. Show r => [ActionRemoteRelationshipSelect r] -> ShowS
show :: ActionRemoteRelationshipSelect r -> String
$cshow :: forall r. Show r => ActionRemoteRelationshipSelect r -> String
showsPrec :: Int -> ActionRemoteRelationshipSelect r -> ShowS
$cshowsPrec :: forall r.
Show r =>
Int -> ActionRemoteRelationshipSelect r -> ShowS
Show, a
-> ActionRemoteRelationshipSelect b
-> ActionRemoteRelationshipSelect a
(a -> b)
-> ActionRemoteRelationshipSelect a
-> ActionRemoteRelationshipSelect b
(forall a b.
 (a -> b)
 -> ActionRemoteRelationshipSelect a
 -> ActionRemoteRelationshipSelect b)
-> (forall a b.
    a
    -> ActionRemoteRelationshipSelect b
    -> ActionRemoteRelationshipSelect a)
-> Functor ActionRemoteRelationshipSelect
forall a b.
a
-> ActionRemoteRelationshipSelect b
-> ActionRemoteRelationshipSelect a
forall a b.
(a -> b)
-> ActionRemoteRelationshipSelect a
-> ActionRemoteRelationshipSelect b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a
-> ActionRemoteRelationshipSelect b
-> ActionRemoteRelationshipSelect a
$c<$ :: forall a b.
a
-> ActionRemoteRelationshipSelect b
-> ActionRemoteRelationshipSelect a
fmap :: (a -> b)
-> ActionRemoteRelationshipSelect a
-> ActionRemoteRelationshipSelect b
$cfmap :: forall a b.
(a -> b)
-> ActionRemoteRelationshipSelect a
-> ActionRemoteRelationshipSelect b
Functor, ActionRemoteRelationshipSelect a -> Bool
(a -> m) -> ActionRemoteRelationshipSelect a -> m
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
(forall m. Monoid m => ActionRemoteRelationshipSelect m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> ActionRemoteRelationshipSelect a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> ActionRemoteRelationshipSelect a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b)
-> (forall a.
    (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a)
-> (forall a.
    (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a)
-> (forall a. ActionRemoteRelationshipSelect a -> [a])
-> (forall a. ActionRemoteRelationshipSelect a -> Bool)
-> (forall a. ActionRemoteRelationshipSelect a -> Int)
-> (forall a.
    Eq a =>
    a -> ActionRemoteRelationshipSelect a -> Bool)
-> (forall a. Ord a => ActionRemoteRelationshipSelect a -> a)
-> (forall a. Ord a => ActionRemoteRelationshipSelect a -> a)
-> (forall a. Num a => ActionRemoteRelationshipSelect a -> a)
-> (forall a. Num a => ActionRemoteRelationshipSelect a -> a)
-> Foldable ActionRemoteRelationshipSelect
forall a. Eq a => a -> ActionRemoteRelationshipSelect a -> Bool
forall a. Num a => ActionRemoteRelationshipSelect a -> a
forall a. Ord a => ActionRemoteRelationshipSelect a -> a
forall m. Monoid m => ActionRemoteRelationshipSelect m -> m
forall a. ActionRemoteRelationshipSelect a -> Bool
forall a. ActionRemoteRelationshipSelect a -> Int
forall a. ActionRemoteRelationshipSelect a -> [a]
forall a. (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
forall m a.
Monoid m =>
(a -> m) -> ActionRemoteRelationshipSelect a -> m
forall b a.
(b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
forall a b.
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: ActionRemoteRelationshipSelect a -> a
$cproduct :: forall a. Num a => ActionRemoteRelationshipSelect a -> a
sum :: ActionRemoteRelationshipSelect a -> a
$csum :: forall a. Num a => ActionRemoteRelationshipSelect a -> a
minimum :: ActionRemoteRelationshipSelect a -> a
$cminimum :: forall a. Ord a => ActionRemoteRelationshipSelect a -> a
maximum :: ActionRemoteRelationshipSelect a -> a
$cmaximum :: forall a. Ord a => ActionRemoteRelationshipSelect a -> a
elem :: a -> ActionRemoteRelationshipSelect a -> Bool
$celem :: forall a. Eq a => a -> ActionRemoteRelationshipSelect a -> Bool
length :: ActionRemoteRelationshipSelect a -> Int
$clength :: forall a. ActionRemoteRelationshipSelect a -> Int
null :: ActionRemoteRelationshipSelect a -> Bool
$cnull :: forall a. ActionRemoteRelationshipSelect a -> Bool
toList :: ActionRemoteRelationshipSelect a -> [a]
$ctoList :: forall a. ActionRemoteRelationshipSelect a -> [a]
foldl1 :: (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
foldr1 :: (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
foldl' :: (b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldl' :: forall b a.
(b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldl :: (b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldl :: forall b a.
(b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldr' :: (a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldr' :: forall a b.
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldr :: (a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldr :: forall a b.
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldMap' :: (a -> m) -> ActionRemoteRelationshipSelect a -> m
$cfoldMap' :: forall m a.
Monoid m =>
(a -> m) -> ActionRemoteRelationshipSelect a -> m
foldMap :: (a -> m) -> ActionRemoteRelationshipSelect a -> m
$cfoldMap :: forall m a.
Monoid m =>
(a -> m) -> ActionRemoteRelationshipSelect a -> m
fold :: ActionRemoteRelationshipSelect m -> m
$cfold :: forall m. Monoid m => ActionRemoteRelationshipSelect m -> m
Foldable, Functor ActionRemoteRelationshipSelect
Foldable ActionRemoteRelationshipSelect
Functor ActionRemoteRelationshipSelect
-> Foldable ActionRemoteRelationshipSelect
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> ActionRemoteRelationshipSelect a
    -> f (ActionRemoteRelationshipSelect b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    ActionRemoteRelationshipSelect (f a)
    -> f (ActionRemoteRelationshipSelect a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> ActionRemoteRelationshipSelect a
    -> m (ActionRemoteRelationshipSelect b))
-> (forall (m :: * -> *) a.
    Monad m =>
    ActionRemoteRelationshipSelect (m a)
    -> m (ActionRemoteRelationshipSelect a))
-> Traversable ActionRemoteRelationshipSelect
(a -> f b)
-> ActionRemoteRelationshipSelect a
-> f (ActionRemoteRelationshipSelect b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
ActionRemoteRelationshipSelect (m a)
-> m (ActionRemoteRelationshipSelect a)
forall (f :: * -> *) a.
Applicative f =>
ActionRemoteRelationshipSelect (f a)
-> f (ActionRemoteRelationshipSelect a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> ActionRemoteRelationshipSelect a
-> m (ActionRemoteRelationshipSelect b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> ActionRemoteRelationshipSelect a
-> f (ActionRemoteRelationshipSelect b)
sequence :: ActionRemoteRelationshipSelect (m a)
-> m (ActionRemoteRelationshipSelect a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
ActionRemoteRelationshipSelect (m a)
-> m (ActionRemoteRelationshipSelect a)
mapM :: (a -> m b)
-> ActionRemoteRelationshipSelect a
-> m (ActionRemoteRelationshipSelect b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> ActionRemoteRelationshipSelect a
-> m (ActionRemoteRelationshipSelect b)
sequenceA :: ActionRemoteRelationshipSelect (f a)
-> f (ActionRemoteRelationshipSelect a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ActionRemoteRelationshipSelect (f a)
-> f (ActionRemoteRelationshipSelect a)
traverse :: (a -> f b)
-> ActionRemoteRelationshipSelect a
-> f (ActionRemoteRelationshipSelect b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> ActionRemoteRelationshipSelect a
-> f (ActionRemoteRelationshipSelect b)
$cp2Traversable :: Foldable ActionRemoteRelationshipSelect
$cp1Traversable :: Functor ActionRemoteRelationshipSelect
Traversable)

$(makePrisms ''ActionFieldG)

data AnnActionExecution (r :: Type) = AnnActionExecution
  { AnnActionExecution r -> ActionName
_aaeName :: RQL.ActionName,
    -- | output type
    AnnActionExecution r -> GraphQLType
_aaeOutputType :: GraphQLType,
    -- | output selection
    AnnActionExecution r -> ActionFieldsG r
_aaeFields :: (ActionFieldsG r),
    -- | jsonified input arguments
    AnnActionExecution r -> Value
_aaePayload :: J.Value,
    -- | to validate the response fields from webhook
    AnnActionExecution r -> ActionOutputFields
_aaeOutputFields :: ActionOutputFields,
    AnnActionExecution r -> EnvRecord ResolvedWebhook
_aaeWebhook :: EnvRecord ResolvedWebhook,
    AnnActionExecution r -> [HeaderConf]
_aaeHeaders :: [HeaderConf],
    AnnActionExecution r -> Bool
_aaeForwardClientHeaders :: Bool,
    AnnActionExecution r -> Timeout
_aaeTimeOut :: Timeout,
    AnnActionExecution r -> Maybe RequestTransform
_aaeRequestTransform :: Maybe RequestTransform,
    AnnActionExecution r -> Maybe MetadataResponseTransform
_aaeResponseTransform :: Maybe MetadataResponseTransform
  }
  deriving stock (a -> AnnActionExecution b -> AnnActionExecution a
(a -> b) -> AnnActionExecution a -> AnnActionExecution b
(forall a b.
 (a -> b) -> AnnActionExecution a -> AnnActionExecution b)
-> (forall a b. a -> AnnActionExecution b -> AnnActionExecution a)
-> Functor AnnActionExecution
forall a b. a -> AnnActionExecution b -> AnnActionExecution a
forall a b.
(a -> b) -> AnnActionExecution a -> AnnActionExecution b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> AnnActionExecution b -> AnnActionExecution a
$c<$ :: forall a b. a -> AnnActionExecution b -> AnnActionExecution a
fmap :: (a -> b) -> AnnActionExecution a -> AnnActionExecution b
$cfmap :: forall a b.
(a -> b) -> AnnActionExecution a -> AnnActionExecution b
Functor, AnnActionExecution a -> Bool
(a -> m) -> AnnActionExecution a -> m
(a -> b -> b) -> b -> AnnActionExecution a -> b
(forall m. Monoid m => AnnActionExecution m -> m)
-> (forall m a. Monoid m => (a -> m) -> AnnActionExecution a -> m)
-> (forall m a. Monoid m => (a -> m) -> AnnActionExecution a -> m)
-> (forall a b. (a -> b -> b) -> b -> AnnActionExecution a -> b)
-> (forall a b. (a -> b -> b) -> b -> AnnActionExecution a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnActionExecution a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnActionExecution a -> b)
-> (forall a. (a -> a -> a) -> AnnActionExecution a -> a)
-> (forall a. (a -> a -> a) -> AnnActionExecution a -> a)
-> (forall a. AnnActionExecution a -> [a])
-> (forall a. AnnActionExecution a -> Bool)
-> (forall a. AnnActionExecution a -> Int)
-> (forall a. Eq a => a -> AnnActionExecution a -> Bool)
-> (forall a. Ord a => AnnActionExecution a -> a)
-> (forall a. Ord a => AnnActionExecution a -> a)
-> (forall a. Num a => AnnActionExecution a -> a)
-> (forall a. Num a => AnnActionExecution a -> a)
-> Foldable AnnActionExecution
forall a. Eq a => a -> AnnActionExecution a -> Bool
forall a. Num a => AnnActionExecution a -> a
forall a. Ord a => AnnActionExecution a -> a
forall m. Monoid m => AnnActionExecution m -> m
forall a. AnnActionExecution a -> Bool
forall a. AnnActionExecution a -> Int
forall a. AnnActionExecution a -> [a]
forall a. (a -> a -> a) -> AnnActionExecution a -> a
forall m a. Monoid m => (a -> m) -> AnnActionExecution a -> m
forall b a. (b -> a -> b) -> b -> AnnActionExecution a -> b
forall a b. (a -> b -> b) -> b -> AnnActionExecution a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: AnnActionExecution a -> a
$cproduct :: forall a. Num a => AnnActionExecution a -> a
sum :: AnnActionExecution a -> a
$csum :: forall a. Num a => AnnActionExecution a -> a
minimum :: AnnActionExecution a -> a
$cminimum :: forall a. Ord a => AnnActionExecution a -> a
maximum :: AnnActionExecution a -> a
$cmaximum :: forall a. Ord a => AnnActionExecution a -> a
elem :: a -> AnnActionExecution a -> Bool
$celem :: forall a. Eq a => a -> AnnActionExecution a -> Bool
length :: AnnActionExecution a -> Int
$clength :: forall a. AnnActionExecution a -> Int
null :: AnnActionExecution a -> Bool
$cnull :: forall a. AnnActionExecution a -> Bool
toList :: AnnActionExecution a -> [a]
$ctoList :: forall a. AnnActionExecution a -> [a]
foldl1 :: (a -> a -> a) -> AnnActionExecution a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> AnnActionExecution a -> a
foldr1 :: (a -> a -> a) -> AnnActionExecution a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> AnnActionExecution a -> a
foldl' :: (b -> a -> b) -> b -> AnnActionExecution a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> AnnActionExecution a -> b
foldl :: (b -> a -> b) -> b -> AnnActionExecution a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> AnnActionExecution a -> b
foldr' :: (a -> b -> b) -> b -> AnnActionExecution a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> AnnActionExecution a -> b
foldr :: (a -> b -> b) -> b -> AnnActionExecution a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> AnnActionExecution a -> b
foldMap' :: (a -> m) -> AnnActionExecution a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> AnnActionExecution a -> m
foldMap :: (a -> m) -> AnnActionExecution a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> AnnActionExecution a -> m
fold :: AnnActionExecution m -> m
$cfold :: forall m. Monoid m => AnnActionExecution m -> m
Foldable, Functor AnnActionExecution
Foldable AnnActionExecution
Functor AnnActionExecution
-> Foldable AnnActionExecution
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AnnActionExecution a -> f (AnnActionExecution b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AnnActionExecution (f a) -> f (AnnActionExecution a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AnnActionExecution a -> m (AnnActionExecution b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AnnActionExecution (m a) -> m (AnnActionExecution a))
-> Traversable AnnActionExecution
(a -> f b) -> AnnActionExecution a -> f (AnnActionExecution b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
AnnActionExecution (m a) -> m (AnnActionExecution a)
forall (f :: * -> *) a.
Applicative f =>
AnnActionExecution (f a) -> f (AnnActionExecution a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnActionExecution a -> m (AnnActionExecution b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnActionExecution a -> f (AnnActionExecution b)
sequence :: AnnActionExecution (m a) -> m (AnnActionExecution a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
AnnActionExecution (m a) -> m (AnnActionExecution a)
mapM :: (a -> m b) -> AnnActionExecution a -> m (AnnActionExecution b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnActionExecution a -> m (AnnActionExecution b)
sequenceA :: AnnActionExecution (f a) -> f (AnnActionExecution a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
AnnActionExecution (f a) -> f (AnnActionExecution a)
traverse :: (a -> f b) -> AnnActionExecution a -> f (AnnActionExecution b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnActionExecution a -> f (AnnActionExecution b)
$cp2Traversable :: Foldable AnnActionExecution
$cp1Traversable :: Functor AnnActionExecution
Traversable)

type ActionOutputFields = Map.HashMap G.Name G.GType

getActionOutputFields :: AnnotatedOutputType -> ActionOutputFields
getActionOutputFields :: AnnotatedOutputType -> ActionOutputFields
getActionOutputFields AnnotatedOutputType
inp = case AnnotatedOutputType
inp of
  AOTObject AnnotatedObjectType
aot -> [(Name, GType)] -> ActionOutputFields
forall k v. (Eq k, Hashable k) => [(k, v)] -> HashMap k v
Map.fromList do
    ObjectFieldDefinition {Maybe Value
Maybe Description
(GType, AnnotatedObjectFieldType)
ObjectFieldName
_ofdType :: forall field. ObjectFieldDefinition field -> field
_ofdDescription :: forall field. ObjectFieldDefinition field -> Maybe Description
_ofdArguments :: forall field. ObjectFieldDefinition field -> Maybe Value
_ofdName :: forall field. ObjectFieldDefinition field -> ObjectFieldName
_ofdType :: (GType, AnnotatedObjectFieldType)
_ofdDescription :: Maybe Description
_ofdArguments :: Maybe Value
_ofdName :: ObjectFieldName
..} <- NonEmpty (ObjectFieldDefinition (GType, AnnotatedObjectFieldType))
-> [ObjectFieldDefinition (GType, AnnotatedObjectFieldType)]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList (NonEmpty (ObjectFieldDefinition (GType, AnnotatedObjectFieldType))
 -> [ObjectFieldDefinition (GType, AnnotatedObjectFieldType)])
-> NonEmpty
     (ObjectFieldDefinition (GType, AnnotatedObjectFieldType))
-> [ObjectFieldDefinition (GType, AnnotatedObjectFieldType)]
forall a b. (a -> b) -> a -> b
$ AnnotatedObjectType
-> NonEmpty
     (ObjectFieldDefinition (GType, AnnotatedObjectFieldType))
_aotFields AnnotatedObjectType
aot
    (Name, GType) -> [(Name, GType)]
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ObjectFieldName -> Name
unObjectFieldName ObjectFieldName
_ofdName, (GType, AnnotatedObjectFieldType) -> GType
forall a b. (a, b) -> a
fst (GType, AnnotatedObjectFieldType)
_ofdType)
  AOTScalar AnnotatedScalarType
_ -> ActionOutputFields
forall k v. HashMap k v
Map.empty

data AnnActionMutationAsync = AnnActionMutationAsync
  { AnnActionMutationAsync -> ActionName
_aamaName :: RQL.ActionName,
    AnnActionMutationAsync -> Bool
_aamaForwardClientHeaders :: Bool,
    -- | jsonified input arguments
    AnnActionMutationAsync -> Value
_aamaPayload :: J.Value
  }
  deriving (Int -> AnnActionMutationAsync -> ShowS
[AnnActionMutationAsync] -> ShowS
AnnActionMutationAsync -> String
(Int -> AnnActionMutationAsync -> ShowS)
-> (AnnActionMutationAsync -> String)
-> ([AnnActionMutationAsync] -> ShowS)
-> Show AnnActionMutationAsync
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnnActionMutationAsync] -> ShowS
$cshowList :: [AnnActionMutationAsync] -> ShowS
show :: AnnActionMutationAsync -> String
$cshow :: AnnActionMutationAsync -> String
showsPrec :: Int -> AnnActionMutationAsync -> ShowS
$cshowsPrec :: Int -> AnnActionMutationAsync -> ShowS
Show, AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
(AnnActionMutationAsync -> AnnActionMutationAsync -> Bool)
-> (AnnActionMutationAsync -> AnnActionMutationAsync -> Bool)
-> Eq AnnActionMutationAsync
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
$c/= :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
== :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
$c== :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
Eq)

data AsyncActionQueryFieldG (r :: Type)
  = AsyncTypename Text
  | AsyncOutput (ActionFieldsG r)
  | AsyncId
  | AsyncCreatedAt
  | AsyncErrors
  deriving stock (a -> AsyncActionQueryFieldG b -> AsyncActionQueryFieldG a
(a -> b) -> AsyncActionQueryFieldG a -> AsyncActionQueryFieldG b
(forall a b.
 (a -> b) -> AsyncActionQueryFieldG a -> AsyncActionQueryFieldG b)
-> (forall a b.
    a -> AsyncActionQueryFieldG b -> AsyncActionQueryFieldG a)
-> Functor AsyncActionQueryFieldG
forall a b.
a -> AsyncActionQueryFieldG b -> AsyncActionQueryFieldG a
forall a b.
(a -> b) -> AsyncActionQueryFieldG a -> AsyncActionQueryFieldG b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> AsyncActionQueryFieldG b -> AsyncActionQueryFieldG a
$c<$ :: forall a b.
a -> AsyncActionQueryFieldG b -> AsyncActionQueryFieldG a
fmap :: (a -> b) -> AsyncActionQueryFieldG a -> AsyncActionQueryFieldG b
$cfmap :: forall a b.
(a -> b) -> AsyncActionQueryFieldG a -> AsyncActionQueryFieldG b
Functor, AsyncActionQueryFieldG a -> Bool
(a -> m) -> AsyncActionQueryFieldG a -> m
(a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b
(forall m. Monoid m => AsyncActionQueryFieldG m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AsyncActionQueryFieldG a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AsyncActionQueryFieldG a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> AsyncActionQueryFieldG a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> AsyncActionQueryFieldG a -> b)
-> (forall a. (a -> a -> a) -> AsyncActionQueryFieldG a -> a)
-> (forall a. (a -> a -> a) -> AsyncActionQueryFieldG a -> a)
-> (forall a. AsyncActionQueryFieldG a -> [a])
-> (forall a. AsyncActionQueryFieldG a -> Bool)
-> (forall a. AsyncActionQueryFieldG a -> Int)
-> (forall a. Eq a => a -> AsyncActionQueryFieldG a -> Bool)
-> (forall a. Ord a => AsyncActionQueryFieldG a -> a)
-> (forall a. Ord a => AsyncActionQueryFieldG a -> a)
-> (forall a. Num a => AsyncActionQueryFieldG a -> a)
-> (forall a. Num a => AsyncActionQueryFieldG a -> a)
-> Foldable AsyncActionQueryFieldG
forall a. Eq a => a -> AsyncActionQueryFieldG a -> Bool
forall a. Num a => AsyncActionQueryFieldG a -> a
forall a. Ord a => AsyncActionQueryFieldG a -> a
forall m. Monoid m => AsyncActionQueryFieldG m -> m
forall a. AsyncActionQueryFieldG a -> Bool
forall a. AsyncActionQueryFieldG a -> Int
forall a. AsyncActionQueryFieldG a -> [a]
forall a. (a -> a -> a) -> AsyncActionQueryFieldG a -> a
forall m a. Monoid m => (a -> m) -> AsyncActionQueryFieldG a -> m
forall b a. (b -> a -> b) -> b -> AsyncActionQueryFieldG a -> b
forall a b. (a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: AsyncActionQueryFieldG a -> a
$cproduct :: forall a. Num a => AsyncActionQueryFieldG a -> a
sum :: AsyncActionQueryFieldG a -> a
$csum :: forall a. Num a => AsyncActionQueryFieldG a -> a
minimum :: AsyncActionQueryFieldG a -> a
$cminimum :: forall a. Ord a => AsyncActionQueryFieldG a -> a
maximum :: AsyncActionQueryFieldG a -> a
$cmaximum :: forall a. Ord a => AsyncActionQueryFieldG a -> a
elem :: a -> AsyncActionQueryFieldG a -> Bool
$celem :: forall a. Eq a => a -> AsyncActionQueryFieldG a -> Bool
length :: AsyncActionQueryFieldG a -> Int
$clength :: forall a. AsyncActionQueryFieldG a -> Int
null :: AsyncActionQueryFieldG a -> Bool
$cnull :: forall a. AsyncActionQueryFieldG a -> Bool
toList :: AsyncActionQueryFieldG a -> [a]
$ctoList :: forall a. AsyncActionQueryFieldG a -> [a]
foldl1 :: (a -> a -> a) -> AsyncActionQueryFieldG a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> AsyncActionQueryFieldG a -> a
foldr1 :: (a -> a -> a) -> AsyncActionQueryFieldG a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> AsyncActionQueryFieldG a -> a
foldl' :: (b -> a -> b) -> b -> AsyncActionQueryFieldG a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> AsyncActionQueryFieldG a -> b
foldl :: (b -> a -> b) -> b -> AsyncActionQueryFieldG a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> AsyncActionQueryFieldG a -> b
foldr' :: (a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b
foldr :: (a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> AsyncActionQueryFieldG a -> b
foldMap' :: (a -> m) -> AsyncActionQueryFieldG a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> AsyncActionQueryFieldG a -> m
foldMap :: (a -> m) -> AsyncActionQueryFieldG a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> AsyncActionQueryFieldG a -> m
fold :: AsyncActionQueryFieldG m -> m
$cfold :: forall m. Monoid m => AsyncActionQueryFieldG m -> m
Foldable, Functor AsyncActionQueryFieldG
Foldable AsyncActionQueryFieldG
Functor AsyncActionQueryFieldG
-> Foldable AsyncActionQueryFieldG
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> AsyncActionQueryFieldG a -> f (AsyncActionQueryFieldG b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AsyncActionQueryFieldG (f a) -> f (AsyncActionQueryFieldG a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> AsyncActionQueryFieldG a -> m (AsyncActionQueryFieldG b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AsyncActionQueryFieldG (m a) -> m (AsyncActionQueryFieldG a))
-> Traversable AsyncActionQueryFieldG
(a -> f b)
-> AsyncActionQueryFieldG a -> f (AsyncActionQueryFieldG b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
AsyncActionQueryFieldG (m a) -> m (AsyncActionQueryFieldG a)
forall (f :: * -> *) a.
Applicative f =>
AsyncActionQueryFieldG (f a) -> f (AsyncActionQueryFieldG a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> AsyncActionQueryFieldG a -> m (AsyncActionQueryFieldG b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> AsyncActionQueryFieldG a -> f (AsyncActionQueryFieldG b)
sequence :: AsyncActionQueryFieldG (m a) -> m (AsyncActionQueryFieldG a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
AsyncActionQueryFieldG (m a) -> m (AsyncActionQueryFieldG a)
mapM :: (a -> m b)
-> AsyncActionQueryFieldG a -> m (AsyncActionQueryFieldG b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> AsyncActionQueryFieldG a -> m (AsyncActionQueryFieldG b)
sequenceA :: AsyncActionQueryFieldG (f a) -> f (AsyncActionQueryFieldG a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
AsyncActionQueryFieldG (f a) -> f (AsyncActionQueryFieldG a)
traverse :: (a -> f b)
-> AsyncActionQueryFieldG a -> f (AsyncActionQueryFieldG b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> AsyncActionQueryFieldG a -> f (AsyncActionQueryFieldG b)
$cp2Traversable :: Foldable AsyncActionQueryFieldG
$cp1Traversable :: Functor AsyncActionQueryFieldG
Traversable)

type AsyncActionQueryFieldsG r = Fields (AsyncActionQueryFieldG r)

data AnnActionAsyncQuery (b :: BackendType) (r :: Type) = AnnActionAsyncQuery
  { AnnActionAsyncQuery b r -> ActionName
_aaaqName :: RQL.ActionName,
    AnnActionAsyncQuery b r -> ActionId
_aaaqActionId :: RQL.ActionId,
    AnnActionAsyncQuery b r -> GraphQLType
_aaaqOutputType :: GraphQLType,
    AnnActionAsyncQuery b r -> AsyncActionQueryFieldsG r
_aaaqFields :: AsyncActionQueryFieldsG r,
    AnnActionAsyncQuery b r -> [(Column b, ScalarType b)]
_aaaqDefinitionList :: [(Column b, ScalarType b)],
    AnnActionAsyncQuery b r -> StringifyNumbers
_aaaqStringifyNum :: StringifyNumbers,
    AnnActionAsyncQuery b r -> Bool
_aaaqForwardClientHeaders :: Bool,
    AnnActionAsyncQuery b r -> ActionSourceInfo b
_aaaqSource :: ActionSourceInfo b
  }
  deriving stock (a -> AnnActionAsyncQuery b b -> AnnActionAsyncQuery b a
(a -> b) -> AnnActionAsyncQuery b a -> AnnActionAsyncQuery b b
(forall a b.
 (a -> b) -> AnnActionAsyncQuery b a -> AnnActionAsyncQuery b b)
-> (forall a b.
    a -> AnnActionAsyncQuery b b -> AnnActionAsyncQuery b a)
-> Functor (AnnActionAsyncQuery b)
forall a b. a -> AnnActionAsyncQuery b b -> AnnActionAsyncQuery b a
forall a b.
(a -> b) -> AnnActionAsyncQuery b a -> AnnActionAsyncQuery b b
forall (b :: BackendType) a b.
a -> AnnActionAsyncQuery b b -> AnnActionAsyncQuery b a
forall (b :: BackendType) a b.
(a -> b) -> AnnActionAsyncQuery b a -> AnnActionAsyncQuery b b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> AnnActionAsyncQuery b b -> AnnActionAsyncQuery b a
$c<$ :: forall (b :: BackendType) a b.
a -> AnnActionAsyncQuery b b -> AnnActionAsyncQuery b a
fmap :: (a -> b) -> AnnActionAsyncQuery b a -> AnnActionAsyncQuery b b
$cfmap :: forall (b :: BackendType) a b.
(a -> b) -> AnnActionAsyncQuery b a -> AnnActionAsyncQuery b b
Functor, AnnActionAsyncQuery b a -> Bool
(a -> m) -> AnnActionAsyncQuery b a -> m
(a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b
(forall m. Monoid m => AnnActionAsyncQuery b m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AnnActionAsyncQuery b a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AnnActionAsyncQuery b a -> m)
-> (forall a b. (a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b)
-> (forall a b. (a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b)
-> (forall a. (a -> a -> a) -> AnnActionAsyncQuery b a -> a)
-> (forall a. (a -> a -> a) -> AnnActionAsyncQuery b a -> a)
-> (forall a. AnnActionAsyncQuery b a -> [a])
-> (forall a. AnnActionAsyncQuery b a -> Bool)
-> (forall a. AnnActionAsyncQuery b a -> Int)
-> (forall a. Eq a => a -> AnnActionAsyncQuery b a -> Bool)
-> (forall a. Ord a => AnnActionAsyncQuery b a -> a)
-> (forall a. Ord a => AnnActionAsyncQuery b a -> a)
-> (forall a. Num a => AnnActionAsyncQuery b a -> a)
-> (forall a. Num a => AnnActionAsyncQuery b a -> a)
-> Foldable (AnnActionAsyncQuery b)
forall a. Eq a => a -> AnnActionAsyncQuery b a -> Bool
forall a. Num a => AnnActionAsyncQuery b a -> a
forall a. Ord a => AnnActionAsyncQuery b a -> a
forall m. Monoid m => AnnActionAsyncQuery b m -> m
forall a. AnnActionAsyncQuery b a -> Bool
forall a. AnnActionAsyncQuery b a -> Int
forall a. AnnActionAsyncQuery b a -> [a]
forall a. (a -> a -> a) -> AnnActionAsyncQuery b a -> a
forall m a. Monoid m => (a -> m) -> AnnActionAsyncQuery b a -> m
forall b a. (b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b
forall a b. (a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b
forall (b :: BackendType) a.
Eq a =>
a -> AnnActionAsyncQuery b a -> Bool
forall (b :: BackendType) a. Num a => AnnActionAsyncQuery b a -> a
forall (b :: BackendType) a. Ord a => AnnActionAsyncQuery b a -> a
forall (b :: BackendType) m.
Monoid m =>
AnnActionAsyncQuery b m -> m
forall (b :: BackendType) a. AnnActionAsyncQuery b a -> Bool
forall (b :: BackendType) a. AnnActionAsyncQuery b a -> Int
forall (b :: BackendType) a. AnnActionAsyncQuery b a -> [a]
forall (b :: BackendType) a.
(a -> a -> a) -> AnnActionAsyncQuery b a -> a
forall (b :: BackendType) m a.
Monoid m =>
(a -> m) -> AnnActionAsyncQuery b a -> m
forall (b :: BackendType) b a.
(b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b
forall (b :: BackendType) a b.
(a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: AnnActionAsyncQuery b a -> a
$cproduct :: forall (b :: BackendType) a. Num a => AnnActionAsyncQuery b a -> a
sum :: AnnActionAsyncQuery b a -> a
$csum :: forall (b :: BackendType) a. Num a => AnnActionAsyncQuery b a -> a
minimum :: AnnActionAsyncQuery b a -> a
$cminimum :: forall (b :: BackendType) a. Ord a => AnnActionAsyncQuery b a -> a
maximum :: AnnActionAsyncQuery b a -> a
$cmaximum :: forall (b :: BackendType) a. Ord a => AnnActionAsyncQuery b a -> a
elem :: a -> AnnActionAsyncQuery b a -> Bool
$celem :: forall (b :: BackendType) a.
Eq a =>
a -> AnnActionAsyncQuery b a -> Bool
length :: AnnActionAsyncQuery b a -> Int
$clength :: forall (b :: BackendType) a. AnnActionAsyncQuery b a -> Int
null :: AnnActionAsyncQuery b a -> Bool
$cnull :: forall (b :: BackendType) a. AnnActionAsyncQuery b a -> Bool
toList :: AnnActionAsyncQuery b a -> [a]
$ctoList :: forall (b :: BackendType) a. AnnActionAsyncQuery b a -> [a]
foldl1 :: (a -> a -> a) -> AnnActionAsyncQuery b a -> a
$cfoldl1 :: forall (b :: BackendType) a.
(a -> a -> a) -> AnnActionAsyncQuery b a -> a
foldr1 :: (a -> a -> a) -> AnnActionAsyncQuery b a -> a
$cfoldr1 :: forall (b :: BackendType) a.
(a -> a -> a) -> AnnActionAsyncQuery b a -> a
foldl' :: (b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b
$cfoldl' :: forall (b :: BackendType) b a.
(b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b
foldl :: (b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b
$cfoldl :: forall (b :: BackendType) b a.
(b -> a -> b) -> b -> AnnActionAsyncQuery b a -> b
foldr' :: (a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b
$cfoldr' :: forall (b :: BackendType) a b.
(a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b
foldr :: (a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b
$cfoldr :: forall (b :: BackendType) a b.
(a -> b -> b) -> b -> AnnActionAsyncQuery b a -> b
foldMap' :: (a -> m) -> AnnActionAsyncQuery b a -> m
$cfoldMap' :: forall (b :: BackendType) m a.
Monoid m =>
(a -> m) -> AnnActionAsyncQuery b a -> m
foldMap :: (a -> m) -> AnnActionAsyncQuery b a -> m
$cfoldMap :: forall (b :: BackendType) m a.
Monoid m =>
(a -> m) -> AnnActionAsyncQuery b a -> m
fold :: AnnActionAsyncQuery b m -> m
$cfold :: forall (b :: BackendType) m.
Monoid m =>
AnnActionAsyncQuery b m -> m
Foldable, Functor (AnnActionAsyncQuery b)
Foldable (AnnActionAsyncQuery b)
Functor (AnnActionAsyncQuery b)
-> Foldable (AnnActionAsyncQuery b)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> AnnActionAsyncQuery b a -> f (AnnActionAsyncQuery b b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AnnActionAsyncQuery b (f a) -> f (AnnActionAsyncQuery b a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> AnnActionAsyncQuery b a -> m (AnnActionAsyncQuery b b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AnnActionAsyncQuery b (m a) -> m (AnnActionAsyncQuery b a))
-> Traversable (AnnActionAsyncQuery b)
(a -> f b)
-> AnnActionAsyncQuery b a -> f (AnnActionAsyncQuery b b)
forall (b :: BackendType). Functor (AnnActionAsyncQuery b)
forall (b :: BackendType). Foldable (AnnActionAsyncQuery b)
forall (b :: BackendType) (m :: * -> *) a.
Monad m =>
AnnActionAsyncQuery b (m a) -> m (AnnActionAsyncQuery b a)
forall (b :: BackendType) (f :: * -> *) a.
Applicative f =>
AnnActionAsyncQuery b (f a) -> f (AnnActionAsyncQuery b a)
forall (b :: BackendType) (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> AnnActionAsyncQuery b a -> m (AnnActionAsyncQuery b b)
forall (b :: BackendType) (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> AnnActionAsyncQuery b a -> f (AnnActionAsyncQuery b b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
AnnActionAsyncQuery b (m a) -> m (AnnActionAsyncQuery b a)
forall (f :: * -> *) a.
Applicative f =>
AnnActionAsyncQuery b (f a) -> f (AnnActionAsyncQuery b a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> AnnActionAsyncQuery b a -> m (AnnActionAsyncQuery b b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> AnnActionAsyncQuery b a -> f (AnnActionAsyncQuery b b)
sequence :: AnnActionAsyncQuery b (m a) -> m (AnnActionAsyncQuery b a)
$csequence :: forall (b :: BackendType) (m :: * -> *) a.
Monad m =>
AnnActionAsyncQuery b (m a) -> m (AnnActionAsyncQuery b a)
mapM :: (a -> m b)
-> AnnActionAsyncQuery b a -> m (AnnActionAsyncQuery b b)
$cmapM :: forall (b :: BackendType) (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> AnnActionAsyncQuery b a -> m (AnnActionAsyncQuery b b)
sequenceA :: AnnActionAsyncQuery b (f a) -> f (AnnActionAsyncQuery b a)
$csequenceA :: forall (b :: BackendType) (f :: * -> *) a.
Applicative f =>
AnnActionAsyncQuery b (f a) -> f (AnnActionAsyncQuery b a)
traverse :: (a -> f b)
-> AnnActionAsyncQuery b a -> f (AnnActionAsyncQuery b b)
$ctraverse :: forall (b :: BackendType) (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> AnnActionAsyncQuery b a -> f (AnnActionAsyncQuery b b)
$cp2Traversable :: forall (b :: BackendType). Foldable (AnnActionAsyncQuery b)
$cp1Traversable :: forall (b :: BackendType). Functor (AnnActionAsyncQuery b)
Traversable)

data ActionSourceInfo b
  = -- | No relationships defined on the action output object
    ASINoSource
  | -- | All relationships refer to tables in one source
    ASISource SourceName (SourceConfig b)

$(makeLenses ''AnnActionAsyncQuery)
$(makeLenses ''AnnActionExecution)
$(makePrisms ''AsyncActionQueryFieldG)