@@ -7,17 +7,18 @@ const version = '1.0.0';
77/**
88 * ConnectionFilterArgPlugin
99 *
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.
1314 *
1415 * This runs before PgConnectionArgOrderByPlugin so that filters are applied
1516 * before ordering (important for e.g. full-text search rank ordering).
1617 */
1718export const ConnectionFilterArgPlugin : GraphileConfig . Plugin = {
1819 name : 'ConnectionFilterArgPlugin' ,
1920 version,
20- description : 'Adds the filter argument to connection and list fields' ,
21+ description : 'Adds the `where` argument to connection and list fields' ,
2122 before : [ 'PgConnectionArgOrderByPlugin' ] ,
2223
2324 schema : {
@@ -100,7 +101,7 @@ export const ConnectionFilterArgPlugin: GraphileConfig.Plugin = {
100101 fieldArg . apply (
101102 $pgSelect ,
102103 ( queryBuilder : any , value : any ) => {
103- // If filter is null/undefined or empty {}, treat as "no filter" — skip
104+ // If where is null/undefined or empty {}, treat as "no filter" — skip
104105 if ( value == null || isEmpty ( value ) ) return ;
105106 const condition = new PgCondition ( queryBuilder ) ;
106107 if ( attributeCodec ) {
@@ -126,7 +127,7 @@ export const ConnectionFilterArgPlugin: GraphileConfig.Plugin = {
126127 fieldArg . apply (
127128 $pgSelect ,
128129 ( queryBuilder : any , value : any ) => {
129- // If filter is null/undefined or empty {}, treat as "no filter" — skip
130+ // If where is null/undefined or empty {}, treat as "no filter" — skip
130131 if ( value == null || isEmpty ( value ) ) return ;
131132 const condition = new PgCondition ( queryBuilder ) ;
132133 if ( attributeCodec ) {
@@ -143,7 +144,7 @@ export const ConnectionFilterArgPlugin: GraphileConfig.Plugin = {
143144 } ) ,
144145 } ,
145146 } ,
146- `Adding connection filter '${ argName } ' arg to field '${ fieldName } ' of '${ Self . name } '`
147+ `Adding connection where arg '${ argName } ' to field '${ fieldName } ' of '${ Self . name } '`
147148 ) ;
148149 } ,
149150 } ,
0 commit comments