graphile-connection-filter 1.4.1 → 1.5.1

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.
package/esm/index.d.ts CHANGED
@@ -48,6 +48,7 @@
48
48
  * }
49
49
  * ```
50
50
  */
51
+ import './augmentations';
51
52
  export { ConnectionFilterPreset } from './preset';
52
53
  export { ConnectionFilterInflectionPlugin, ConnectionFilterTypesPlugin, ConnectionFilterArgPlugin, ConnectionFilterAttributesPlugin, ConnectionFilterOperatorsPlugin, ConnectionFilterCustomOperatorsPlugin, ConnectionFilterLogicalOperatorsPlugin, ConnectionFilterComputedAttributesPlugin, ConnectionFilterForwardRelationsPlugin, ConnectionFilterBackwardRelationsPlugin, makeApplyFromOperatorSpec, } from './plugins';
53
54
  export type { ConnectionFilterOperatorSpec, ConnectionFilterOperatorRegistration, ConnectionFilterOperatorFactory, ConnectionFilterOptions, ConnectionFilterOperatorsDigest, PgConnectionFilterOperatorsScope, } from './types';
package/esm/index.js CHANGED
@@ -48,6 +48,12 @@
48
48
  * }
49
49
  * ```
50
50
  */
51
+ // Load the global type augmentations (inflection methods, build/scope
52
+ // properties) so that downstream satellite plugins which `import
53
+ // 'graphile-connection-filter'` pick up the `filterType`/`filterManyType`/
54
+ // etc. type extensions without having to reach into the package's internal
55
+ // file layout.
56
+ import './augmentations';
51
57
  export { ConnectionFilterPreset } from './preset';
52
58
  // Re-export all plugins for granular use
53
59
  export { ConnectionFilterInflectionPlugin, ConnectionFilterTypesPlugin, ConnectionFilterArgPlugin, ConnectionFilterAttributesPlugin, ConnectionFilterOperatorsPlugin, ConnectionFilterCustomOperatorsPlugin, ConnectionFilterLogicalOperatorsPlugin, ConnectionFilterComputedAttributesPlugin, ConnectionFilterForwardRelationsPlugin, ConnectionFilterBackwardRelationsPlugin, makeApplyFromOperatorSpec, } from './plugins';
@@ -3,9 +3,10 @@ import type { GraphileConfig } from 'graphile-config';
3
3
  /**
4
4
  * ConnectionFilterArgPlugin
5
5
  *
6
- * Adds the filter argument (configurable name, default 'where') to connection
7
- * and simple collection fields. Uses `applyPlan` to create a PgCondition that
8
- * child filter fields can add WHERE clauses to.
6
+ * Adds the `where` argument (name configurable via
7
+ * `connectionFilterArgumentName`, default `'where'`) to connection and
8
+ * simple collection fields. Uses `applyPlan` to create a PgCondition
9
+ * that child filter fields can add WHERE clauses to.
9
10
  *
10
11
  * This runs before PgConnectionArgOrderByPlugin so that filters are applied
11
12
  * before ordering (important for e.g. full-text search rank ordering).
@@ -4,9 +4,10 @@ const version = '1.0.0';
4
4
  /**
5
5
  * ConnectionFilterArgPlugin
6
6
  *
7
- * Adds the filter argument (configurable name, default 'where') to connection
8
- * and simple collection fields. Uses `applyPlan` to create a PgCondition that
9
- * child filter fields can add WHERE clauses to.
7
+ * Adds the `where` argument (name configurable via
8
+ * `connectionFilterArgumentName`, default `'where'`) to connection and
9
+ * simple collection fields. Uses `applyPlan` to create a PgCondition
10
+ * that child filter fields can add WHERE clauses to.
10
11
  *
11
12
  * This runs before PgConnectionArgOrderByPlugin so that filters are applied
12
13
  * before ordering (important for e.g. full-text search rank ordering).
@@ -14,7 +15,7 @@ const version = '1.0.0';
14
15
  export const ConnectionFilterArgPlugin = {
15
16
  name: 'ConnectionFilterArgPlugin',
16
17
  version,
17
- description: 'Adds the filter argument to connection and list fields',
18
+ description: 'Adds the `where` argument to connection and list fields',
18
19
  before: ['PgConnectionArgOrderByPlugin'],
19
20
  schema: {
20
21
  hooks: {
@@ -59,7 +60,7 @@ export const ConnectionFilterArgPlugin = {
59
60
  applyPlan: EXPORTABLE((PgCondition, isEmpty, attributeCodec) => function (_, $connection, fieldArg) {
60
61
  const $pgSelect = $connection.getSubplan();
61
62
  fieldArg.apply($pgSelect, (queryBuilder, value) => {
62
- // If filter is null/undefined or empty {}, treat as "no filter" — skip
63
+ // If where is null/undefined or empty {}, treat as "no filter" — skip
63
64
  if (value == null || isEmpty(value))
64
65
  return;
65
66
  const condition = new PgCondition(queryBuilder);
@@ -75,7 +76,7 @@ export const ConnectionFilterArgPlugin = {
75
76
  : {
76
77
  applyPlan: EXPORTABLE((PgCondition, isEmpty, attributeCodec) => function (_, $pgSelect, fieldArg) {
77
78
  fieldArg.apply($pgSelect, (queryBuilder, value) => {
78
- // If filter is null/undefined or empty {}, treat as "no filter" — skip
79
+ // If where is null/undefined or empty {}, treat as "no filter" — skip
79
80
  if (value == null || isEmpty(value))
80
81
  return;
81
82
  const condition = new PgCondition(queryBuilder);
@@ -89,7 +90,7 @@ export const ConnectionFilterArgPlugin = {
89
90
  }, [PgCondition, isEmpty, attributeCodec]),
90
91
  }),
91
92
  },
92
- }, `Adding connection filter '${argName}' arg to field '${fieldName}' of '${Self.name}'`);
93
+ }, `Adding connection where arg '${argName}' to field '${fieldName}' of '${Self.name}'`);
93
94
  },
94
95
  },
95
96
  },
@@ -54,11 +54,11 @@ export const ConnectionFilterAttributesPlugin = {
54
54
  return;
55
55
  }
56
56
  if (isEmpty(value)) {
57
- throw Object.assign(new Error('Empty objects are forbidden in filter argument input.'), {});
57
+ throw Object.assign(new Error('Empty objects are forbidden in where argument input.'), {});
58
58
  }
59
59
  if (!connectionFilterAllowNullInput &&
60
60
  value === null) {
61
- throw Object.assign(new Error('Null literals are forbidden in filter argument input.'), {});
61
+ throw Object.assign(new Error('Null literals are forbidden in where argument input.'), {});
62
62
  }
63
63
  const condition = new PgCondition(queryBuilder);
64
64
  condition.extensions.pgFilterAttribute = colSpec;
@@ -8,7 +8,7 @@ import type { GraphileConfig } from 'graphile-config';
8
8
  *
9
9
  * For unique backward relations (one-to-one), a single filter field is added:
10
10
  * ```graphql
11
- * allClients(filter: {
11
+ * allClients(where: {
12
12
  * profileByClientId: { bio: { includes: "engineer" } }
13
13
  * }) { ... }
14
14
  * ```
@@ -16,7 +16,7 @@ import type { GraphileConfig } from 'graphile-config';
16
16
  * For non-unique backward relations (one-to-many), a "many" filter type is added
17
17
  * with `some`, `every`, and `none` sub-fields:
18
18
  * ```graphql
19
- * allClients(filter: {
19
+ * allClients(where: {
20
20
  * ordersByClientId: { some: { total: { greaterThan: 1000 } } }
21
21
  * }) { ... }
22
22
  * ```
@@ -9,7 +9,7 @@ const version = '1.0.0';
9
9
  *
10
10
  * For unique backward relations (one-to-one), a single filter field is added:
11
11
  * ```graphql
12
- * allClients(filter: {
12
+ * allClients(where: {
13
13
  * profileByClientId: { bio: { includes: "engineer" } }
14
14
  * }) { ... }
15
15
  * ```
@@ -17,7 +17,7 @@ const version = '1.0.0';
17
17
  * For non-unique backward relations (one-to-many), a "many" filter type is added
18
18
  * with `some`, `every`, and `none` sub-fields:
19
19
  * ```graphql
20
- * allClients(filter: {
20
+ * allClients(where: {
21
21
  * ordersByClientId: { some: { total: { greaterThan: 1000 } } }
22
22
  * }) { ... }
23
23
  * ```
@@ -11,7 +11,7 @@ import type { GraphileConfig } from 'graphile-config';
11
11
  *
12
12
  * This plugin adds a `fullName` filter field to `PersonFilter`, typed as `StringFilter`,
13
13
  * allowing queries like:
14
- * { people(filter: { fullName: { startsWith: "John" } }) { ... } }
14
+ * { people(where: { fullName: { startsWith: "John" } }) { ... } }
15
15
  *
16
16
  * Controlled by the `connectionFilterComputedColumns` schema option (default: true).
17
17
  * Requires the `filterBy` behavior on the pgResource to be enabled.
@@ -12,7 +12,7 @@ const version = '1.0.0';
12
12
  *
13
13
  * This plugin adds a `fullName` filter field to `PersonFilter`, typed as `StringFilter`,
14
14
  * allowing queries like:
15
- * { people(filter: { fullName: { startsWith: "John" } }) { ... } }
15
+ * { people(where: { fullName: { startsWith: "John" } }) { ... } }
16
16
  *
17
17
  * Controlled by the `connectionFilterComputedColumns` schema option (default: true).
18
18
  * Requires the `filterBy` behavior on the pgResource to be enabled.
@@ -11,7 +11,7 @@ import type { GraphileConfig } from 'graphile-config';
11
11
  * allowing queries like:
12
12
  *
13
13
  * ```graphql
14
- * allOrders(filter: {
14
+ * allOrders(where: {
15
15
  * clientByClientId: { name: { startsWith: "Acme" } }
16
16
  * }) { ... }
17
17
  * ```
@@ -12,7 +12,7 @@ const version = '1.0.0';
12
12
  * allowing queries like:
13
13
  *
14
14
  * ```graphql
15
- * allOrders(filter: {
15
+ * allOrders(where: {
16
16
  * clientByClientId: { name: { startsWith: "Acme" } }
17
17
  * }) { ... }
18
18
  * ```
@@ -38,7 +38,7 @@ export function makeApplyFromOperatorSpec(build, _typeName, fieldName, spec, _ty
38
38
  return;
39
39
  }
40
40
  if (!connectionFilterAllowNullInput && value === null) {
41
- throw Object.assign(new Error('Null literals are forbidden in filter argument input.'), {});
41
+ throw Object.assign(new Error('Null literals are forbidden in where argument input.'), {});
42
42
  }
43
43
  // Optionally transform the input value
44
44
  const resolvedInput = resolveInput ? resolveInput(value) : value;
package/esm/utils.js CHANGED
@@ -88,9 +88,9 @@ export function makeAssertAllowed(build) {
88
88
  const { options, EXPORTABLE } = build;
89
89
  const { connectionFilterAllowNullInput, } = options;
90
90
  const assertAllowed = EXPORTABLE((connectionFilterAllowNullInput, isEmpty) => function (value, mode) {
91
- // Reject empty objects in nested filter contexts (and/or/not, relation filters)
91
+ // Reject empty objects in nested where contexts (and/or/not, relation filters)
92
92
  if (mode === 'object' && isEmpty(value)) {
93
- throw Object.assign(new Error('Empty objects are forbidden in filter argument input.'), {});
93
+ throw Object.assign(new Error('Empty objects are forbidden in where argument input.'), {});
94
94
  }
95
95
  if (mode === 'list') {
96
96
  const arr = value;
@@ -98,14 +98,14 @@ export function makeAssertAllowed(build) {
98
98
  const l = arr.length;
99
99
  for (let i = 0; i < l; i++) {
100
100
  if (isEmpty(arr[i])) {
101
- throw Object.assign(new Error('Empty objects are forbidden in filter argument input.'), {});
101
+ throw Object.assign(new Error('Empty objects are forbidden in where argument input.'), {});
102
102
  }
103
103
  }
104
104
  }
105
105
  }
106
106
  // For all modes, check null
107
107
  if (!connectionFilterAllowNullInput && value === null) {
108
- throw Object.assign(new Error('Null literals are forbidden in filter argument input.'), {});
108
+ throw Object.assign(new Error('Null literals are forbidden in where argument input.'), {});
109
109
  }
110
110
  }, [connectionFilterAllowNullInput, isEmpty]);
111
111
  return assertAllowed;
package/index.d.ts CHANGED
@@ -48,6 +48,7 @@
48
48
  * }
49
49
  * ```
50
50
  */
51
+ import './augmentations';
51
52
  export { ConnectionFilterPreset } from './preset';
52
53
  export { ConnectionFilterInflectionPlugin, ConnectionFilterTypesPlugin, ConnectionFilterArgPlugin, ConnectionFilterAttributesPlugin, ConnectionFilterOperatorsPlugin, ConnectionFilterCustomOperatorsPlugin, ConnectionFilterLogicalOperatorsPlugin, ConnectionFilterComputedAttributesPlugin, ConnectionFilterForwardRelationsPlugin, ConnectionFilterBackwardRelationsPlugin, makeApplyFromOperatorSpec, } from './plugins';
53
54
  export type { ConnectionFilterOperatorSpec, ConnectionFilterOperatorRegistration, ConnectionFilterOperatorFactory, ConnectionFilterOptions, ConnectionFilterOperatorsDigest, PgConnectionFilterOperatorsScope, } from './types';
package/index.js CHANGED
@@ -51,6 +51,12 @@
51
51
  */
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.getComputedAttributeResources = exports.isComputedScalarAttributeResource = exports.getQueryBuilder = exports.makeAssertAllowed = exports.isEmpty = exports.$$filters = exports.makeApplyFromOperatorSpec = exports.ConnectionFilterBackwardRelationsPlugin = exports.ConnectionFilterForwardRelationsPlugin = exports.ConnectionFilterComputedAttributesPlugin = exports.ConnectionFilterLogicalOperatorsPlugin = exports.ConnectionFilterCustomOperatorsPlugin = exports.ConnectionFilterOperatorsPlugin = exports.ConnectionFilterAttributesPlugin = exports.ConnectionFilterArgPlugin = exports.ConnectionFilterTypesPlugin = exports.ConnectionFilterInflectionPlugin = exports.ConnectionFilterPreset = void 0;
54
+ // Load the global type augmentations (inflection methods, build/scope
55
+ // properties) so that downstream satellite plugins which `import
56
+ // 'graphile-connection-filter'` pick up the `filterType`/`filterManyType`/
57
+ // etc. type extensions without having to reach into the package's internal
58
+ // file layout.
59
+ require("./augmentations");
54
60
  var preset_1 = require("./preset");
55
61
  Object.defineProperty(exports, "ConnectionFilterPreset", { enumerable: true, get: function () { return preset_1.ConnectionFilterPreset; } });
56
62
  // Re-export all plugins for granular use
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-connection-filter",
3
- "version": "1.4.1",
3
+ "version": "1.5.1",
4
4
  "description": "PostGraphile v5 native connection filter plugin - adds advanced filtering to connections",
5
5
  "author": "Constructive <developers@constructive.io>",
6
6
  "homepage": "https://github.com/constructive-io/constructive",
@@ -41,9 +41,9 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^22.19.11",
44
- "graphile-test": "^4.8.1",
44
+ "graphile-test": "^4.9.0",
45
45
  "makage": "^0.3.0",
46
- "pgsql-test": "^4.8.1"
46
+ "pgsql-test": "^4.9.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@dataplan/pg": "1.0.0",
@@ -54,5 +54,5 @@
54
54
  "pg-sql2": "5.0.0",
55
55
  "postgraphile": "5.0.0"
56
56
  },
57
- "gitHead": "79cd3e66871804a22c672c7ca2fa5e2105d4b368"
57
+ "gitHead": "b421fce9f2ac3ce7cd276e5f724ded99db085066"
58
58
  }
@@ -3,9 +3,10 @@ import type { GraphileConfig } from 'graphile-config';
3
3
  /**
4
4
  * ConnectionFilterArgPlugin
5
5
  *
6
- * Adds the filter argument (configurable name, default 'where') to connection
7
- * and simple collection fields. Uses `applyPlan` to create a PgCondition that
8
- * child filter fields can add WHERE clauses to.
6
+ * Adds the `where` argument (name configurable via
7
+ * `connectionFilterArgumentName`, default `'where'`) to connection and
8
+ * simple collection fields. Uses `applyPlan` to create a PgCondition
9
+ * that child filter fields can add WHERE clauses to.
9
10
  *
10
11
  * This runs before PgConnectionArgOrderByPlugin so that filters are applied
11
12
  * before ordering (important for e.g. full-text search rank ordering).
@@ -7,9 +7,10 @@ const version = '1.0.0';
7
7
  /**
8
8
  * ConnectionFilterArgPlugin
9
9
  *
10
- * Adds the filter argument (configurable name, default 'where') to connection
11
- * and simple collection fields. Uses `applyPlan` to create a PgCondition that
12
- * child filter fields can add WHERE clauses to.
10
+ * Adds the `where` argument (name configurable via
11
+ * `connectionFilterArgumentName`, default `'where'`) to connection and
12
+ * simple collection fields. Uses `applyPlan` to create a PgCondition
13
+ * that child filter fields can add WHERE clauses to.
13
14
  *
14
15
  * This runs before PgConnectionArgOrderByPlugin so that filters are applied
15
16
  * before ordering (important for e.g. full-text search rank ordering).
@@ -17,7 +18,7 @@ const version = '1.0.0';
17
18
  exports.ConnectionFilterArgPlugin = {
18
19
  name: 'ConnectionFilterArgPlugin',
19
20
  version,
20
- description: 'Adds the filter argument to connection and list fields',
21
+ description: 'Adds the `where` argument to connection and list fields',
21
22
  before: ['PgConnectionArgOrderByPlugin'],
22
23
  schema: {
23
24
  hooks: {
@@ -62,7 +63,7 @@ exports.ConnectionFilterArgPlugin = {
62
63
  applyPlan: EXPORTABLE((PgCondition, isEmpty, attributeCodec) => function (_, $connection, fieldArg) {
63
64
  const $pgSelect = $connection.getSubplan();
64
65
  fieldArg.apply($pgSelect, (queryBuilder, value) => {
65
- // If filter is null/undefined or empty {}, treat as "no filter" — skip
66
+ // If where is null/undefined or empty {}, treat as "no filter" — skip
66
67
  if (value == null || isEmpty(value))
67
68
  return;
68
69
  const condition = new PgCondition(queryBuilder);
@@ -78,7 +79,7 @@ exports.ConnectionFilterArgPlugin = {
78
79
  : {
79
80
  applyPlan: EXPORTABLE((PgCondition, isEmpty, attributeCodec) => function (_, $pgSelect, fieldArg) {
80
81
  fieldArg.apply($pgSelect, (queryBuilder, value) => {
81
- // If filter is null/undefined or empty {}, treat as "no filter" — skip
82
+ // If where is null/undefined or empty {}, treat as "no filter" — skip
82
83
  if (value == null || isEmpty(value))
83
84
  return;
84
85
  const condition = new PgCondition(queryBuilder);
@@ -92,7 +93,7 @@ exports.ConnectionFilterArgPlugin = {
92
93
  }, [PgCondition, utils_1.isEmpty, attributeCodec]),
93
94
  }),
94
95
  },
95
- }, `Adding connection filter '${argName}' arg to field '${fieldName}' of '${Self.name}'`);
96
+ }, `Adding connection where arg '${argName}' to field '${fieldName}' of '${Self.name}'`);
96
97
  },
97
98
  },
98
99
  },
@@ -57,11 +57,11 @@ exports.ConnectionFilterAttributesPlugin = {
57
57
  return;
58
58
  }
59
59
  if (isEmpty(value)) {
60
- throw Object.assign(new Error('Empty objects are forbidden in filter argument input.'), {});
60
+ throw Object.assign(new Error('Empty objects are forbidden in where argument input.'), {});
61
61
  }
62
62
  if (!connectionFilterAllowNullInput &&
63
63
  value === null) {
64
- throw Object.assign(new Error('Null literals are forbidden in filter argument input.'), {});
64
+ throw Object.assign(new Error('Null literals are forbidden in where argument input.'), {});
65
65
  }
66
66
  const condition = new PgCondition(queryBuilder);
67
67
  condition.extensions.pgFilterAttribute = colSpec;
@@ -8,7 +8,7 @@ import type { GraphileConfig } from 'graphile-config';
8
8
  *
9
9
  * For unique backward relations (one-to-one), a single filter field is added:
10
10
  * ```graphql
11
- * allClients(filter: {
11
+ * allClients(where: {
12
12
  * profileByClientId: { bio: { includes: "engineer" } }
13
13
  * }) { ... }
14
14
  * ```
@@ -16,7 +16,7 @@ import type { GraphileConfig } from 'graphile-config';
16
16
  * For non-unique backward relations (one-to-many), a "many" filter type is added
17
17
  * with `some`, `every`, and `none` sub-fields:
18
18
  * ```graphql
19
- * allClients(filter: {
19
+ * allClients(where: {
20
20
  * ordersByClientId: { some: { total: { greaterThan: 1000 } } }
21
21
  * }) { ... }
22
22
  * ```
@@ -12,7 +12,7 @@ const version = '1.0.0';
12
12
  *
13
13
  * For unique backward relations (one-to-one), a single filter field is added:
14
14
  * ```graphql
15
- * allClients(filter: {
15
+ * allClients(where: {
16
16
  * profileByClientId: { bio: { includes: "engineer" } }
17
17
  * }) { ... }
18
18
  * ```
@@ -20,7 +20,7 @@ const version = '1.0.0';
20
20
  * For non-unique backward relations (one-to-many), a "many" filter type is added
21
21
  * with `some`, `every`, and `none` sub-fields:
22
22
  * ```graphql
23
- * allClients(filter: {
23
+ * allClients(where: {
24
24
  * ordersByClientId: { some: { total: { greaterThan: 1000 } } }
25
25
  * }) { ... }
26
26
  * ```
@@ -11,7 +11,7 @@ import type { GraphileConfig } from 'graphile-config';
11
11
  *
12
12
  * This plugin adds a `fullName` filter field to `PersonFilter`, typed as `StringFilter`,
13
13
  * allowing queries like:
14
- * { people(filter: { fullName: { startsWith: "John" } }) { ... } }
14
+ * { people(where: { fullName: { startsWith: "John" } }) { ... } }
15
15
  *
16
16
  * Controlled by the `connectionFilterComputedColumns` schema option (default: true).
17
17
  * Requires the `filterBy` behavior on the pgResource to be enabled.
@@ -15,7 +15,7 @@ const version = '1.0.0';
15
15
  *
16
16
  * This plugin adds a `fullName` filter field to `PersonFilter`, typed as `StringFilter`,
17
17
  * allowing queries like:
18
- * { people(filter: { fullName: { startsWith: "John" } }) { ... } }
18
+ * { people(where: { fullName: { startsWith: "John" } }) { ... } }
19
19
  *
20
20
  * Controlled by the `connectionFilterComputedColumns` schema option (default: true).
21
21
  * Requires the `filterBy` behavior on the pgResource to be enabled.
@@ -11,7 +11,7 @@ import type { GraphileConfig } from 'graphile-config';
11
11
  * allowing queries like:
12
12
  *
13
13
  * ```graphql
14
- * allOrders(filter: {
14
+ * allOrders(where: {
15
15
  * clientByClientId: { name: { startsWith: "Acme" } }
16
16
  * }) { ... }
17
17
  * ```
@@ -15,7 +15,7 @@ const version = '1.0.0';
15
15
  * allowing queries like:
16
16
  *
17
17
  * ```graphql
18
- * allOrders(filter: {
18
+ * allOrders(where: {
19
19
  * clientByClientId: { name: { startsWith: "Acme" } }
20
20
  * }) { ... }
21
21
  * ```
@@ -41,7 +41,7 @@ function makeApplyFromOperatorSpec(build, _typeName, fieldName, spec, _type) {
41
41
  return;
42
42
  }
43
43
  if (!connectionFilterAllowNullInput && value === null) {
44
- throw Object.assign(new Error('Null literals are forbidden in filter argument input.'), {});
44
+ throw Object.assign(new Error('Null literals are forbidden in where argument input.'), {});
45
45
  }
46
46
  // Optionally transform the input value
47
47
  const resolvedInput = resolveInput ? resolveInput(value) : value;
package/utils.js CHANGED
@@ -95,9 +95,9 @@ function makeAssertAllowed(build) {
95
95
  const { options, EXPORTABLE } = build;
96
96
  const { connectionFilterAllowNullInput, } = options;
97
97
  const assertAllowed = EXPORTABLE((connectionFilterAllowNullInput, isEmpty) => function (value, mode) {
98
- // Reject empty objects in nested filter contexts (and/or/not, relation filters)
98
+ // Reject empty objects in nested where contexts (and/or/not, relation filters)
99
99
  if (mode === 'object' && isEmpty(value)) {
100
- throw Object.assign(new Error('Empty objects are forbidden in filter argument input.'), {});
100
+ throw Object.assign(new Error('Empty objects are forbidden in where argument input.'), {});
101
101
  }
102
102
  if (mode === 'list') {
103
103
  const arr = value;
@@ -105,14 +105,14 @@ function makeAssertAllowed(build) {
105
105
  const l = arr.length;
106
106
  for (let i = 0; i < l; i++) {
107
107
  if (isEmpty(arr[i])) {
108
- throw Object.assign(new Error('Empty objects are forbidden in filter argument input.'), {});
108
+ throw Object.assign(new Error('Empty objects are forbidden in where argument input.'), {});
109
109
  }
110
110
  }
111
111
  }
112
112
  }
113
113
  // For all modes, check null
114
114
  if (!connectionFilterAllowNullInput && value === null) {
115
- throw Object.assign(new Error('Null literals are forbidden in filter argument input.'), {});
115
+ throw Object.assign(new Error('Null literals are forbidden in where argument input.'), {});
116
116
  }
117
117
  }, [connectionFilterAllowNullInput, isEmpty]);
118
118
  return assertAllowed;