module Hasura.RQL.Types.Subscription
  ( CursorOrdering (..),
    SubscriptionType (..),
  )
where

import Hasura.Prelude

-- | CursorOrdering is used in the streaming subscriptions to specify how to order the cursor.
data CursorOrdering = COAscending | CODescending deriving (Int -> CursorOrdering -> ShowS
[CursorOrdering] -> ShowS
CursorOrdering -> String
(Int -> CursorOrdering -> ShowS)
-> (CursorOrdering -> String)
-> ([CursorOrdering] -> ShowS)
-> Show CursorOrdering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CursorOrdering] -> ShowS
$cshowList :: [CursorOrdering] -> ShowS
show :: CursorOrdering -> String
$cshow :: CursorOrdering -> String
showsPrec :: Int -> CursorOrdering -> ShowS
$cshowsPrec :: Int -> CursorOrdering -> ShowS
Show, CursorOrdering -> CursorOrdering -> Bool
(CursorOrdering -> CursorOrdering -> Bool)
-> (CursorOrdering -> CursorOrdering -> Bool) -> Eq CursorOrdering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CursorOrdering -> CursorOrdering -> Bool
$c/= :: CursorOrdering -> CursorOrdering -> Bool
== :: CursorOrdering -> CursorOrdering -> Bool
$c== :: CursorOrdering -> CursorOrdering -> Bool
Eq, (forall x. CursorOrdering -> Rep CursorOrdering x)
-> (forall x. Rep CursorOrdering x -> CursorOrdering)
-> Generic CursorOrdering
forall x. Rep CursorOrdering x -> CursorOrdering
forall x. CursorOrdering -> Rep CursorOrdering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CursorOrdering x -> CursorOrdering
$cfrom :: forall x. CursorOrdering -> Rep CursorOrdering x
Generic)

instance Hashable CursorOrdering

data SubscriptionType = Streaming | LiveQuery deriving (Int -> SubscriptionType -> ShowS
[SubscriptionType] -> ShowS
SubscriptionType -> String
(Int -> SubscriptionType -> ShowS)
-> (SubscriptionType -> String)
-> ([SubscriptionType] -> ShowS)
-> Show SubscriptionType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubscriptionType] -> ShowS
$cshowList :: [SubscriptionType] -> ShowS
show :: SubscriptionType -> String
$cshow :: SubscriptionType -> String
showsPrec :: Int -> SubscriptionType -> ShowS
$cshowsPrec :: Int -> SubscriptionType -> ShowS
Show, SubscriptionType -> SubscriptionType -> Bool
(SubscriptionType -> SubscriptionType -> Bool)
-> (SubscriptionType -> SubscriptionType -> Bool)
-> Eq SubscriptionType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubscriptionType -> SubscriptionType -> Bool
$c/= :: SubscriptionType -> SubscriptionType -> Bool
== :: SubscriptionType -> SubscriptionType -> Bool
$c== :: SubscriptionType -> SubscriptionType -> Bool
Eq, (forall x. SubscriptionType -> Rep SubscriptionType x)
-> (forall x. Rep SubscriptionType x -> SubscriptionType)
-> Generic SubscriptionType
forall x. Rep SubscriptionType x -> SubscriptionType
forall x. SubscriptionType -> Rep SubscriptionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubscriptionType x -> SubscriptionType
$cfrom :: forall x. SubscriptionType -> Rep SubscriptionType x
Generic)