{-# LANGUAGE DeriveLift #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NoImplicitPrelude #-}

module Data.Morpheus.Types.Internal.AST
  ( Ref (..),
    Position (..),
    Message,
    FieldName,
    Description,
    Stage,
    CONST,
    VALID,
    RAW,
    Value (..),
    ScalarValue (..),
    Object,
    replaceValue,
    decodeScientific,
    RawValue,
    ValidValue,
    RawObject,
    ValidObject,
    ResolvedObject,
    ResolvedValue,
    Argument (..),
    Arguments,
    SelectionSet,
    SelectionContent (..),
    Selection (..),
    Fragments,
    Fragment (..),
    Operation (..),
    Variable (..),
    VariableDefinitions,
    DefaultValue,
    getOperationName,
    ScalarDefinition (..),
    DataEnum,
    FieldsDefinition,
    ArgumentDefinition (..),
    UnionTypeDefinition,
    ArgumentsDefinition,
    FieldDefinition (..),
    InputFieldsDefinition,
    TypeContent (..),
    TypeDefinition (..),
    Schema (..),
    TypeKind (..),
    TypeWrapper (..),
    TypeRef (..),
    DataEnumValue (..),
    OperationType (..),
    QUERY,
    MUTATION,
    SUBSCRIPTION,
    Directive (..),
    TypeCategory (..),
    VariableContent (..),
    TypeDefinitions,
    initTypeLib,
    kindOf,
    toNullable,
    isNullable,
    Subtyping (..),
    isNotSystemTypeName,
    isLeaf,
    isResolverType,
    mkEnumContent,
    createScalarType,
    mkUnionContent,
    mkTypeRef,
    mkInputUnionFields,
    fieldVisibility,
    lookupDeprecated,
    lookupDeprecatedReason,
    lookupWith,
    ExecutableDocument (..),
    Variables,
    unsafeFromFields,
    OrdMap,
    GQLError (..),
    GQLErrors,
    ObjectEntry (..),
    UnionTag (..),
    ANY,
    IN,
    OUT,
    OBJECT,
    IMPLEMENTABLE,
    fromAny,
    toAny,
    TRUE,
    FALSE,
    TypeName,
    Token,
    Msg (..),
    intercalate,
    fieldsToArguments,
    Directives,
    DirectivesDefinition,
    DirectiveDefinition (..),
    DirectiveLocation (..),
    FieldContent (..),
    fieldArguments,
    mkType,
    mkObjectField,
    UnionMember (..),
    mkUnionMember,
    mkNullaryMember,
    RawTypeDefinition (..),
    RootOperationTypeDefinition (..),
    UnionSelection,
    SchemaDefinition (..),
    buildSchema,
    getOperationDataType,
    Typed (Typed),
    typed,
    untyped,
    LEAF,
    INPUT_OBJECT,
    ToCategory (..),
    FromCategory (..),
    possibleTypes,
    possibleInterfaceTypes,
    mkField,
    defineSchemaWith,
    type (<=!),
    ToOBJECT,
    constraintInputUnion,
    getInputUnionValue,
    unitFieldName,
    unitTypeName,
    mkBaseType,
    mkMaybeType,
    isPossibleInterfaceType,
    packName,
    unpackName,
    at,
    atPositions,
    typeDefinitions,
    FragmentName,
    isInternal,
    internal,
    isCustom,
    custom,
    getCustomErrorType,
    splitSystemSelection,
    lookupDataType,
    Name,
    withPath,
    withExtensions,
    PropName (..),
    defineDirective,
  )
where

import Data.Mergeable.OrdMap (OrdMap)
import Data.Mergeable.SafeHashMap (SafeHashMap)
import Data.Morpheus.Types.Internal.AST.Base
import Data.Morpheus.Types.Internal.AST.DirectiveLocation (DirectiveLocation (..))
import Data.Morpheus.Types.Internal.AST.Error
import Data.Morpheus.Types.Internal.AST.Fields
import Data.Morpheus.Types.Internal.AST.Name
import Data.Morpheus.Types.Internal.AST.OperationType
import Data.Morpheus.Types.Internal.AST.Selection
import Data.Morpheus.Types.Internal.AST.Stage
import Data.Morpheus.Types.Internal.AST.Type
import Data.Morpheus.Types.Internal.AST.TypeCategory
import Data.Morpheus.Types.Internal.AST.TypeSystem
import Data.Morpheus.Types.Internal.AST.Union
import Data.Morpheus.Types.Internal.AST.Value
import Language.Haskell.TH.Syntax (Lift)
import Prelude (Show)

type Variables = SafeHashMap FieldName ResolvedValue

data ExecutableDocument = ExecutableDocument
  { ExecutableDocument -> Variables
inputVariables :: Variables,
    ExecutableDocument -> Operation RAW
operation :: Operation RAW,
    ExecutableDocument -> Fragments RAW
fragments :: Fragments RAW
  }
  deriving (Int -> ExecutableDocument -> ShowS
[ExecutableDocument] -> ShowS
ExecutableDocument -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecutableDocument] -> ShowS
$cshowList :: [ExecutableDocument] -> ShowS
show :: ExecutableDocument -> String
$cshow :: ExecutableDocument -> String
showsPrec :: Int -> ExecutableDocument -> ShowS
$cshowsPrec :: Int -> ExecutableDocument -> ShowS
Show, forall t.
(forall (m :: * -> *). Quote m => t -> m Exp)
-> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
forall (m :: * -> *). Quote m => ExecutableDocument -> m Exp
forall (m :: * -> *).
Quote m =>
ExecutableDocument -> Code m ExecutableDocument
liftTyped :: forall (m :: * -> *).
Quote m =>
ExecutableDocument -> Code m ExecutableDocument
$cliftTyped :: forall (m :: * -> *).
Quote m =>
ExecutableDocument -> Code m ExecutableDocument
lift :: forall (m :: * -> *). Quote m => ExecutableDocument -> m Exp
$clift :: forall (m :: * -> *). Quote m => ExecutableDocument -> m Exp
Lift)