/** * LtreeCodecPlugin * * Ensures PostGraphile v5 properly handles ltree, lquery, and ltxtquery types. * * PostGraphile v5 (rc.8+) natively maps ltree to a GraphQL scalar named "LTree". * This plugin: * 1. Falls back to registering codecs if PostGraphile's native handling misses them * 2. Re-enables ltree columns for select/filterBy (overrides rc.8 HIDE_BY_DEFAULT) * 3. Converts between slash-delimited file paths (external API) and dot-delimited * ltree (internal storage) at the GraphQL boundary via the codec's fromPg/toPg. * * External API: "/projects/alpha/docs" (slash-delimited file paths) * Internal DB: "projects.alpha.docs" (ltree native format) * * The conversion happens at the codec level (fromPg/toPg) so it works regardless * of whether PostGraphile registers its own LTree scalar or we register ours. * * The native scalar name is "LTree" (capital T). All operators and downstream * plugins should reference LTREE_SCALAR_NAME for consistency. */ import type { GraphileConfig } from 'graphile-config'; export declare const LTREE_SCALAR_NAME = "LTree"; /** * Convert a slash-delimited file path to ltree format. * Idempotent on ltree values (no slashes → no change). * * "/projects/alpha/docs" → "projects.alpha.docs" * "projects.alpha.docs" → "projects.alpha.docs" (no-op) */ export declare function slashToLtree(value: string): string; /** * Convert an ltree value to a slash-delimited file path. * * "projects.alpha.docs" → "/projects/alpha/docs" * "" → "/" */ export declare function ltreeToSlash(value: string): string; export declare const LtreeCodecPlugin: GraphileConfig.Plugin;