@@ -29,6 +29,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
2929 connectionFilterAllowedOperators,
3030 connectionFilterOperatorNames,
3131 } ,
32+ EXPORTABLE ,
3233 } = build ;
3334
3435 const {
@@ -389,7 +390,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
389390 const hstoreOperators : { [ fieldName : string ] : OperatorSpec } = {
390391 contains : {
391392 description : "Contains the specified KeyValueHash." ,
392- resolve : ( i , v ) => sql `${ i } @> ${ v } ` ,
393+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } @> ${ v } ` , [ sql ] ) ,
393394 } ,
394395 containsKey : {
395396 description : "Contains the specified key." ,
@@ -412,13 +413,13 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
412413 } ,
413414 containedBy : {
414415 description : "Contained by the specified KeyValueHash." ,
415- resolve : ( i , v ) => sql `${ i } <@ ${ v } ` ,
416+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } <@ ${ v } ` , [ sql ] ) ,
416417 } ,
417418 } ;
418419 const jsonbOperators : { [ fieldName : string ] : OperatorSpec } = {
419420 contains : {
420421 description : "Contains the specified JSON." ,
421- resolve : ( i , v ) => sql `${ i } @> ${ v } ` ,
422+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } @> ${ v } ` , [ sql ] ) ,
422423 } ,
423424 containsKey : {
424425 description : "Contains the specified key." ,
@@ -439,31 +440,31 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
439440 } ,
440441 containedBy : {
441442 description : "Contained by the specified JSON." ,
442- resolve : ( i , v ) => sql `${ i } <@ ${ v } ` ,
443+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } <@ ${ v } ` , [ sql ] ) ,
443444 } ,
444445 } ;
445446 const inetOperators : { [ fieldName : string ] : OperatorSpec } = {
446447 contains : {
447448 description : "Contains the specified internet address." ,
448- resolve : ( i , v ) => sql `${ i } >> ${ v } ` ,
449+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } >> ${ v } ` , [ sql ] ) ,
449450 } ,
450451 containsOrEqualTo : {
451452 description : "Contains or equal to the specified internet address." ,
452- resolve : ( i , v ) => sql `${ i } >>= ${ v } ` ,
453+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } >>= ${ v } ` , [ sql ] ) ,
453454 } ,
454455 containedBy : {
455456 description : "Contained by the specified internet address." ,
456- resolve : ( i , v ) => sql `${ i } << ${ v } ` ,
457+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } << ${ v } ` , [ sql ] ) ,
457458 } ,
458459 containedByOrEqualTo : {
459460 description :
460461 "Contained by or equal to the specified internet address." ,
461- resolve : ( i , v ) => sql `${ i } <<= ${ v } ` ,
462+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } <<= ${ v } ` , [ sql ] ) ,
462463 } ,
463464 containsOrContainedBy : {
464465 description :
465466 "Contains or contained by the specified internet address." ,
466- resolve : ( i , v ) => sql `${ i } && ${ v } ` ,
467+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } && ${ v } ` , [ sql ] ) ,
467468 } ,
468469 } ;
469470
@@ -579,7 +580,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
579580 ...sortOperators ,
580581 contains : {
581582 description : "Contains the specified range." ,
582- resolve : ( i , v ) => sql `${ i } @> ${ v } ` ,
583+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } @> ${ v } ` , [ sql ] ) ,
583584 } ,
584585 containsElement : {
585586 description : "Contains the specified value." ,
@@ -596,31 +597,31 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
596597 } ,
597598 containedBy : {
598599 description : "Contained by the specified range." ,
599- resolve : ( i , v ) => sql `${ i } <@ ${ v } ` ,
600+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } <@ ${ v } ` , [ sql ] ) ,
600601 } ,
601602 overlaps : {
602603 description : "Overlaps the specified range." ,
603- resolve : ( i , v ) => sql `${ i } && ${ v } ` ,
604+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } && ${ v } ` , [ sql ] ) ,
604605 } ,
605606 strictlyLeftOf : {
606607 description : "Strictly left of the specified range." ,
607- resolve : ( i , v ) => sql `${ i } << ${ v } ` ,
608+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } << ${ v } ` , [ sql ] ) ,
608609 } ,
609610 strictlyRightOf : {
610611 description : "Strictly right of the specified range." ,
611- resolve : ( i , v ) => sql `${ i } >> ${ v } ` ,
612+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } >> ${ v } ` , [ sql ] ) ,
612613 } ,
613614 notExtendsRightOf : {
614615 description : "Does not extend right of the specified range." ,
615- resolve : ( i , v ) => sql `${ i } &< ${ v } ` ,
616+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } &< ${ v } ` , [ sql ] ) ,
616617 } ,
617618 notExtendsLeftOf : {
618619 description : "Does not extend left of the specified range." ,
619- resolve : ( i , v ) => sql `${ i } &> ${ v } ` ,
620+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } &> ${ v } ` , [ sql ] ) ,
620621 } ,
621622 adjacentTo : {
622623 description : "Adjacent to the specified range." ,
623- resolve : ( i , v ) => sql `${ i } -|- ${ v } ` ,
624+ resolve : EXPORTABLE ( ( sql ) => ( i , v ) => sql `${ i } -|- ${ v } ` , [ sql ] ) ,
624625 } ,
625626 } ;
626627
@@ -716,7 +717,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
716717 let rangeLike = true ;
717718 let enumLike = true ;
718719 for ( const codec of pgCodecs ) {
719- let underlyingType = codec . domainOfCodec ?? codec ;
720+ const underlyingType = codec . domainOfCodec ?? codec ;
720721 if ( ! underlyingType . arrayOfCodec ) {
721722 arrayLike = false ;
722723 }
@@ -928,7 +929,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
928929 if ( ! codecGraphQLType ) {
929930 return memo ;
930931 }
931- let type = resolveType
932+ const type = resolveType
932933 ? resolveType ( codecGraphQLType )
933934 : codecGraphQLType ;
934935
@@ -1046,7 +1047,7 @@ export function makeApplyPlanFromOperatorSpec(
10461047 return ( $where , fieldArgs ) => {
10471048 if ( ! $where . extensions ?. pgFilterAttribute ) {
10481049 throw new Error (
1049- `Planning error: expected 'pgFilterAttribute' to be present on the \ $where plan's extensions; your extensions to \`postgraphile-plugin-connection-filter\` does not implement the required interfaces.`
1050+ `Planning error: expected 'pgFilterAttribute' to be present on the $where plan's extensions; your extensions to \`postgraphile-plugin-connection-filter\` does not implement the required interfaces.`
10501051 ) ;
10511052 }
10521053 const $input = fieldArgs . getRaw ( ) ;
0 commit comments