@constructive-io/graphql-codegen 4.21.0 → 4.21.2

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.
@@ -1365,18 +1365,15 @@ function collectFilterExtraInputTypes(tables, typeRegistry) {
1365
1365
  !filterType.inputFields) {
1366
1366
  continue;
1367
1367
  }
1368
- const tableFieldNames = new Set(table.fields
1369
- .filter((f) => !(0, utils_1.isRelationField)(f.name, table))
1370
- .map((f) => f.name));
1371
1368
  for (const field of filterType.inputFields) {
1372
- // Skip standard column-derived fields and logical operators
1373
- if (tableFieldNames.has(field.name))
1374
- continue;
1369
+ // Skip logical operators (and/or/not reference the table's own filter type)
1375
1370
  if (['and', 'or', 'not'].includes(field.name))
1376
1371
  continue;
1377
- // Collect the base type name of this extra field
1372
+ // Collect any filter type that isn't already generated as a base scalar filter
1373
+ // This catches both plugin-injected fields (bm25Body, tsvTsv) AND regular columns
1374
+ // whose custom scalar types have their own filter types (e.g., ConstructiveInternalTypeEmailFilter)
1378
1375
  const baseName = (0, type_resolver_1.getTypeBaseName)(field.type);
1379
- if (baseName && !scalars_1.SCALAR_NAMES.has(baseName)) {
1376
+ if (baseName && !scalars_1.SCALAR_NAMES.has(baseName) && !scalars_1.BASE_FILTER_TYPE_NAMES.has(baseName)) {
1380
1377
  extraTypes.add(baseName);
1381
1378
  }
1382
1379
  }
@@ -13,7 +13,7 @@
13
13
  import * as t from '@babel/types';
14
14
  import { pluralize } from 'inflekt';
15
15
  import { addJSDocComment, addLineComment, generateCode } from '../babel-ast';
16
- import { SCALAR_NAMES, scalarToFilterType, scalarToTsType } from '../scalars';
16
+ import { BASE_FILTER_TYPE_NAMES, SCALAR_NAMES, scalarToFilterType, scalarToTsType } from '../scalars';
17
17
  import { getTypeBaseName } from '../type-resolver';
18
18
  import { getCreateInputTypeName, getConditionTypeName, getFilterTypeName, getGeneratedFileHeader, getOrderByTypeName, getPatchTypeName, getPrimaryKeyInfo, getTableNames, isRelationField, lcFirst, stripSmartComments, } from '../utils';
19
19
  // ============================================================================
@@ -1327,18 +1327,15 @@ function collectFilterExtraInputTypes(tables, typeRegistry) {
1327
1327
  !filterType.inputFields) {
1328
1328
  continue;
1329
1329
  }
1330
- const tableFieldNames = new Set(table.fields
1331
- .filter((f) => !isRelationField(f.name, table))
1332
- .map((f) => f.name));
1333
1330
  for (const field of filterType.inputFields) {
1334
- // Skip standard column-derived fields and logical operators
1335
- if (tableFieldNames.has(field.name))
1336
- continue;
1331
+ // Skip logical operators (and/or/not reference the table's own filter type)
1337
1332
  if (['and', 'or', 'not'].includes(field.name))
1338
1333
  continue;
1339
- // Collect the base type name of this extra field
1334
+ // Collect any filter type that isn't already generated as a base scalar filter
1335
+ // This catches both plugin-injected fields (bm25Body, tsvTsv) AND regular columns
1336
+ // whose custom scalar types have their own filter types (e.g., ConstructiveInternalTypeEmailFilter)
1340
1337
  const baseName = getTypeBaseName(field.type);
1341
- if (baseName && !SCALAR_NAMES.has(baseName)) {
1338
+ if (baseName && !SCALAR_NAMES.has(baseName) && !BASE_FILTER_TYPE_NAMES.has(baseName)) {
1342
1339
  extraTypes.add(baseName);
1343
1340
  }
1344
1341
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-codegen",
3
- "version": "4.21.0",
3
+ "version": "4.21.2",
4
4
  "description": "GraphQL SDK generator for Constructive databases with React Query hooks",
5
5
  "keywords": [
6
6
  "graphql",
@@ -56,15 +56,15 @@
56
56
  "@0no-co/graphql.web": "^1.1.2",
57
57
  "@babel/generator": "^7.29.1",
58
58
  "@babel/types": "^7.29.0",
59
- "@constructive-io/graphql-query": "^3.9.0",
59
+ "@constructive-io/graphql-query": "^3.9.1",
60
60
  "@constructive-io/graphql-types": "^3.3.4",
61
61
  "@inquirerer/utils": "^3.3.4",
62
- "@pgpmjs/core": "^6.8.1",
62
+ "@pgpmjs/core": "^6.8.2",
63
63
  "ajv": "^8.18.0",
64
64
  "deepmerge": "^4.3.1",
65
65
  "find-and-require-package-json": "^0.9.1",
66
66
  "gql-ast": "^3.3.3",
67
- "graphile-schema": "^1.8.1",
67
+ "graphile-schema": "^1.8.2",
68
68
  "graphql": "16.13.0",
69
69
  "inflekt": "^0.3.3",
70
70
  "inquirerer": "^4.7.0",
@@ -73,8 +73,8 @@
73
73
  "oxfmt": "^0.40.0",
74
74
  "pg-cache": "^3.3.4",
75
75
  "pg-env": "^1.7.3",
76
- "pgsql-client": "^3.5.9",
77
- "pgsql-seed": "^2.5.9",
76
+ "pgsql-client": "^3.5.10",
77
+ "pgsql-seed": "^2.5.10",
78
78
  "undici": "^7.24.3"
79
79
  },
80
80
  "peerDependencies": {
@@ -101,5 +101,5 @@
101
101
  "tsx": "^4.21.0",
102
102
  "typescript": "^5.9.3"
103
103
  },
104
- "gitHead": "7b5d57e1d1aa274a2914cec3240a902d2b1020c6"
104
+ "gitHead": "bfc62d3bf8b8374dea67536cfea9d16cbe0575ac"
105
105
  }