{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskellQuotes #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Data.Morpheus.Client.CodeGen.QuasiQuoter
( raw,
)
where
import qualified Data.Text as T
import Language.Haskell.TH.Quote
import Relude hiding (ByteString)
notSupported :: Text -> a
notSupported :: forall a. Text -> a
notSupported Text
things =
forall a t. (HasCallStack, IsText t) => t -> a
error forall a b. (a -> b) -> a -> b
$
Text
things
forall a. Semigroup a => a -> a -> a
<> Text
" are not supported by the GraphQL QuasiQuoter"
raw :: QuasiQuoter
raw :: QuasiQuoter
raw =
QuasiQuoter
{ quoteExp :: String -> Q Exp
quoteExp = \String
txt -> [|T.pack txt|],
quotePat :: String -> Q Pat
quotePat = forall a. Text -> a
notSupported Text
"Patterns",
quoteType :: String -> Q Type
quoteType = forall a. Text -> a
notSupported Text
"Types",
quoteDec :: String -> Q [Dec]
quoteDec = forall a. Text -> a
notSupported Text
"Declarations"
}