import { GraphQLFieldConfigArgumentMap, GraphQLOutputType, GraphQLResolveInfo } from "graphql"; import * as t from "io-ts"; import * as Knex from "knex"; import { AliasHierarchyVisitor } from "./AliasHierarchyVisitor"; import { MappedAssociation } from "./MappedAssociation"; import { MappedDataSource } from "./MappedDataSource"; import { MappedSourceAwareOperation } from "./MappedSourceAwareOperation"; import { ResolveInfoVisitor } from "./ResolveInfoVisitor"; import { SourceAwareOperationResolver } from "./SourceAwareOperationResolver"; import { Dict } from "./utils/util-types"; import { SourceAwareResolverContext } from "./SourceAwareResolverContext"; declare type RCtx = SourceAwareResolverContext, TSrc, TArgs>; export declare const SingleSourceOperationMappingRT: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ name: t.UnionC<[t.StringC, t.TypeC<{ stored: t.StringC; mapped: t.StringC; }>]>; }>, t.PartialC<{ description: t.StringC; singular: t.BooleanC; shallow: t.BooleanC; }>]>, t.PartialC<{ rootQuery: t.FunctionC; deriveWhereParams: t.FunctionC; }>]>; /** * A MappedOperation encapsulates the logic and information needed to map an operation * on a data source to a GraphQL Query/Mutation * * A MappedOperation is expected to not contain the actual logic for the operation - it delegates * to a Resolver class which will handle how this operation can be resolved in the context of * specified data source using the provided args. * * MappedOperation is primarily concerned with selection of appropriate data sources (if more than one * are specified), selection of an appropriate resolver (if more than one are specified) and delegating * to the selected resolver for perforrming the actual operation in database. * * Creating a custom sub-class of a MappedOperation is usually not required for most common use cases * because most use cases are better served by a custom resolver used with either MappedQueryOperation * or MappedMutationOperation, both of which descend from this class. * * In rare cases, sub-classing MappedOperation (or one of its descendants) can be beneficial when * consumer wants a more control over the mapping of operation to GraphQL layer than is possible through * the OperationMapping configuration. * * Example of such use cases include: * * - When GraphQL args can not be deduced from a static configuration and need to be defined dynamically * - Arbitrary adhoc (potentially async) transformation of args before delegating to a resolver. * * @api-category MapperClass */ export declare abstract class MappedSingleSourceOperation extends MappedSourceAwareOperation { mapping: MappedSourceAwareOperation["mapping"] & { rootSource: TSrc; rootQuery?: (dataSource: TSrc, args: TArgs, aliasHierarchyVisitor?: AliasHierarchyVisitor | null) => Knex.QueryBuilder; deriveWhereParams?: (args: TArgs, association?: MappedAssociation) => Dict; resolver?: , TSrc, TArgs>, TResolved>(ctx: TCtx) => SourceAwareOperationResolver; }; constructor(mapping: MappedSourceAwareOperation["mapping"] & { rootSource: TSrc; rootQuery?: (dataSource: TSrc, args: TArgs, aliasHierarchyVisitor?: AliasHierarchyVisitor | null) => Knex.QueryBuilder; deriveWhereParams?: (args: TArgs, association?: MappedAssociation) => Dict; resolver?: , TSrc, TArgs>, TResolved>(ctx: TCtx) => SourceAwareOperationResolver; }); get rootSource(): TSrc; get mappedArgs(): GraphQLFieldConfigArgumentMap; get type(): GraphQLOutputType; get ResolverContextType(): RCtx; rootQuery(dataSource: TSrc, args: TArgs, aliasHierachyVisitor: AliasHierarchyVisitor | null): Knex.QueryBuilder; createResolverContext(source: any, args: TArgs, context: any, resolveInfo: GraphQLResolveInfo, resolveInfoVisitor?: ResolveInfoVisitor): Promise>; } export {};