{-# 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 HashMap
import Data.Kind (Type)
import Hasura.Prelude
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.BackendType
import Hasura.RQL.Types.Common (EnvRecord, FieldName, Fields, ResolvedWebhook, SourceName, Timeout)
import Hasura.RQL.Types.CustomTypes
  ( AnnotatedObjectType (..),
    AnnotatedOutputType (..),
    GraphQLType (..),
    ObjectFieldDefinition (..),
    ObjectFieldName (..),
  )
import Hasura.RQL.Types.Headers
import Hasura.RQL.Types.Schema.Options (StringifyNumbers)
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
$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
/= :: 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
$cshowsPrec :: forall r. Show r => Int -> ActionFieldG r -> ShowS
showsPrec :: Int -> ActionFieldG r -> ShowS
$cshow :: forall r. Show r => ActionFieldG r -> String
show :: ActionFieldG r -> String
$cshowList :: forall r. Show r => [ActionFieldG r] -> ShowS
showList :: [ActionFieldG r] -> ShowS
Show, (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
$cfmap :: forall a b. (a -> b) -> ActionFieldG a -> ActionFieldG b
fmap :: forall a b. (a -> b) -> ActionFieldG a -> ActionFieldG b
$c<$ :: forall a b. a -> ActionFieldG b -> ActionFieldG a
<$ :: forall a b. a -> ActionFieldG b -> ActionFieldG a
Functor, (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
$cfold :: forall m. Monoid m => ActionFieldG m -> m
fold :: forall m. Monoid m => ActionFieldG m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> ActionFieldG a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b
foldr :: forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> ActionFieldG a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b
foldl :: forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> ActionFieldG a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> ActionFieldG a -> a
foldr1 :: forall a. (a -> a -> a) -> ActionFieldG a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> ActionFieldG a -> a
foldl1 :: forall a. (a -> a -> a) -> ActionFieldG a -> a
$ctoList :: forall a. ActionFieldG a -> [a]
toList :: forall a. ActionFieldG a -> [a]
$cnull :: forall a. ActionFieldG a -> Bool
null :: forall a. ActionFieldG a -> Bool
$clength :: forall a. ActionFieldG a -> Int
length :: forall a. ActionFieldG a -> Int
$celem :: forall a. Eq a => a -> ActionFieldG a -> Bool
elem :: forall a. Eq a => a -> ActionFieldG a -> Bool
$cmaximum :: forall a. Ord a => ActionFieldG a -> a
maximum :: forall a. Ord a => ActionFieldG a -> a
$cminimum :: forall a. Ord a => ActionFieldG a -> a
minimum :: forall a. Ord a => ActionFieldG a -> a
$csum :: forall a. Num a => ActionFieldG a -> a
sum :: forall a. Num a => ActionFieldG a -> a
$cproduct :: forall a. Num a => ActionFieldG a -> a
product :: forall a. Num a => ActionFieldG a -> a
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
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)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ActionFieldG a -> f (ActionFieldG b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ActionFieldG a -> f (ActionFieldG b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ActionFieldG (f a) -> f (ActionFieldG a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
ActionFieldG (f a) -> f (ActionFieldG a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ActionFieldG a -> m (ActionFieldG b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ActionFieldG a -> m (ActionFieldG b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
ActionFieldG (m a) -> m (ActionFieldG a)
sequence :: forall (m :: * -> *) a.
Monad m =>
ActionFieldG (m a) -> m (ActionFieldG a)
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
    forall r.
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.
    forall r. 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
$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
/= :: 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
$cshowsPrec :: forall r.
Show r =>
Int -> ActionRemoteRelationshipSelect r -> ShowS
showsPrec :: Int -> ActionRemoteRelationshipSelect r -> ShowS
$cshow :: forall r. Show r => ActionRemoteRelationshipSelect r -> String
show :: ActionRemoteRelationshipSelect r -> String
$cshowList :: forall r. Show r => [ActionRemoteRelationshipSelect r] -> ShowS
showList :: [ActionRemoteRelationshipSelect r] -> ShowS
Show, (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
$cfmap :: forall a b.
(a -> b)
-> ActionRemoteRelationshipSelect a
-> ActionRemoteRelationshipSelect b
fmap :: forall a b.
(a -> b)
-> ActionRemoteRelationshipSelect a
-> ActionRemoteRelationshipSelect b
$c<$ :: forall a b.
a
-> ActionRemoteRelationshipSelect b
-> ActionRemoteRelationshipSelect a
<$ :: forall a b.
a
-> ActionRemoteRelationshipSelect b
-> ActionRemoteRelationshipSelect a
Functor, (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
$cfold :: forall m. Monoid m => ActionRemoteRelationshipSelect m -> m
fold :: forall m. Monoid m => ActionRemoteRelationshipSelect m -> m
$cfoldMap :: forall m a.
Monoid m =>
(a -> m) -> ActionRemoteRelationshipSelect a -> m
foldMap :: forall m a.
Monoid m =>
(a -> m) -> ActionRemoteRelationshipSelect a -> m
$cfoldMap' :: forall m a.
Monoid m =>
(a -> m) -> ActionRemoteRelationshipSelect a -> m
foldMap' :: forall m a.
Monoid m =>
(a -> m) -> ActionRemoteRelationshipSelect a -> m
$cfoldr :: forall a b.
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldr :: forall a b.
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldr' :: forall a b.
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldr' :: forall a b.
(a -> b -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldl :: forall b a.
(b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldl :: forall b a.
(b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldl' :: forall b a.
(b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
foldl' :: forall b a.
(b -> a -> b) -> b -> ActionRemoteRelationshipSelect a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
foldr1 :: forall a. (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
foldl1 :: forall a. (a -> a -> a) -> ActionRemoteRelationshipSelect a -> a
$ctoList :: forall a. ActionRemoteRelationshipSelect a -> [a]
toList :: forall a. ActionRemoteRelationshipSelect a -> [a]
$cnull :: forall a. ActionRemoteRelationshipSelect a -> Bool
null :: forall a. ActionRemoteRelationshipSelect a -> Bool
$clength :: forall a. ActionRemoteRelationshipSelect a -> Int
length :: forall a. ActionRemoteRelationshipSelect a -> Int
$celem :: forall a. Eq a => a -> ActionRemoteRelationshipSelect a -> Bool
elem :: forall a. Eq a => a -> ActionRemoteRelationshipSelect a -> Bool
$cmaximum :: forall a. Ord a => ActionRemoteRelationshipSelect a -> a
maximum :: forall a. Ord a => ActionRemoteRelationshipSelect a -> a
$cminimum :: forall a. Ord a => ActionRemoteRelationshipSelect a -> a
minimum :: forall a. Ord a => ActionRemoteRelationshipSelect a -> a
$csum :: forall a. Num a => ActionRemoteRelationshipSelect a -> a
sum :: forall a. Num a => ActionRemoteRelationshipSelect a -> a
$cproduct :: forall a. Num a => ActionRemoteRelationshipSelect a -> a
product :: forall a. Num a => ActionRemoteRelationshipSelect a -> a
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
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)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> ActionRemoteRelationshipSelect a
-> f (ActionRemoteRelationshipSelect b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> ActionRemoteRelationshipSelect a
-> f (ActionRemoteRelationshipSelect b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ActionRemoteRelationshipSelect (f a)
-> f (ActionRemoteRelationshipSelect a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
ActionRemoteRelationshipSelect (f a)
-> f (ActionRemoteRelationshipSelect a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> ActionRemoteRelationshipSelect a
-> m (ActionRemoteRelationshipSelect b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> ActionRemoteRelationshipSelect a
-> m (ActionRemoteRelationshipSelect b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
ActionRemoteRelationshipSelect (m a)
-> m (ActionRemoteRelationshipSelect a)
sequence :: forall (m :: * -> *) a.
Monad m =>
ActionRemoteRelationshipSelect (m a)
-> m (ActionRemoteRelationshipSelect a)
Traversable)

$(makePrisms ''ActionFieldG)

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

type ActionOutputFields = HashMap.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
HashMap.fromList do
    ObjectFieldDefinition {Maybe Value
Maybe Description
(GType, AnnotatedObjectFieldType)
ObjectFieldName
_ofdName :: ObjectFieldName
_ofdArguments :: Maybe Value
_ofdDescription :: Maybe Description
_ofdType :: (GType, AnnotatedObjectFieldType)
_ofdName :: forall field. ObjectFieldDefinition field -> ObjectFieldName
_ofdArguments :: forall field. ObjectFieldDefinition field -> Maybe Value
_ofdDescription :: forall field. ObjectFieldDefinition field -> Maybe Description
_ofdType :: forall field. ObjectFieldDefinition field -> field
..} <- NonEmpty (ObjectFieldDefinition (GType, AnnotatedObjectFieldType))
-> [ObjectFieldDefinition (GType, AnnotatedObjectFieldType)]
forall a. NonEmpty a -> [a]
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 a. a -> [a]
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
HashMap.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
$cshowsPrec :: Int -> AnnActionMutationAsync -> ShowS
showsPrec :: Int -> AnnActionMutationAsync -> ShowS
$cshow :: AnnActionMutationAsync -> String
show :: AnnActionMutationAsync -> String
$cshowList :: [AnnActionMutationAsync] -> ShowS
showList :: [AnnActionMutationAsync] -> ShowS
Show, AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
(AnnActionMutationAsync -> AnnActionMutationAsync -> Bool)
-> (AnnActionMutationAsync -> AnnActionMutationAsync -> Bool)
-> Eq AnnActionMutationAsync
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
== :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
$c/= :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
/= :: AnnActionMutationAsync -> AnnActionMutationAsync -> Bool
Eq)

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

type AsyncActionQueryFieldsG r = Fields (AsyncActionQueryFieldG r)

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