import { Field } from '../model'; import { QueryNode } from '../query-tree'; import { FieldContext, SelectionToken } from './query-node-object-type'; export interface ProcessFieldResult { /** * If the RootFieldHelper can already resolve this fields, this will be populated with the value. */ readonly resultNode: QueryNode | undefined; /** * The source node, which might differ from the sourceNode passed in in case of root entity capture. * * Only relevant if resultNode is undefined. */ readonly sourceNode: QueryNode; /** * if this field is a collect field, specifies whether it should capture root entities */ readonly captureRootEntitiesOnCollectFields: boolean; } export declare class RootFieldHelper { private readonly hierarchyStackFramesBySelection; private readonly fieldsBySelection; private readonly selectionsThatCaptureRootEntities; /** * Should be called whenever a field is resolved. Will maintain a hierarchy structure, and may produce a value node */ processField(field: Field, sourceNode: QueryNode, fieldContext: FieldContext): ProcessFieldResult; getRealItemNode(itemNode: QueryNode, fieldContext: FieldContext): QueryNode; /** * Determines whether a selection has been instructed (by captureRootEntitiesOnCollectFields) to capture root entities */ capturesRootEntity(selectionToken: SelectionToken): boolean; private tryResolveField; private shouldCaptureRootEntity; private selectsRootField; /** * Determines whether a @root field can be reached from anywhere within the given type. * * Stops at root entity boundaries */ private hasReachableRootField; private getHierarchyStackFrame; private setHierarchyStackFrame; private getFieldAtSelection; private setFieldAtSelection; }