Skip to content

Commit bbaa4ce

Browse files
committed
Lint autofixes
1 parent 7c28725 commit bbaa4ce

2 files changed

Lines changed: 26 additions & 27 deletions

File tree

src/PgConnectionArgFilterForwardRelationsPlugin.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const PgConnectionArgFilterForwardRelationsPlugin: GraphileConfig.Plugin
3838
graphql: { GraphQLBoolean },
3939
sql,
4040
options: { pgIgnoreReferentialIntegrity },
41+
EXPORTABLE,
4142
} = build;
4243
const {
4344
fieldWithHooks,
@@ -112,9 +113,8 @@ export const PgConnectionArgFilterForwardRelationsPlugin: GraphileConfig.Plugin
112113
() => ({
113114
description: `Filter by the object’s \`${fieldName}\` relation.`,
114115
type: ForeignTableFilterType,
115-
applyPlan: build.EXPORTABLE(
116-
() =>
117-
function ($where: PgConditionStep<any>, fieldArgs) {
116+
applyPlan: EXPORTABLE(
117+
(foreignTable, foreignTableExpression, localAttributes, remoteAttributes, sql) => function ($where: PgConditionStep<any>, fieldArgs) {
118118
//assertAllowed(fieldArgs, "object");
119119
const $subQuery = $where.existsPlan({
120120
tableExpression: foreignTableExpression,
@@ -132,7 +132,7 @@ export const PgConnectionArgFilterForwardRelationsPlugin: GraphileConfig.Plugin
132132
});
133133
fieldArgs.apply($subQuery);
134134
},
135-
[]
135+
[foreignTable, foreignTableExpression, localAttributes, remoteAttributes, sql]
136136
),
137137
})
138138
),
@@ -158,9 +158,8 @@ export const PgConnectionArgFilterForwardRelationsPlugin: GraphileConfig.Plugin
158158
() => ({
159159
description: `A related \`${fieldName}\` exists.`,
160160
type: GraphQLBoolean,
161-
applyPlan: build.EXPORTABLE(
162-
() =>
163-
function ($where: PgConditionStep<any>, fieldArgs) {
161+
applyPlan: EXPORTABLE(
162+
(foreignTable, foreignTableExpression, localAttributes, remoteAttributes, sql) => function ($where: PgConditionStep<any>, fieldArgs) {
164163
//assertAllowed(fieldArgs, "scalar");
165164
const $subQuery = $where.existsPlan({
166165
tableExpression: foreignTableExpression,
@@ -178,7 +177,7 @@ export const PgConnectionArgFilterForwardRelationsPlugin: GraphileConfig.Plugin
178177
);
179178
});
180179
},
181-
[]
180+
[foreignTable, foreignTableExpression, localAttributes, remoteAttributes, sql]
182181
),
183182
})
184183
),

src/PgConnectionArgFilterOperatorsPlugin.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
389389
const hstoreOperators: { [fieldName: string]: OperatorSpec } = {
390390
contains: {
391391
description: "Contains the specified KeyValueHash.",
392-
resolve: (i, v) => sql`${i} @> ${v}`,
392+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} @> ${v}`, [sql]),
393393
},
394394
containsKey: {
395395
description: "Contains the specified key.",
@@ -412,13 +412,13 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
412412
},
413413
containedBy: {
414414
description: "Contained by the specified KeyValueHash.",
415-
resolve: (i, v) => sql`${i} <@ ${v}`,
415+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} <@ ${v}`, [sql]),
416416
},
417417
};
418418
const jsonbOperators: { [fieldName: string]: OperatorSpec } = {
419419
contains: {
420420
description: "Contains the specified JSON.",
421-
resolve: (i, v) => sql`${i} @> ${v}`,
421+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} @> ${v}`, [sql]),
422422
},
423423
containsKey: {
424424
description: "Contains the specified key.",
@@ -439,31 +439,31 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
439439
},
440440
containedBy: {
441441
description: "Contained by the specified JSON.",
442-
resolve: (i, v) => sql`${i} <@ ${v}`,
442+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} <@ ${v}`, [sql]),
443443
},
444444
};
445445
const inetOperators: { [fieldName: string]: OperatorSpec } = {
446446
contains: {
447447
description: "Contains the specified internet address.",
448-
resolve: (i, v) => sql`${i} >> ${v}`,
448+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} >> ${v}`, [sql]),
449449
},
450450
containsOrEqualTo: {
451451
description: "Contains or equal to the specified internet address.",
452-
resolve: (i, v) => sql`${i} >>= ${v}`,
452+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} >>= ${v}`, [sql]),
453453
},
454454
containedBy: {
455455
description: "Contained by the specified internet address.",
456-
resolve: (i, v) => sql`${i} << ${v}`,
456+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} << ${v}`, [sql]),
457457
},
458458
containedByOrEqualTo: {
459459
description:
460460
"Contained by or equal to the specified internet address.",
461-
resolve: (i, v) => sql`${i} <<= ${v}`,
461+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} <<= ${v}`, [sql]),
462462
},
463463
containsOrContainedBy: {
464464
description:
465465
"Contains or contained by the specified internet address.",
466-
resolve: (i, v) => sql`${i} && ${v}`,
466+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} && ${v}`, [sql]),
467467
},
468468
};
469469

@@ -579,7 +579,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
579579
...sortOperators,
580580
contains: {
581581
description: "Contains the specified range.",
582-
resolve: (i, v) => sql`${i} @> ${v}`,
582+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} @> ${v}`, [sql]),
583583
},
584584
containsElement: {
585585
description: "Contains the specified value.",
@@ -596,31 +596,31 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
596596
},
597597
containedBy: {
598598
description: "Contained by the specified range.",
599-
resolve: (i, v) => sql`${i} <@ ${v}`,
599+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} <@ ${v}`, [sql]),
600600
},
601601
overlaps: {
602602
description: "Overlaps the specified range.",
603-
resolve: (i, v) => sql`${i} && ${v}`,
603+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} && ${v}`, [sql]),
604604
},
605605
strictlyLeftOf: {
606606
description: "Strictly left of the specified range.",
607-
resolve: (i, v) => sql`${i} << ${v}`,
607+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} << ${v}`, [sql]),
608608
},
609609
strictlyRightOf: {
610610
description: "Strictly right of the specified range.",
611-
resolve: (i, v) => sql`${i} >> ${v}`,
611+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} >> ${v}`, [sql]),
612612
},
613613
notExtendsRightOf: {
614614
description: "Does not extend right of the specified range.",
615-
resolve: (i, v) => sql`${i} &< ${v}`,
615+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} &< ${v}`, [sql]),
616616
},
617617
notExtendsLeftOf: {
618618
description: "Does not extend left of the specified range.",
619-
resolve: (i, v) => sql`${i} &> ${v}`,
619+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} &> ${v}`, [sql]),
620620
},
621621
adjacentTo: {
622622
description: "Adjacent to the specified range.",
623-
resolve: (i, v) => sql`${i} -|- ${v}`,
623+
resolve: EXPORTABLE((sql) => (i, v) => sql`${i} -|- ${v}`, [sql]),
624624
},
625625
};
626626

@@ -716,7 +716,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
716716
let rangeLike = true;
717717
let enumLike = true;
718718
for (const codec of pgCodecs) {
719-
let underlyingType = codec.domainOfCodec ?? codec;
719+
const underlyingType = codec.domainOfCodec ?? codec;
720720
if (!underlyingType.arrayOfCodec) {
721721
arrayLike = false;
722722
}
@@ -928,7 +928,7 @@ export const PgConnectionArgFilterOperatorsPlugin: GraphileConfig.Plugin = {
928928
if (!codecGraphQLType) {
929929
return memo;
930930
}
931-
let type = resolveType
931+
const type = resolveType
932932
? resolveType(codecGraphQLType)
933933
: codecGraphQLType;
934934

0 commit comments

Comments
 (0)