import type { FieldNode } from 'graphql'; import { OrmClient, QueryResult } from './client'; export interface QueryBuilderConfig { client: OrmClient; operation: 'query' | 'mutation'; operationName: string; fieldName: string; document: string; variables?: Record; transform?: (data: any) => TResult; } export declare class QueryBuilder { private config; constructor(config: QueryBuilderConfig); /** * Execute the query and return a discriminated union result * Use result.ok to check success, or .unwrap() to throw on error */ execute(): Promise>; /** * Execute and unwrap the result, throwing GraphQLRequestError on failure * @throws {GraphQLRequestError} If the query returns errors */ unwrap(): Promise; /** * Execute and unwrap, returning defaultValue on error instead of throwing */ unwrapOr(defaultValue: D): Promise; /** * Execute and unwrap, calling onError callback on failure */ unwrapOrElse(onError: (errors: import('./client').GraphQLError[]) => D): Promise; toGraphQL(): string; getVariables(): Record | undefined; } export declare function buildSelections(select: Record | undefined, connectionFieldsMap?: Record>, entityType?: string): FieldNode[]; export declare function buildFindManyDocument(operationName: string, queryField: string, select: TSelect, args: { where?: TWhere; orderBy?: string[]; first?: number; last?: number; after?: string; before?: string; offset?: number; }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildFindFirstDocument(operationName: string, queryField: string, select: TSelect, args: { where?: TWhere; orderBy?: string[]; }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildCreateDocument(operationName: string, mutationField: string, entityField: string, select: TSelect, data: TData, inputTypeName: string, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildUpdateDocument(operationName: string, mutationField: string, entityField: string, select: TSelect, where: TWhere, data: TData, inputTypeName: string, patchFieldName: string, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildUpdateByPkDocument(operationName: string, mutationField: string, entityField: string, select: TSelect, id: string | number, data: TData, inputTypeName: string, idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, extraKeys?: Record): { document: string; variables: Record; }; export declare function buildFindOneDocument(operationName: string, queryField: string, id: string | number, select: TSelect, idArgName: string, idTypeName: string, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildDeleteDocument(operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildDeleteByPkDocument(operationName: string, mutationField: string, entityField: string, keys: Record, inputTypeName: string, select?: TSelect, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildJunctionRemoveDocument(operationName: string, mutationField: string, keys: Record, inputTypeName: string): { document: string; variables: Record; }; export declare function buildCustomDocument(operationType: 'query' | 'mutation', operationName: string, fieldName: string, select: TSelect, args: TArgs, variableDefinitions: Array<{ name: string; type: string; }>, connectionFieldsMap?: Record>, entityType?: string): { document: string; variables: Record; }; export declare function buildBulkInsertDocument(operationName: string, mutationField: string, select: TSelect, data: TData[], inputTypeName: string, onConflict?: unknown, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildBulkUpsertDocument(operationName: string, mutationField: string, select: TSelect, data: TData[], inputTypeName: string, onConflict: unknown, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildBulkUpdateDocument(operationName: string, mutationField: string, select: TSelect, where: TWhere, data: TData, inputTypeName: string, connectionFieldsMap?: Record>): { document: string; variables: Record; }; export declare function buildBulkDeleteDocument(operationName: string, mutationField: string, select: TSelect, where: TWhere, inputTypeName: string, connectionFieldsMap?: Record>): { document: string; variables: Record; };