Skip to content

Commit 0283d9d

Browse files
committed
Expose fieldName to filter resolve callbacks
1 parent 32af157 commit 0283d9d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/PgConnectionArgFilterOperatorsPlugin.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,11 @@ export interface OperatorSpec {
12131213
sqlIdentifier: SQL,
12141214
sqlValue: SQL,
12151215
$input: InputStep,
1216-
$placeholderable: PlaceholderableStep
1216+
$placeholderable: PlaceholderableStep,
1217+
details: {
1218+
// TODO: move $input and $placeholderable here too
1219+
fieldName: string;
1220+
}
12171221
) => SQL;
12181222
resolveType?: (type: GraphQLInputType) => GraphQLInputType;
12191223
}
@@ -1265,6 +1269,7 @@ export function makeApplyPlanFromOperatorSpec(
12651269
return EXPORTABLE(
12661270
(
12671271
connectionFilterAllowNullInput,
1272+
fieldName,
12681273
lambda,
12691274
resolve,
12701275
resolveInput,
@@ -1335,11 +1340,14 @@ export function makeApplyPlanFromOperatorSpec(
13351340
*/
13361341
$where.placeholder($resolvedInput, inputCodec);
13371342

1338-
const fragment = resolve(sqlIdentifier, sqlValue, $input, $where);
1343+
const fragment = resolve(sqlIdentifier, sqlValue, $input, $where, {
1344+
fieldName,
1345+
});
13391346
$where.where(fragment);
13401347
},
13411348
[
13421349
connectionFilterAllowNullInput,
1350+
fieldName,
13431351
lambda,
13441352
resolve,
13451353
resolveInput,

0 commit comments

Comments
 (0)