import { type Node, NodeAdapter, type Plan, type PlayedPlan, type QueryVisitor, type SelectFn } from '@pothos/selection-mapper'; import { type TableRelationalConfig } from 'drizzle-orm'; import type { GraphQLField, GraphQLNamedType } from 'graphql'; import type { PothosDrizzleSchemaConfig } from './config.js'; import { InternalError } from './errors.js'; import { type SelectionMap } from './selections.js'; export type DrizzleNode = Node; export type DrizzlePlan = Plan; export type DrizzlePlayedPlan = PlayedPlan; type DrizzleVisitor = QueryVisitor; /** * How drizzle selections (`DBQueryConfig`: `columns`, `with`, `extras` and query arguments) read * onto the shared query tree, and how a node is written back. A node whose columns are `null` * selects every column; a named-column node always adds the table's primary key so rows can be * matched back to their parent. * * The merge, compare and conflict rules are `NodeAdapter`'s: this is the schema side, the key * loop and `toQuery`. The schema config every one of them needs is the adapter's own state. */ export declare class DrizzleAdapter extends NodeAdapter { private readonly config; skipDeferredFragments: boolean; private readonly fieldSelections; constructor(config: PothosDrizzleSchemaConfig); modelFor(type: GraphQLNamedType): TableRelationalConfig | undefined; typeSelection(type: GraphQLNamedType): SelectionMap | undefined; fieldSelection(field: GraphQLField): SelectFn | import("drizzle-orm").DBQueryConfig<"one"> | undefined; visitQuery({ columns, with: withSelection, extras, ...args }: SelectionMap, model: TableRelationalConfig, visit: DrizzleVisitor): void; /** * Drizzle's `extras` are functions, compared by identity: the inherited deep-equal would let * two different functions computing the same shape merge. */ computedConflicts(computed: ReadonlyMap, name: string, value: unknown): boolean; toQuery(node: DrizzleNode): SelectionMap; /** The keys of a `with` map, resolved to the tables they target. */ private readRelations; } /** A select naming a relation its table does not have. */ export declare class UnknownRelationError extends InternalError { readonly relation: string; readonly table: string; constructor(relation: string, table: string); } export declare const drizzleAdapter: import("@pothos/core").ContextCache; export {}; //# sourceMappingURL=adapter.d.ts.map