Skip to content

Commit 98e38e2

Browse files
committed
2 parents 88051f4 + e34c1cb commit 98e38e2

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

src/PgConnectionArgFilterPlugin.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,31 +375,40 @@ module.exports = function PgConnectionArgFilterPlugin(
375375
}, {})
376376
: {};
377377

378-
const valFromInput = (input, inputResolver, pgType) =>
378+
const valFromInput = (
379+
input,
380+
inputResolver,
381+
pgType,
382+
pgTypeModifier
383+
) =>
379384
Array.isArray(input)
380385
? pgType.isPgArray
381386
? sql.query`${gql2pg(
382387
(inputResolver && inputResolver(input)) || input,
383-
pgType
388+
pgType,
389+
pgTypeModifier
384390
)}`
385391
: sql.query`(${sql.join(
386392
input.map(
387393
i =>
388394
sql.query`${gql2pg(
389395
(inputResolver && inputResolver(i)) || i,
390-
pgType
396+
pgType,
397+
pgTypeModifier
391398
)}`
392399
),
393400
","
394401
)})`
395402
: pgType.isPgArray
396403
? sql.query`${gql2pg(
397404
(inputResolver && inputResolver(input)) || input,
398-
pgType.arrayItemType
405+
pgType.arrayItemType,
406+
pgTypeModifier
399407
)}`
400408
: sql.query`${gql2pg(
401409
(inputResolver && inputResolver(input)) || input,
402-
pgType
410+
pgType,
411+
pgTypeModifier
403412
)}`;
404413

405414
function resolveWhereComparison(fieldName, operatorName, input) {
@@ -414,7 +423,12 @@ module.exports = function PgConnectionArgFilterPlugin(
414423
)}`;
415424
const val = operator.options.resolveWithRawInput
416425
? input
417-
: valFromInput(input, inputResolver, attr.type);
426+
: valFromInput(
427+
input,
428+
inputResolver,
429+
attr.type,
430+
attr.typeModifier
431+
);
418432
return operator.resolveWhereClause(
419433
identifier,
420434
val,
@@ -435,7 +449,7 @@ module.exports = function PgConnectionArgFilterPlugin(
435449
)}(${queryBuilder.getTableAlias()})`;
436450
const val = operator.options.resolveWithRawInput
437451
? input
438-
: valFromInput(input, inputResolver, procReturnType);
452+
: valFromInput(input, inputResolver, procReturnType, null);
439453
return operator.resolveWhereClause(
440454
identifier,
441455
val,

0 commit comments

Comments
 (0)