22// SPDX-License-Identifier: GPL-3.0
33
44// refer https://github.com/graphile-contrib/postgraphile-plugin-connection-filter/blob/375f125/src/PgConnectionArgFilterPlugin.ts
5- import {
6- type PgSelectStep ,
7- type PgCodec ,
8- type PgSelectQueryBuilder ,
9- // PgCondition,
10- } from '@dataplan/pg' ;
11- import type { ConnectionStep , FieldArg } from 'grafast' ;
5+ import { type PgSelectStep , type PgCodec , type PgSelectQueryBuilder } from '@dataplan/pg' ;
6+ import type { ConnectionStep , FieldArg , Step } from 'grafast' ;
127import { GraphQLInputType , GraphQLOutputType , GraphQLNamedType } from 'graphql' ;
138import { makeAssertAllowed } from './utils' ;
149
@@ -28,7 +23,7 @@ export const ArgFilterPlugin: GraphileConfig.Plugin = {
2823 init : {
2924 after : [ 'PgCodecs' ] ,
3025 callback ( _ , build ) {
31- const { EXPORTABLE , inflection, sql } = build ;
26+ const { inflection } = build ;
3227
3328 // Create filter type for all column-having codecs
3429 for ( const pgCodec of build . allPgCodecs ) {
@@ -115,7 +110,7 @@ export const ArgFilterPlugin: GraphileConfig.Plugin = {
115110 applyPlan : EXPORTABLE (
116111 ( PgCondition , assertAllowed , attributeCodec ) =>
117112 function (
118- _ : any ,
113+ _ : Step ,
119114 $connection : ConnectionStep < any , any , any , any /*PgSelectStep*/ > ,
120115 fieldArg : FieldArg
121116 ) {
@@ -141,10 +136,10 @@ export const ArgFilterPlugin: GraphileConfig.Plugin = {
141136 : {
142137 applyPlan : EXPORTABLE (
143138 ( PgCondition , assertAllowed , attributeCodec ) =>
144- function ( _ : any , $pgSelect : PgSelectStep , fieldArg : FieldArg ) {
139+ function ( _ : Step , $pgSelect : PgSelectStep , fieldArg : FieldArg ) {
145140 fieldArg . apply (
146141 $pgSelect ,
147- ( queryBuilder : PgSelectQueryBuilder , value : any /* object | null*/ ) => {
142+ ( queryBuilder : PgSelectQueryBuilder , value : object | null ) => {
148143 assertAllowed ( value , 'object' ) ;
149144 if ( value === null ) return ;
150145 const condition = new PgCondition ( queryBuilder ) ;
0 commit comments