2
2
// SPDX-License-Identifier: GPL-3.0
3
3
4
4
// 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' ;
12
7
import { GraphQLInputType , GraphQLOutputType , GraphQLNamedType } from 'graphql' ;
13
8
import { makeAssertAllowed } from './utils' ;
14
9
@@ -28,7 +23,7 @@ export const ArgFilterPlugin: GraphileConfig.Plugin = {
28
23
init : {
29
24
after : [ 'PgCodecs' ] ,
30
25
callback ( _ , build ) {
31
- const { EXPORTABLE , inflection, sql } = build ;
26
+ const { inflection } = build ;
32
27
33
28
// Create filter type for all column-having codecs
34
29
for ( const pgCodec of build . allPgCodecs ) {
@@ -115,7 +110,7 @@ export const ArgFilterPlugin: GraphileConfig.Plugin = {
115
110
applyPlan : EXPORTABLE (
116
111
( PgCondition , assertAllowed , attributeCodec ) =>
117
112
function (
118
- _ : any ,
113
+ _ : Step ,
119
114
$connection : ConnectionStep < any , any , any , any /*PgSelectStep*/ > ,
120
115
fieldArg : FieldArg
121
116
) {
@@ -141,10 +136,10 @@ export const ArgFilterPlugin: GraphileConfig.Plugin = {
141
136
: {
142
137
applyPlan : EXPORTABLE (
143
138
( PgCondition , assertAllowed , attributeCodec ) =>
144
- function ( _ : any , $pgSelect : PgSelectStep , fieldArg : FieldArg ) {
139
+ function ( _ : Step , $pgSelect : PgSelectStep , fieldArg : FieldArg ) {
145
140
fieldArg . apply (
146
141
$pgSelect ,
147
- ( queryBuilder : PgSelectQueryBuilder , value : any /* object | null*/ ) => {
142
+ ( queryBuilder : PgSelectQueryBuilder , value : object | null ) => {
148
143
assertAllowed ( value , 'object' ) ;
149
144
if ( value === null ) return ;
150
145
const condition = new PgCondition ( queryBuilder ) ;
0 commit comments