import { DocumentNode , ExecutionArgs , ExecutionResult , formatError , GraphQLSchema , SubscriptionArgs , validate , ValidationRule , } from "graphql" ; import Benzene from "./core" ; export interface Options < TContext , TExtra > { see https schema : GraphQLSchema ; see https formatErrorFn ? : typeof formatError ; param ctx contextFn ? : ContextFn < TContext , TExtra > ; param schema param document param operationName returns { object } compileQuery ? : CompileQuery ; see https validateFn ? : typeof validate ; /**
     * An optional array of validation rules that will be used to validate the document
     */ validationRules ? : ValidationRule [ ] ; } /**
 * The parameters used to execute a GraphQL query
 */ export interface GraphQLParams { query ? : Maybe < string > ; variables ? : Maybe < Record < string , any > > ; operationName ? : Maybe < string > ; extensions ? : Maybe < Record < string , any > > ; } export type ContextFn < TContext , TExtra > = ( contextInput : { extra : TExtra ; } ) => ValueOrPromise < TContext > ; export type ValueOrPromise < T > = T | Promise < T > ; export type ExtractExtraType < Type > = Type extends Benzene < any , infer TExtra > ? TExtra : never ; export type CompileQuery = ( schema : GraphQLSchema , document : DocumentNode , operationName ? : Maybe < string > ) => CompiledQuery | ExecutionResult ; export interface CompiledQuery { execute ( args ) : ValueOrPromise < ExecutionResult > ; subscribe ( args ) : Promise < AsyncIterableIterator < ExecutionResult > | ExecutionResult > ; stringify ? ( result ) : string ; } export interface CompiledResult extends CompiledQuery { operation : string ; document : DocumentNode ; } export type BenzeneGraphQLArgs < T > = Omit < T , "schema" | "document" > & { compiled ? : CompiledResult ; document ? : DocumentNode ; } ; export type Maybe < T > = null | undefined | T ;