/** * PostGraphile v5 i18n Plugin * * Discovers tables tagged with @i18n and adds a `localeStrings` field to the * base type. The field resolves the best-matching translation row based on * language codes provided in the GraphQL context, falling back to the base * table's own values when no translation exists. * * Smart tag format: * COMMENT ON TABLE app_public.posts IS E'@i18n posts_translations'; * * The value of @i18n is the name of the translation table in the same schema. * The translation table must have: * - A FK column referencing the base table's PK * - A lang_code column (configurable) * - UNIQUE(fk_column, lang_code) * - One or more text/citext columns matching the base table's columns */ import 'graphile-build'; import 'graphile-build-pg'; import type { GraphileConfig } from 'graphile-config'; import type { I18nPluginOptions } from './types'; declare global { namespace GraphileConfig { interface Plugins { I18nPlugin: true; } } } export declare function createI18nPlugin(options?: I18nPluginOptions): GraphileConfig.Plugin; export declare const I18nPlugin: GraphileConfig.Plugin;