import { DocumentNode, FieldNode, FragmentDefinitionNode, GraphQLAbstractType, GraphQLCompositeType, GraphQLField, GraphQLObjectType, GraphQLSchema, OperationDefinitionNode, SelectionSetNode, VariableDefinitionNode } from 'graphql';
import { FieldSet, Scope } from './FieldSet';
import { QueryPlan, OperationContext, FragmentMap } from './QueryPlan';
export interface BuildQueryPlanOptions {
    autoFragmentization: boolean;
}
export declare function buildQueryPlan(operationContext: OperationContext, options?: BuildQueryPlanOptions): QueryPlan;
export declare function collectSubfields(context: QueryPlanningContext, returnType: GraphQLCompositeType, fields: FieldSet): FieldSet;
export declare function buildOperationContext(schema: GraphQLSchema, document: DocumentNode, operationName?: string): OperationContext;
export declare function buildQueryPlanningContext({ operation, schema, fragments }: OperationContext, options: BuildQueryPlanOptions): QueryPlanningContext;
export declare class QueryPlanningContext {
    readonly schema: GraphQLSchema;
    readonly operation: OperationDefinitionNode;
    readonly fragments: FragmentMap;
    readonly autoFragmentization: boolean;
    internalFragments: Map<string, {
        name: string;
        definition: FragmentDefinitionNode;
        selectionSet: SelectionSetNode;
    }>;
    internalFragmentCount: number;
    protected variableDefinitions: {
        [name: string]: VariableDefinitionNode;
    };
    constructor(schema: GraphQLSchema, operation: OperationDefinitionNode, fragments: FragmentMap, autoFragmentization: boolean);
    getFieldDef(parentType: GraphQLCompositeType, fieldNode: FieldNode): GraphQLField<any, any, {
        [key: string]: any;
    }>;
    getPossibleTypes(type: GraphQLAbstractType | GraphQLObjectType): ReadonlyArray<GraphQLObjectType>;
    getVariableUsages(selectionSet: SelectionSetNode, fragments: Set<FragmentDefinitionNode>): {
        [name: string]: VariableDefinitionNode;
    };
    newScope<TParent extends GraphQLCompositeType>(parentType: TParent, enclosingScope?: Scope<GraphQLCompositeType>): Scope<TParent>;
    getBaseService(parentType: GraphQLObjectType): string | null;
    getOwningService(parentType: GraphQLObjectType, fieldDef: GraphQLField<any, any>): string | null;
    getKeyFields({ parentType, serviceName, fetchAll, }: {
        parentType: GraphQLCompositeType;
        serviceName: string;
        fetchAll?: boolean;
    }): FieldSet;
    getRequiredFields(parentType: GraphQLCompositeType, fieldDef: GraphQLField<any, any>, serviceName: string): FieldSet;
    getProvidedFields(fieldDef: GraphQLField<any, any>, serviceName: string): FieldSet;
}
//# sourceMappingURL=buildQueryPlan.d.ts.map