UNPKG

graphile-search-plugin

Version:

Generate search conditions for your tsvector columns (PostGraphile v5)

38 lines (37 loc) 1.18 kB
/** * PgSearch Plugin Types * * Type definitions for the PostGraphile v5 search plugin configuration. */ /** * Plugin configuration options. */ export interface PgSearchPluginOptions { /** * Prefix for tsvector condition fields. * For example, with prefix 'fullText' and a column named 'tsv', * the generated condition field will be 'fullTextTsv'. * @default 'tsv' */ pgSearchPrefix?: string; /** * Whether to hide tsvector columns from output types. * When true, tsvector columns won't appear as fields on the GraphQL object type. * @default false */ hideTsvectorColumns?: boolean; /** * Name of the custom GraphQL scalar for tsvector columns. * This scalar isolates filter operators (like `matches`) to tsvector columns * rather than all String fields. * @default 'FullText' */ fullTextScalarName?: string; /** * PostgreSQL text search configuration used with `websearch_to_tsquery`. * Must match the configuration used when building your tsvector columns * (e.g., `'english'`, `'simple'`, `'spanish'`). * @default 'english' */ tsConfig?: string; }