graphile-settings 4.8.4 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,5 @@
6
6
  */
7
7
  export { MinimalPreset, InflektPlugin, InflektPreset, CustomInflectorPlugin, CustomInflectorPreset, ConflictDetectorPlugin, ConflictDetectorPreset, InflectorLoggerPlugin, InflectorLoggerPreset, EnableAllFilterColumnsPlugin, EnableAllFilterColumnsPreset, ManyToManyOptInPlugin, ManyToManyOptInPreset, createUniqueLookupPlugin, PrimaryKeyOnlyPlugin, NoUniqueLookupPlugin, PrimaryKeyOnlyPreset, NoUniqueLookupPreset, MetaSchemaPlugin, MetaSchemaPreset, PgTypeMappingsPlugin, PgTypeMappingsPreset, PublicKeySignature, _cachedTablesMeta, _pgTypeToGqlType, _buildFieldMeta, } from 'graphile-misc-plugins';
8
8
  export type { UniqueLookupOptions, TypeMapping, PublicKeyChallengeConfig } from 'graphile-misc-plugins';
9
- export { VectorCodecPlugin, VectorCodecPreset, VectorSearchPlugin, createVectorSearchPlugin } from 'graphile-pgvector-plugin';
10
- export type { VectorSearchPluginOptions, VectorMetric } from 'graphile-pgvector-plugin';
11
- export { PgSearchPlugin, PgSearchPreset, createPgSearchPlugin, TsvectorCodecPlugin, TsvectorCodecPreset, } from 'graphile-search-plugin';
12
- export type { PgSearchPluginOptions } from 'graphile-search-plugin';
13
- export { Bm25CodecPlugin, Bm25CodecPreset, Bm25SearchPlugin, createBm25SearchPlugin, Bm25SearchPreset, } from 'graphile-pg-textsearch-plugin';
14
- export type { Bm25SearchPluginOptions, Bm25IndexInfo } from 'graphile-pg-textsearch-plugin';
9
+ export { createUnifiedSearchPlugin, UnifiedSearchPreset, TsvectorCodecPlugin, TsvectorCodecPreset, createTsvectorCodecPlugin, Bm25CodecPlugin, Bm25CodecPreset, bm25IndexStore, VectorCodecPlugin, VectorCodecPreset, createTsvectorAdapter, createBm25Adapter, createTrgmAdapter, createPgvectorAdapter, createMatchesOperatorFactory, createTrgmOperatorFactories, } from 'graphile-search';
10
+ export type { SearchAdapter, SearchableColumn, UnifiedSearchOptions, UnifiedSearchPresetOptions, TsvectorCodecPluginOptions, Bm25IndexInfo, TsvectorAdapterOptions, Bm25AdapterOptions, TrgmAdapterOptions, PgvectorAdapterOptions, } from 'graphile-search';
@@ -6,9 +6,13 @@
6
6
  */
7
7
  // Re-export all plugins from graphile-misc-plugins
8
8
  export { MinimalPreset, InflektPlugin, InflektPreset, CustomInflectorPlugin, CustomInflectorPreset, ConflictDetectorPlugin, ConflictDetectorPreset, InflectorLoggerPlugin, InflectorLoggerPreset, EnableAllFilterColumnsPlugin, EnableAllFilterColumnsPreset, ManyToManyOptInPlugin, ManyToManyOptInPreset, createUniqueLookupPlugin, PrimaryKeyOnlyPlugin, NoUniqueLookupPlugin, PrimaryKeyOnlyPreset, NoUniqueLookupPreset, MetaSchemaPlugin, MetaSchemaPreset, PgTypeMappingsPlugin, PgTypeMappingsPreset, PublicKeySignature, _cachedTablesMeta, _pgTypeToGqlType, _buildFieldMeta, } from 'graphile-misc-plugins';
9
- // pgvectorVector scalar + codec + auto-discovered search/filter/orderBy
10
- export { VectorCodecPlugin, VectorCodecPreset, VectorSearchPlugin, createVectorSearchPlugin } from 'graphile-pgvector-plugin';
11
- // Search plugin (stays in graphile-search-plugin, re-exported here for convenience)
12
- export { PgSearchPlugin, PgSearchPreset, createPgSearchPlugin, TsvectorCodecPlugin, TsvectorCodecPreset, } from 'graphile-search-plugin';
13
- // pg_textsearch BM25 ranked search (auto-discovers BM25 indexes)
14
- export { Bm25CodecPlugin, Bm25CodecPreset, Bm25SearchPlugin, createBm25SearchPlugin, Bm25SearchPreset, } from 'graphile-pg-textsearch-plugin';
9
+ // Unified search tsvector + BM25 + pg_trgm + pgvector behind a single adapter architecture
10
+ export {
11
+ // Core plugin + preset
12
+ createUnifiedSearchPlugin, UnifiedSearchPreset,
13
+ // Codec plugins (tree-shakable)
14
+ TsvectorCodecPlugin, TsvectorCodecPreset, createTsvectorCodecPlugin, Bm25CodecPlugin, Bm25CodecPreset, bm25IndexStore, VectorCodecPlugin, VectorCodecPreset,
15
+ // Adapters
16
+ createTsvectorAdapter, createBm25Adapter, createTrgmAdapter, createPgvectorAdapter,
17
+ // Operator factories for connection filter integration
18
+ createMatchesOperatorFactory, createTrgmOperatorFactories, } from 'graphile-search';
@@ -19,14 +19,21 @@ import type { GraphileConfig } from 'graphile-config';
19
19
  * - Upload plugin (file upload to S3/MinIO for image, upload, attachment domain columns)
20
20
  * - SQL expression validator (validates @sqlExpression columns in mutations)
21
21
  * - PG type mappings (maps custom types like email, url to GraphQL scalars)
22
- * - pgvector search (auto-discovers vector columns: condition fields, distance computed fields,
22
+ * - pgvector search (auto-discovers vector columns: filter fields, distance computed fields,
23
23
  * orderBy distance — zero config)
24
- * - pg_textsearch BM25 search (auto-discovers BM25 indexes: condition fields, score computed fields,
24
+ * - pg_textsearch BM25 search (auto-discovers BM25 indexes: filter fields, score computed fields,
25
25
  * orderBy score — zero config)
26
+ * - pg_trgm fuzzy matching (similarTo/wordSimilarTo on text columns, similarity score fields,
27
+ * orderBy similarity — zero config, typo-tolerant)
26
28
  *
27
- * DISABLED PLUGINS:
28
- * - PgConnectionArgFilterBackwardRelationsPlugin (relation filters bloat the API)
29
- * - PgConnectionArgFilterForwardRelationsPlugin (relation filters bloat the API)
29
+ * DEPRECATED:
30
+ * - The `condition` argument has been removed. All filtering lives under `filter`.
31
+ * PgConditionArgumentPlugin and PgConditionCustomFieldsPlugin are disabled.
32
+ *
33
+ * RELATION FILTERS:
34
+ * - Enabled via connectionFilterRelations: true
35
+ * - Forward: filter child by parent (e.g. allOrders(filter: { clientByClientId: { name: { startsWith: "Acme" } } }))
36
+ * - Backward: filter parent by children (e.g. allClients(filter: { ordersByClientId: { some: { total: { greaterThan: 1000 } } } }))
30
37
  *
31
38
  * USAGE:
32
39
  * ```typescript
@@ -1,10 +1,7 @@
1
- import { PostGraphileConnectionFilterPreset } from 'postgraphile-plugin-connection-filter';
1
+ import { ConnectionFilterPreset } from 'graphile-connection-filter';
2
2
  import { MinimalPreset, InflektPreset, ConflictDetectorPreset, InflectorLoggerPreset, NoUniqueLookupPreset, EnableAllFilterColumnsPreset, ManyToManyOptInPreset, MetaSchemaPreset, PgTypeMappingsPreset, } from 'graphile-misc-plugins';
3
- import { PgSearchPreset } from 'graphile-search-plugin';
4
- import { GraphilePostgisPreset } from 'graphile-postgis';
5
- import { VectorCodecPreset, createVectorSearchPlugin } from 'graphile-pgvector-plugin';
6
- import { Bm25SearchPreset } from 'graphile-pg-textsearch-plugin';
7
- import { PostgisConnectionFilterPreset } from 'graphile-plugin-connection-filter-postgis';
3
+ import { UnifiedSearchPreset, createMatchesOperatorFactory, createTrgmOperatorFactories } from 'graphile-search';
4
+ import { GraphilePostgisPreset, createPostgisOperatorFactory } from 'graphile-postgis';
8
5
  import { UploadPreset } from 'graphile-upload-plugin';
9
6
  import { SqlExpressionValidatorPreset } from 'graphile-sql-expression-validator';
10
7
  import { constructiveUploadFieldDefinitions } from '../upload-resolver';
@@ -28,14 +25,21 @@ import { constructiveUploadFieldDefinitions } from '../upload-resolver';
28
25
  * - Upload plugin (file upload to S3/MinIO for image, upload, attachment domain columns)
29
26
  * - SQL expression validator (validates @sqlExpression columns in mutations)
30
27
  * - PG type mappings (maps custom types like email, url to GraphQL scalars)
31
- * - pgvector search (auto-discovers vector columns: condition fields, distance computed fields,
28
+ * - pgvector search (auto-discovers vector columns: filter fields, distance computed fields,
32
29
  * orderBy distance — zero config)
33
- * - pg_textsearch BM25 search (auto-discovers BM25 indexes: condition fields, score computed fields,
30
+ * - pg_textsearch BM25 search (auto-discovers BM25 indexes: filter fields, score computed fields,
34
31
  * orderBy score — zero config)
32
+ * - pg_trgm fuzzy matching (similarTo/wordSimilarTo on text columns, similarity score fields,
33
+ * orderBy similarity — zero config, typo-tolerant)
35
34
  *
36
- * DISABLED PLUGINS:
37
- * - PgConnectionArgFilterBackwardRelationsPlugin (relation filters bloat the API)
38
- * - PgConnectionArgFilterForwardRelationsPlugin (relation filters bloat the API)
35
+ * DEPRECATED:
36
+ * - The `condition` argument has been removed. All filtering lives under `filter`.
37
+ * PgConditionArgumentPlugin and PgConditionCustomFieldsPlugin are disabled.
38
+ *
39
+ * RELATION FILTERS:
40
+ * - Enabled via connectionFilterRelations: true
41
+ * - Forward: filter child by parent (e.g. allOrders(filter: { clientByClientId: { name: { startsWith: "Acme" } } }))
42
+ * - Backward: filter parent by children (e.g. allClients(filter: { ordersByClientId: { some: { total: { greaterThan: 1000 } } } }))
39
43
  *
40
44
  * USAGE:
41
45
  * ```typescript
@@ -60,18 +64,12 @@ export const ConstructivePreset = {
60
64
  InflektPreset,
61
65
  InflectorLoggerPreset,
62
66
  NoUniqueLookupPreset,
63
- PostGraphileConnectionFilterPreset,
67
+ ConnectionFilterPreset({ connectionFilterRelations: true }),
64
68
  EnableAllFilterColumnsPreset,
65
69
  ManyToManyOptInPreset,
66
70
  MetaSchemaPreset,
67
- PgSearchPreset({ pgSearchPrefix: 'fullText' }),
71
+ UnifiedSearchPreset({ fullTextScalarName: 'FullText', tsConfig: 'english' }),
68
72
  GraphilePostgisPreset,
69
- VectorCodecPreset,
70
- {
71
- plugins: [createVectorSearchPlugin()],
72
- },
73
- Bm25SearchPreset(),
74
- PostgisConnectionFilterPreset,
75
73
  UploadPreset({
76
74
  uploadFieldDefinitions: constructiveUploadFieldDefinitions,
77
75
  maxFileSize: 10 * 1024 * 1024, // 10MB
@@ -80,52 +78,28 @@ export const ConstructivePreset = {
80
78
  PgTypeMappingsPreset,
81
79
  ],
82
80
  /**
83
- * Disable relation filter plugins from postgraphile-plugin-connection-filter.
84
- *
85
- * WHY THIS EXISTS:
86
- * The connection filter plugin includes PgConnectionArgFilterBackwardRelationsPlugin and
87
- * PgConnectionArgFilterForwardRelationsPlugin which add relation filter fields like
88
- * `apiExtensions`, `apiExtensionsExist`, `database`, `domains`, etc. to every filter type.
89
- *
90
- * The `connectionFilterRelations: false` schema option does NOT work - it's defined in the
91
- * plugin's TypeScript types but the actual code always includes the plugins regardless.
92
- * See: https://github.com/graphile-contrib/postgraphile-plugin-connection-filter/blob/master/src/index.ts
93
- * The comments `//if (connectionFilterRelations)` are just comments, not actual conditional logic.
94
- *
95
- * The entityBehavior approach (setting `pgCodecRelation: '-filterBy'`) also doesn't work
96
- * because the behavior system doesn't properly negate the plugin's default `filterBy` behavior.
97
- *
98
- * OUR FIX:
99
- * We use `disablePlugins` to directly disable the two relation filter plugins.
100
- * This is the most reliable way to prevent relation filter fields from being generated.
81
+ * Disable PostGraphile core's condition argument entirely.
82
+ * All filtering now lives under the `filter` argument via our v5-native
83
+ * graphile-connection-filter plugin. Search, BM25, pgvector, and PostGIS
84
+ * filter fields all hook into `isPgConnectionFilter` instead of `isPgCondition`.
101
85
  */
102
86
  disablePlugins: [
103
- 'PgConnectionArgFilterBackwardRelationsPlugin',
104
- 'PgConnectionArgFilterForwardRelationsPlugin',
87
+ 'PgConditionArgumentPlugin',
88
+ 'PgConditionCustomFieldsPlugin',
105
89
  ],
106
90
  /**
107
91
  * Connection Filter Plugin Configuration
108
92
  *
109
93
  * These options control what fields appear in the `filter` argument on connections.
110
- * We disable relation filters to keep the API surface clean and match our v4 behavior.
94
+ * Our v5-native graphile-connection-filter plugin controls relation filters via the
95
+ * `connectionFilterRelations` option passed to ConnectionFilterPreset().
111
96
  *
112
97
  * NOTE: By default, PostGraphile v5 only allows filtering on INDEXED columns.
113
98
  * We override this with EnableAllFilterColumnsPreset to allow filtering on ALL columns.
114
99
  * This gives developers flexibility but requires monitoring for slow queries on
115
- * non-indexed columns. See the plugin documentation for performance considerations.
116
- *
117
- * NOTE: Relation filtering is disabled via `disablePlugins` above.
118
- *
119
- * Documentation: https://github.com/graphile-contrib/postgraphile-plugin-connection-filter
100
+ * non-indexed columns.
120
101
  */
121
102
  schema: {
122
- /**
123
- * connectionFilterRelations: false
124
- * This option is defined in the plugin's types but does NOT actually work.
125
- * The relation filter plugins are disabled via `disablePlugins` above.
126
- * We keep this option set to false for documentation purposes.
127
- */
128
- connectionFilterRelations: false,
129
103
  /**
130
104
  * connectionFilterComputedColumns: false
131
105
  * Disables filtering on computed columns (functions that return a value for a row).
@@ -151,6 +125,20 @@ export const ConstructivePreset = {
151
125
  * Example: filter: { tags: { contains: ["important"] } }
152
126
  */
153
127
  connectionFilterArrays: true,
128
+ /**
129
+ * connectionFilterOperatorFactories
130
+ * Aggregates all satellite plugin operator factories into a single array.
131
+ * graphile-config replaces (not concatenates) arrays when merging presets,
132
+ * so we must explicitly collect all factories here at the top level.
133
+ */
134
+ connectionFilterOperatorFactories: [
135
+ createMatchesOperatorFactory('FullText', 'english'),
136
+ createTrgmOperatorFactories(),
137
+ createPostgisOperatorFactory(),
138
+ ],
139
+ // NOTE: The UnifiedSearchPreset also registers matches + trgm operator factories.
140
+ // graphile-config merges arrays from presets, so having them here as well is fine
141
+ // and ensures they're present even if the preset order changes.
154
142
  },
155
143
  };
156
144
  export default ConstructivePreset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "4.8.4",
3
+ "version": "4.9.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -45,12 +45,10 @@
45
45
  "graphile-build": "5.0.0-rc.4",
46
46
  "graphile-build-pg": "5.0.0-rc.5",
47
47
  "graphile-config": "1.0.0-rc.5",
48
+ "graphile-connection-filter": "^1.1.0",
48
49
  "graphile-misc-plugins": "^1.4.2",
49
- "graphile-pg-textsearch-plugin": "^1.5.3",
50
- "graphile-pgvector-plugin": "^1.7.0",
51
- "graphile-plugin-connection-filter-postgis": "^2.5.2",
52
- "graphile-postgis": "^2.5.2",
53
- "graphile-search-plugin": "^3.6.2",
50
+ "graphile-postgis": "^2.6.0",
51
+ "graphile-search": "^1.1.0",
54
52
  "graphile-sql-expression-validator": "^2.4.2",
55
53
  "graphile-upload-plugin": "^2.4.2",
56
54
  "graphql": "^16.13.0",
@@ -59,7 +57,6 @@
59
57
  "pg": "^8.19.0",
60
58
  "pg-sql2": "5.0.0-rc.4",
61
59
  "postgraphile": "5.0.0-rc.7",
62
- "postgraphile-plugin-connection-filter": "3.0.0-rc.1",
63
60
  "request-ip": "^3.3.0",
64
61
  "tamedevil": "0.1.0-rc.4"
65
62
  },
@@ -68,8 +65,10 @@
68
65
  "@types/express": "^5.0.6",
69
66
  "@types/pg": "^8.18.0",
70
67
  "@types/request-ip": "^0.0.41",
68
+ "graphile-test": "^4.5.2",
71
69
  "makage": "^0.1.10",
72
70
  "nodemon": "^3.1.14",
71
+ "pgsql-test": "^4.5.2",
73
72
  "ts-node": "^10.9.2"
74
73
  },
75
74
  "keywords": [
@@ -79,5 +78,5 @@
79
78
  "constructive",
80
79
  "graphql"
81
80
  ],
82
- "gitHead": "d0b204889409aa5ad8c11053c4c7f26611d7c99a"
81
+ "gitHead": "1ade5f10df8e38a5f87bbd2e2f7ec2ba97267079"
83
82
  }
@@ -6,9 +6,5 @@
6
6
  */
7
7
  export { MinimalPreset, InflektPlugin, InflektPreset, CustomInflectorPlugin, CustomInflectorPreset, ConflictDetectorPlugin, ConflictDetectorPreset, InflectorLoggerPlugin, InflectorLoggerPreset, EnableAllFilterColumnsPlugin, EnableAllFilterColumnsPreset, ManyToManyOptInPlugin, ManyToManyOptInPreset, createUniqueLookupPlugin, PrimaryKeyOnlyPlugin, NoUniqueLookupPlugin, PrimaryKeyOnlyPreset, NoUniqueLookupPreset, MetaSchemaPlugin, MetaSchemaPreset, PgTypeMappingsPlugin, PgTypeMappingsPreset, PublicKeySignature, _cachedTablesMeta, _pgTypeToGqlType, _buildFieldMeta, } from 'graphile-misc-plugins';
8
8
  export type { UniqueLookupOptions, TypeMapping, PublicKeyChallengeConfig } from 'graphile-misc-plugins';
9
- export { VectorCodecPlugin, VectorCodecPreset, VectorSearchPlugin, createVectorSearchPlugin } from 'graphile-pgvector-plugin';
10
- export type { VectorSearchPluginOptions, VectorMetric } from 'graphile-pgvector-plugin';
11
- export { PgSearchPlugin, PgSearchPreset, createPgSearchPlugin, TsvectorCodecPlugin, TsvectorCodecPreset, } from 'graphile-search-plugin';
12
- export type { PgSearchPluginOptions } from 'graphile-search-plugin';
13
- export { Bm25CodecPlugin, Bm25CodecPreset, Bm25SearchPlugin, createBm25SearchPlugin, Bm25SearchPreset, } from 'graphile-pg-textsearch-plugin';
14
- export type { Bm25SearchPluginOptions, Bm25IndexInfo } from 'graphile-pg-textsearch-plugin';
9
+ export { createUnifiedSearchPlugin, UnifiedSearchPreset, TsvectorCodecPlugin, TsvectorCodecPreset, createTsvectorCodecPlugin, Bm25CodecPlugin, Bm25CodecPreset, bm25IndexStore, VectorCodecPlugin, VectorCodecPreset, createTsvectorAdapter, createBm25Adapter, createTrgmAdapter, createPgvectorAdapter, createMatchesOperatorFactory, createTrgmOperatorFactories, } from 'graphile-search';
10
+ export type { SearchAdapter, SearchableColumn, UnifiedSearchOptions, UnifiedSearchPresetOptions, TsvectorCodecPluginOptions, Bm25IndexInfo, TsvectorAdapterOptions, Bm25AdapterOptions, TrgmAdapterOptions, PgvectorAdapterOptions, } from 'graphile-search';
package/plugins/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * Plugin implementations have been moved to graphile-misc-plugins.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.Bm25SearchPreset = exports.createBm25SearchPlugin = exports.Bm25SearchPlugin = exports.Bm25CodecPreset = exports.Bm25CodecPlugin = exports.TsvectorCodecPreset = exports.TsvectorCodecPlugin = exports.createPgSearchPlugin = exports.PgSearchPreset = exports.PgSearchPlugin = exports.createVectorSearchPlugin = exports.VectorSearchPlugin = exports.VectorCodecPreset = exports.VectorCodecPlugin = exports._buildFieldMeta = exports._pgTypeToGqlType = exports._cachedTablesMeta = exports.PublicKeySignature = exports.PgTypeMappingsPreset = exports.PgTypeMappingsPlugin = exports.MetaSchemaPreset = exports.MetaSchemaPlugin = exports.NoUniqueLookupPreset = exports.PrimaryKeyOnlyPreset = exports.NoUniqueLookupPlugin = exports.PrimaryKeyOnlyPlugin = exports.createUniqueLookupPlugin = exports.ManyToManyOptInPreset = exports.ManyToManyOptInPlugin = exports.EnableAllFilterColumnsPreset = exports.EnableAllFilterColumnsPlugin = exports.InflectorLoggerPreset = exports.InflectorLoggerPlugin = exports.ConflictDetectorPreset = exports.ConflictDetectorPlugin = exports.CustomInflectorPreset = exports.CustomInflectorPlugin = exports.InflektPreset = exports.InflektPlugin = exports.MinimalPreset = void 0;
9
+ exports.createTrgmOperatorFactories = exports.createMatchesOperatorFactory = exports.createPgvectorAdapter = exports.createTrgmAdapter = exports.createBm25Adapter = exports.createTsvectorAdapter = exports.VectorCodecPreset = exports.VectorCodecPlugin = exports.bm25IndexStore = exports.Bm25CodecPreset = exports.Bm25CodecPlugin = exports.createTsvectorCodecPlugin = exports.TsvectorCodecPreset = exports.TsvectorCodecPlugin = exports.UnifiedSearchPreset = exports.createUnifiedSearchPlugin = exports._buildFieldMeta = exports._pgTypeToGqlType = exports._cachedTablesMeta = exports.PublicKeySignature = exports.PgTypeMappingsPreset = exports.PgTypeMappingsPlugin = exports.MetaSchemaPreset = exports.MetaSchemaPlugin = exports.NoUniqueLookupPreset = exports.PrimaryKeyOnlyPreset = exports.NoUniqueLookupPlugin = exports.PrimaryKeyOnlyPlugin = exports.createUniqueLookupPlugin = exports.ManyToManyOptInPreset = exports.ManyToManyOptInPlugin = exports.EnableAllFilterColumnsPreset = exports.EnableAllFilterColumnsPlugin = exports.InflectorLoggerPreset = exports.InflectorLoggerPlugin = exports.ConflictDetectorPreset = exports.ConflictDetectorPlugin = exports.CustomInflectorPreset = exports.CustomInflectorPlugin = exports.InflektPreset = exports.InflektPlugin = exports.MinimalPreset = void 0;
10
10
  // Re-export all plugins from graphile-misc-plugins
11
11
  var graphile_misc_plugins_1 = require("graphile-misc-plugins");
12
12
  Object.defineProperty(exports, "MinimalPreset", { enumerable: true, get: function () { return graphile_misc_plugins_1.MinimalPreset; } });
@@ -35,23 +35,25 @@ Object.defineProperty(exports, "PublicKeySignature", { enumerable: true, get: fu
35
35
  Object.defineProperty(exports, "_cachedTablesMeta", { enumerable: true, get: function () { return graphile_misc_plugins_1._cachedTablesMeta; } });
36
36
  Object.defineProperty(exports, "_pgTypeToGqlType", { enumerable: true, get: function () { return graphile_misc_plugins_1._pgTypeToGqlType; } });
37
37
  Object.defineProperty(exports, "_buildFieldMeta", { enumerable: true, get: function () { return graphile_misc_plugins_1._buildFieldMeta; } });
38
- // pgvectorVector scalar + codec + auto-discovered search/filter/orderBy
39
- var graphile_pgvector_plugin_1 = require("graphile-pgvector-plugin");
40
- Object.defineProperty(exports, "VectorCodecPlugin", { enumerable: true, get: function () { return graphile_pgvector_plugin_1.VectorCodecPlugin; } });
41
- Object.defineProperty(exports, "VectorCodecPreset", { enumerable: true, get: function () { return graphile_pgvector_plugin_1.VectorCodecPreset; } });
42
- Object.defineProperty(exports, "VectorSearchPlugin", { enumerable: true, get: function () { return graphile_pgvector_plugin_1.VectorSearchPlugin; } });
43
- Object.defineProperty(exports, "createVectorSearchPlugin", { enumerable: true, get: function () { return graphile_pgvector_plugin_1.createVectorSearchPlugin; } });
44
- // Search plugin (stays in graphile-search-plugin, re-exported here for convenience)
45
- var graphile_search_plugin_1 = require("graphile-search-plugin");
46
- Object.defineProperty(exports, "PgSearchPlugin", { enumerable: true, get: function () { return graphile_search_plugin_1.PgSearchPlugin; } });
47
- Object.defineProperty(exports, "PgSearchPreset", { enumerable: true, get: function () { return graphile_search_plugin_1.PgSearchPreset; } });
48
- Object.defineProperty(exports, "createPgSearchPlugin", { enumerable: true, get: function () { return graphile_search_plugin_1.createPgSearchPlugin; } });
49
- Object.defineProperty(exports, "TsvectorCodecPlugin", { enumerable: true, get: function () { return graphile_search_plugin_1.TsvectorCodecPlugin; } });
50
- Object.defineProperty(exports, "TsvectorCodecPreset", { enumerable: true, get: function () { return graphile_search_plugin_1.TsvectorCodecPreset; } });
51
- // pg_textsearch BM25 ranked search (auto-discovers BM25 indexes)
52
- var graphile_pg_textsearch_plugin_1 = require("graphile-pg-textsearch-plugin");
53
- Object.defineProperty(exports, "Bm25CodecPlugin", { enumerable: true, get: function () { return graphile_pg_textsearch_plugin_1.Bm25CodecPlugin; } });
54
- Object.defineProperty(exports, "Bm25CodecPreset", { enumerable: true, get: function () { return graphile_pg_textsearch_plugin_1.Bm25CodecPreset; } });
55
- Object.defineProperty(exports, "Bm25SearchPlugin", { enumerable: true, get: function () { return graphile_pg_textsearch_plugin_1.Bm25SearchPlugin; } });
56
- Object.defineProperty(exports, "createBm25SearchPlugin", { enumerable: true, get: function () { return graphile_pg_textsearch_plugin_1.createBm25SearchPlugin; } });
57
- Object.defineProperty(exports, "Bm25SearchPreset", { enumerable: true, get: function () { return graphile_pg_textsearch_plugin_1.Bm25SearchPreset; } });
38
+ // Unified search tsvector + BM25 + pg_trgm + pgvector behind a single adapter architecture
39
+ var graphile_search_1 = require("graphile-search");
40
+ // Core plugin + preset
41
+ Object.defineProperty(exports, "createUnifiedSearchPlugin", { enumerable: true, get: function () { return graphile_search_1.createUnifiedSearchPlugin; } });
42
+ Object.defineProperty(exports, "UnifiedSearchPreset", { enumerable: true, get: function () { return graphile_search_1.UnifiedSearchPreset; } });
43
+ // Codec plugins (tree-shakable)
44
+ Object.defineProperty(exports, "TsvectorCodecPlugin", { enumerable: true, get: function () { return graphile_search_1.TsvectorCodecPlugin; } });
45
+ Object.defineProperty(exports, "TsvectorCodecPreset", { enumerable: true, get: function () { return graphile_search_1.TsvectorCodecPreset; } });
46
+ Object.defineProperty(exports, "createTsvectorCodecPlugin", { enumerable: true, get: function () { return graphile_search_1.createTsvectorCodecPlugin; } });
47
+ Object.defineProperty(exports, "Bm25CodecPlugin", { enumerable: true, get: function () { return graphile_search_1.Bm25CodecPlugin; } });
48
+ Object.defineProperty(exports, "Bm25CodecPreset", { enumerable: true, get: function () { return graphile_search_1.Bm25CodecPreset; } });
49
+ Object.defineProperty(exports, "bm25IndexStore", { enumerable: true, get: function () { return graphile_search_1.bm25IndexStore; } });
50
+ Object.defineProperty(exports, "VectorCodecPlugin", { enumerable: true, get: function () { return graphile_search_1.VectorCodecPlugin; } });
51
+ Object.defineProperty(exports, "VectorCodecPreset", { enumerable: true, get: function () { return graphile_search_1.VectorCodecPreset; } });
52
+ // Adapters
53
+ Object.defineProperty(exports, "createTsvectorAdapter", { enumerable: true, get: function () { return graphile_search_1.createTsvectorAdapter; } });
54
+ Object.defineProperty(exports, "createBm25Adapter", { enumerable: true, get: function () { return graphile_search_1.createBm25Adapter; } });
55
+ Object.defineProperty(exports, "createTrgmAdapter", { enumerable: true, get: function () { return graphile_search_1.createTrgmAdapter; } });
56
+ Object.defineProperty(exports, "createPgvectorAdapter", { enumerable: true, get: function () { return graphile_search_1.createPgvectorAdapter; } });
57
+ // Operator factories for connection filter integration
58
+ Object.defineProperty(exports, "createMatchesOperatorFactory", { enumerable: true, get: function () { return graphile_search_1.createMatchesOperatorFactory; } });
59
+ Object.defineProperty(exports, "createTrgmOperatorFactories", { enumerable: true, get: function () { return graphile_search_1.createTrgmOperatorFactories; } });
@@ -19,14 +19,21 @@ import type { GraphileConfig } from 'graphile-config';
19
19
  * - Upload plugin (file upload to S3/MinIO for image, upload, attachment domain columns)
20
20
  * - SQL expression validator (validates @sqlExpression columns in mutations)
21
21
  * - PG type mappings (maps custom types like email, url to GraphQL scalars)
22
- * - pgvector search (auto-discovers vector columns: condition fields, distance computed fields,
22
+ * - pgvector search (auto-discovers vector columns: filter fields, distance computed fields,
23
23
  * orderBy distance — zero config)
24
- * - pg_textsearch BM25 search (auto-discovers BM25 indexes: condition fields, score computed fields,
24
+ * - pg_textsearch BM25 search (auto-discovers BM25 indexes: filter fields, score computed fields,
25
25
  * orderBy score — zero config)
26
+ * - pg_trgm fuzzy matching (similarTo/wordSimilarTo on text columns, similarity score fields,
27
+ * orderBy similarity — zero config, typo-tolerant)
26
28
  *
27
- * DISABLED PLUGINS:
28
- * - PgConnectionArgFilterBackwardRelationsPlugin (relation filters bloat the API)
29
- * - PgConnectionArgFilterForwardRelationsPlugin (relation filters bloat the API)
29
+ * DEPRECATED:
30
+ * - The `condition` argument has been removed. All filtering lives under `filter`.
31
+ * PgConditionArgumentPlugin and PgConditionCustomFieldsPlugin are disabled.
32
+ *
33
+ * RELATION FILTERS:
34
+ * - Enabled via connectionFilterRelations: true
35
+ * - Forward: filter child by parent (e.g. allOrders(filter: { clientByClientId: { name: { startsWith: "Acme" } } }))
36
+ * - Backward: filter parent by children (e.g. allClients(filter: { ordersByClientId: { some: { total: { greaterThan: 1000 } } } }))
30
37
  *
31
38
  * USAGE:
32
39
  * ```typescript
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConstructivePreset = void 0;
4
- const postgraphile_plugin_connection_filter_1 = require("postgraphile-plugin-connection-filter");
4
+ const graphile_connection_filter_1 = require("graphile-connection-filter");
5
5
  const graphile_misc_plugins_1 = require("graphile-misc-plugins");
6
- const graphile_search_plugin_1 = require("graphile-search-plugin");
6
+ const graphile_search_1 = require("graphile-search");
7
7
  const graphile_postgis_1 = require("graphile-postgis");
8
- const graphile_pgvector_plugin_1 = require("graphile-pgvector-plugin");
9
- const graphile_pg_textsearch_plugin_1 = require("graphile-pg-textsearch-plugin");
10
- const graphile_plugin_connection_filter_postgis_1 = require("graphile-plugin-connection-filter-postgis");
11
8
  const graphile_upload_plugin_1 = require("graphile-upload-plugin");
12
9
  const graphile_sql_expression_validator_1 = require("graphile-sql-expression-validator");
13
10
  const upload_resolver_1 = require("../upload-resolver");
@@ -31,14 +28,21 @@ const upload_resolver_1 = require("../upload-resolver");
31
28
  * - Upload plugin (file upload to S3/MinIO for image, upload, attachment domain columns)
32
29
  * - SQL expression validator (validates @sqlExpression columns in mutations)
33
30
  * - PG type mappings (maps custom types like email, url to GraphQL scalars)
34
- * - pgvector search (auto-discovers vector columns: condition fields, distance computed fields,
31
+ * - pgvector search (auto-discovers vector columns: filter fields, distance computed fields,
35
32
  * orderBy distance — zero config)
36
- * - pg_textsearch BM25 search (auto-discovers BM25 indexes: condition fields, score computed fields,
33
+ * - pg_textsearch BM25 search (auto-discovers BM25 indexes: filter fields, score computed fields,
37
34
  * orderBy score — zero config)
35
+ * - pg_trgm fuzzy matching (similarTo/wordSimilarTo on text columns, similarity score fields,
36
+ * orderBy similarity — zero config, typo-tolerant)
38
37
  *
39
- * DISABLED PLUGINS:
40
- * - PgConnectionArgFilterBackwardRelationsPlugin (relation filters bloat the API)
41
- * - PgConnectionArgFilterForwardRelationsPlugin (relation filters bloat the API)
38
+ * DEPRECATED:
39
+ * - The `condition` argument has been removed. All filtering lives under `filter`.
40
+ * PgConditionArgumentPlugin and PgConditionCustomFieldsPlugin are disabled.
41
+ *
42
+ * RELATION FILTERS:
43
+ * - Enabled via connectionFilterRelations: true
44
+ * - Forward: filter child by parent (e.g. allOrders(filter: { clientByClientId: { name: { startsWith: "Acme" } } }))
45
+ * - Backward: filter parent by children (e.g. allClients(filter: { ordersByClientId: { some: { total: { greaterThan: 1000 } } } }))
42
46
  *
43
47
  * USAGE:
44
48
  * ```typescript
@@ -63,18 +67,12 @@ exports.ConstructivePreset = {
63
67
  graphile_misc_plugins_1.InflektPreset,
64
68
  graphile_misc_plugins_1.InflectorLoggerPreset,
65
69
  graphile_misc_plugins_1.NoUniqueLookupPreset,
66
- postgraphile_plugin_connection_filter_1.PostGraphileConnectionFilterPreset,
70
+ (0, graphile_connection_filter_1.ConnectionFilterPreset)({ connectionFilterRelations: true }),
67
71
  graphile_misc_plugins_1.EnableAllFilterColumnsPreset,
68
72
  graphile_misc_plugins_1.ManyToManyOptInPreset,
69
73
  graphile_misc_plugins_1.MetaSchemaPreset,
70
- (0, graphile_search_plugin_1.PgSearchPreset)({ pgSearchPrefix: 'fullText' }),
74
+ (0, graphile_search_1.UnifiedSearchPreset)({ fullTextScalarName: 'FullText', tsConfig: 'english' }),
71
75
  graphile_postgis_1.GraphilePostgisPreset,
72
- graphile_pgvector_plugin_1.VectorCodecPreset,
73
- {
74
- plugins: [(0, graphile_pgvector_plugin_1.createVectorSearchPlugin)()],
75
- },
76
- (0, graphile_pg_textsearch_plugin_1.Bm25SearchPreset)(),
77
- graphile_plugin_connection_filter_postgis_1.PostgisConnectionFilterPreset,
78
76
  (0, graphile_upload_plugin_1.UploadPreset)({
79
77
  uploadFieldDefinitions: upload_resolver_1.constructiveUploadFieldDefinitions,
80
78
  maxFileSize: 10 * 1024 * 1024, // 10MB
@@ -83,52 +81,28 @@ exports.ConstructivePreset = {
83
81
  graphile_misc_plugins_1.PgTypeMappingsPreset,
84
82
  ],
85
83
  /**
86
- * Disable relation filter plugins from postgraphile-plugin-connection-filter.
87
- *
88
- * WHY THIS EXISTS:
89
- * The connection filter plugin includes PgConnectionArgFilterBackwardRelationsPlugin and
90
- * PgConnectionArgFilterForwardRelationsPlugin which add relation filter fields like
91
- * `apiExtensions`, `apiExtensionsExist`, `database`, `domains`, etc. to every filter type.
92
- *
93
- * The `connectionFilterRelations: false` schema option does NOT work - it's defined in the
94
- * plugin's TypeScript types but the actual code always includes the plugins regardless.
95
- * See: https://github.com/graphile-contrib/postgraphile-plugin-connection-filter/blob/master/src/index.ts
96
- * The comments `//if (connectionFilterRelations)` are just comments, not actual conditional logic.
97
- *
98
- * The entityBehavior approach (setting `pgCodecRelation: '-filterBy'`) also doesn't work
99
- * because the behavior system doesn't properly negate the plugin's default `filterBy` behavior.
100
- *
101
- * OUR FIX:
102
- * We use `disablePlugins` to directly disable the two relation filter plugins.
103
- * This is the most reliable way to prevent relation filter fields from being generated.
84
+ * Disable PostGraphile core's condition argument entirely.
85
+ * All filtering now lives under the `filter` argument via our v5-native
86
+ * graphile-connection-filter plugin. Search, BM25, pgvector, and PostGIS
87
+ * filter fields all hook into `isPgConnectionFilter` instead of `isPgCondition`.
104
88
  */
105
89
  disablePlugins: [
106
- 'PgConnectionArgFilterBackwardRelationsPlugin',
107
- 'PgConnectionArgFilterForwardRelationsPlugin',
90
+ 'PgConditionArgumentPlugin',
91
+ 'PgConditionCustomFieldsPlugin',
108
92
  ],
109
93
  /**
110
94
  * Connection Filter Plugin Configuration
111
95
  *
112
96
  * These options control what fields appear in the `filter` argument on connections.
113
- * We disable relation filters to keep the API surface clean and match our v4 behavior.
97
+ * Our v5-native graphile-connection-filter plugin controls relation filters via the
98
+ * `connectionFilterRelations` option passed to ConnectionFilterPreset().
114
99
  *
115
100
  * NOTE: By default, PostGraphile v5 only allows filtering on INDEXED columns.
116
101
  * We override this with EnableAllFilterColumnsPreset to allow filtering on ALL columns.
117
102
  * This gives developers flexibility but requires monitoring for slow queries on
118
- * non-indexed columns. See the plugin documentation for performance considerations.
119
- *
120
- * NOTE: Relation filtering is disabled via `disablePlugins` above.
121
- *
122
- * Documentation: https://github.com/graphile-contrib/postgraphile-plugin-connection-filter
103
+ * non-indexed columns.
123
104
  */
124
105
  schema: {
125
- /**
126
- * connectionFilterRelations: false
127
- * This option is defined in the plugin's types but does NOT actually work.
128
- * The relation filter plugins are disabled via `disablePlugins` above.
129
- * We keep this option set to false for documentation purposes.
130
- */
131
- connectionFilterRelations: false,
132
106
  /**
133
107
  * connectionFilterComputedColumns: false
134
108
  * Disables filtering on computed columns (functions that return a value for a row).
@@ -154,6 +128,20 @@ exports.ConstructivePreset = {
154
128
  * Example: filter: { tags: { contains: ["important"] } }
155
129
  */
156
130
  connectionFilterArrays: true,
131
+ /**
132
+ * connectionFilterOperatorFactories
133
+ * Aggregates all satellite plugin operator factories into a single array.
134
+ * graphile-config replaces (not concatenates) arrays when merging presets,
135
+ * so we must explicitly collect all factories here at the top level.
136
+ */
137
+ connectionFilterOperatorFactories: [
138
+ (0, graphile_search_1.createMatchesOperatorFactory)('FullText', 'english'),
139
+ (0, graphile_search_1.createTrgmOperatorFactories)(),
140
+ (0, graphile_postgis_1.createPostgisOperatorFactory)(),
141
+ ],
142
+ // NOTE: The UnifiedSearchPreset also registers matches + trgm operator factories.
143
+ // graphile-config merges arrays from presets, so having them here as well is fine
144
+ // and ensures they're present even if the preset order changes.
157
145
  },
158
146
  };
159
147
  exports.default = exports.ConstructivePreset;