{-# LANGUAGE DeriveLift #-}
{-# LANGUAGE NoImplicitPrelude #-}

module Data.Morpheus.Types.Internal.AST.DirectiveLocation
  ( DirectiveLocation (..),
  )
where

import Data.Morpheus.Rendering.RenderGQL (RenderGQL (..), fromShow)
import Data.Morpheus.Types.Internal.AST.Error (Msg (..))
import Language.Haskell.TH.Syntax (Lift)
import Relude hiding (Show, show)
import Prelude (Show (..))

data DirectiveLocation
  = QUERY
  | MUTATION
  | SUBSCRIPTION
  | FIELD
  | FRAGMENT_DEFINITION
  | FRAGMENT_SPREAD
  | INLINE_FRAGMENT
  | SCHEMA
  | SCALAR
  | OBJECT
  | FIELD_DEFINITION
  | ARGUMENT_DEFINITION
  | INTERFACE
  | UNION
  | ENUM
  | ENUM_VALUE
  | INPUT_OBJECT
  | INPUT_FIELD_DEFINITION
  deriving (Int -> DirectiveLocation -> ShowS
[DirectiveLocation] -> ShowS
DirectiveLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DirectiveLocation] -> ShowS
$cshowList :: [DirectiveLocation] -> ShowS
show :: DirectiveLocation -> String
$cshow :: DirectiveLocation -> String
showsPrec :: Int -> DirectiveLocation -> ShowS
$cshowsPrec :: Int -> DirectiveLocation -> ShowS
Show, DirectiveLocation -> DirectiveLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectiveLocation -> DirectiveLocation -> Bool
$c/= :: DirectiveLocation -> DirectiveLocation -> Bool
== :: DirectiveLocation -> DirectiveLocation -> Bool
$c== :: DirectiveLocation -> DirectiveLocation -> Bool
Eq, forall t.
(forall (m :: * -> *). Quote m => t -> m Exp)
-> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
forall (m :: * -> *). Quote m => DirectiveLocation -> m Exp
forall (m :: * -> *).
Quote m =>
DirectiveLocation -> Code m DirectiveLocation
liftTyped :: forall (m :: * -> *).
Quote m =>
DirectiveLocation -> Code m DirectiveLocation
$cliftTyped :: forall (m :: * -> *).
Quote m =>
DirectiveLocation -> Code m DirectiveLocation
lift :: forall (m :: * -> *). Quote m => DirectiveLocation -> m Exp
$clift :: forall (m :: * -> *). Quote m => DirectiveLocation -> m Exp
Lift)

instance Msg DirectiveLocation where
  msg :: DirectiveLocation -> GQLError
msg = forall a. Msg a => a -> GQLError
msg forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show

instance RenderGQL DirectiveLocation where
  renderGQL :: DirectiveLocation -> Rendering
renderGQL = forall a. Show a => a -> Rendering
fromShow