import { DocumentNode } from 'graphql'; import { DatabaseAdapter } from '../database/database-adapter'; import { Project } from '../project/project'; import { ExecutionOptions } from './execution-options'; import { ExecutionResult } from './execution-result'; type Maybe = T | undefined | null; export interface SchemaExecutionArgs { readonly document: DocumentNode; readonly contextValue?: any; readonly variableValues?: Maybe<{ [key: string]: any; }>; readonly operationName?: Maybe; /** * additional information relevant for execution. If not specified, it is taken from the project's options callback * */ readonly options?: ExecutionOptions; } /** * Experimental API, lacks of significant features like validation or introspection */ export declare class SchemaExecutor { private readonly project; private readonly databaseAdapter; private readonly queryType; private readonly mutationType; private readonly dumbSchema; private readonly resolver; constructor(project: Project, databaseAdapter: DatabaseAdapter); /** * Determines if a given operation can be executed by this executor * * @return the info whether it is executable, and if not, why. */ canExecute(operation: SchemaExecutionArgs): { readonly canExecute: boolean; readonly errorMessage?: string; }; /** * Executes a GraphQL query without running the GraphQL engine if possible * @return a promise to the execution result if possible, undefined if the query can not be evaluated */ tryExecute(args: SchemaExecutionArgs): Promise | undefined; private validate; } export {};