@@ -71,7 +71,9 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
7171
7272 connectionFilterTypesByTypeName [ Self . name ] = Self ;
7373
74- const backwardRelationSpecs = ( introspectionResultsByKind . constraint as PgConstraint [ ] )
74+ const backwardRelationSpecs = (
75+ introspectionResultsByKind . constraint as PgConstraint [ ]
76+ )
7577 . filter ( ( con ) => con . type === "f" )
7678 . filter ( ( con ) => con . foreignClassId === table . id )
7779 . reduce ( ( memo : BackwardRelationSpec [ ] , foreignConstraint ) => {
@@ -91,10 +93,14 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
9193 if ( omit ( foreignTable , "read" ) || omit ( foreignTable , "filter" ) ) {
9294 return memo ;
9395 }
94- const attributes = ( introspectionResultsByKind . attribute as PgAttribute [ ] )
96+ const attributes = (
97+ introspectionResultsByKind . attribute as PgAttribute [ ]
98+ )
9599 . filter ( ( attr ) => attr . classId === table . id )
96100 . sort ( ( a , b ) => a . num - b . num ) ;
97- const foreignAttributes = ( introspectionResultsByKind . attribute as PgAttribute [ ] )
101+ const foreignAttributes = (
102+ introspectionResultsByKind . attribute as PgAttribute [ ]
103+ )
98104 . filter ( ( attr ) => attr . classId === foreignTable . id )
99105 . sort ( ( a , b ) => a . num - b . num ) ;
100106 const keyAttributes = foreignConstraint . foreignKeyAttributeNums . map (
@@ -109,7 +115,9 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
109115 if ( foreignKeyAttributes . some ( ( attr ) => omit ( attr , "read" ) ) ) {
110116 return memo ;
111117 }
112- const isForeignKeyUnique = ! ! ( introspectionResultsByKind . constraint as PgConstraint [ ] ) . find (
118+ const isForeignKeyUnique = ! ! (
119+ introspectionResultsByKind . constraint as PgConstraint [ ]
120+ ) . find (
113121 ( c ) =>
114122 c . classId === foreignTable . id &&
115123 ( c . type === "p" || c . type === "u" ) &&
@@ -177,18 +185,14 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
177185 } ) => {
178186 if ( fieldValue == null ) return null ;
179187
180- const {
181- foreignTable,
182- foreignKeyAttributes,
183- keyAttributes,
184- } = backwardRelationSpecByFieldName [ fieldName ] ;
188+ const { foreignTable, foreignKeyAttributes, keyAttributes } =
189+ backwardRelationSpecByFieldName [ fieldName ] ;
185190
186191 const foreignTableTypeName = inflection . tableType ( foreignTable ) ;
187192
188193 const foreignTableAlias = sql . identifier ( Symbol ( ) ) ;
189- const foreignTableFilterTypeName = inflection . filterType (
190- foreignTableTypeName
191- ) ;
194+ const foreignTableFilterTypeName =
195+ inflection . filterType ( foreignTableTypeName ) ;
192196 const sqlIdentifier = sql . identifier (
193197 foreignTable . namespace . name ,
194198 foreignTable . name
@@ -220,11 +224,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
220224 } ) => {
221225 if ( fieldValue == null ) return null ;
222226
223- const {
224- foreignTable,
225- foreignKeyAttributes,
226- keyAttributes,
227- } = backwardRelationSpecByFieldName [ fieldName ] ;
227+ const { foreignTable, foreignKeyAttributes, keyAttributes } =
228+ backwardRelationSpecByFieldName [ fieldName ] ;
228229
229230 const foreignTableAlias = sql . identifier ( Symbol ( ) ) ;
230231
@@ -287,9 +288,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
287288 isOneToMany,
288289 } = spec ;
289290 const foreignTableTypeName = inflection . tableType ( foreignTable ) ;
290- const foreignTableFilterTypeName = inflection . filterType (
291- foreignTableTypeName
292- ) ;
291+ const foreignTableFilterTypeName =
292+ inflection . filterType ( foreignTableTypeName ) ;
293293 const ForeignTableFilterType = connectionFilterType (
294294 newWithHooks ,
295295 foreignTableFilterTypeName ,
@@ -332,9 +332,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
332332 table ,
333333 foreignConstraint
334334 ) ;
335- const filterFieldName = inflection . filterManyRelationByKeysFieldName (
336- fieldName
337- ) ;
335+ const filterFieldName =
336+ inflection . filterManyRelationByKeysFieldName ( fieldName ) ;
338337 addField (
339338 filterFieldName ,
340339 `Filter by the object’s \`${ fieldName } \` relation.` ,
@@ -346,9 +345,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
346345 ) } to ${ describePgEntity ( foreignTable ) } `
347346 ) ;
348347
349- const existsFieldName = inflection . filterBackwardManyRelationExistsFieldName (
350- fieldName
351- ) ;
348+ const existsFieldName =
349+ inflection . filterBackwardManyRelationExistsFieldName ( fieldName ) ;
352350 addField (
353351 existsFieldName ,
354352 `Some related \`${ fieldName } \` exist.` ,
@@ -367,9 +365,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
367365 table ,
368366 foreignConstraint
369367 ) ;
370- const filterFieldName = inflection . filterSingleRelationByKeysBackwardsFieldName (
371- fieldName
372- ) ;
368+ const filterFieldName =
369+ inflection . filterSingleRelationByKeysBackwardsFieldName ( fieldName ) ;
373370 addField (
374371 filterFieldName ,
375372 `Filter by the object’s \`${ fieldName } \` relation.` ,
@@ -381,9 +378,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
381378 ) } to ${ describePgEntity ( foreignTable ) } `
382379 ) ;
383380
384- const existsFieldName = inflection . filterBackwardSingleRelationExistsFieldName (
385- fieldName
386- ) ;
381+ const existsFieldName =
382+ inflection . filterBackwardSingleRelationExistsFieldName ( fieldName ) ;
387383 addField (
388384 existsFieldName ,
389385 `A related \`${ fieldName } \` exists.` ,
@@ -422,9 +418,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
422418 connectionFilterTypesByTypeName [ Self . name ] = Self ;
423419
424420 const foreignTableTypeName = inflection . tableType ( foreignTable ) ;
425- const foreignTableFilterTypeName = inflection . filterType (
426- foreignTableTypeName
427- ) ;
421+ const foreignTableFilterTypeName =
422+ inflection . filterType ( foreignTableTypeName ) ;
428423 const FilterType = connectionFilterType (
429424 newWithHooks ,
430425 foreignTableFilterTypeName ,
@@ -476,10 +471,8 @@ const PgConnectionArgFilterBackwardRelationsPlugin: Plugin = (
476471
477472 if ( ! parentFieldInfo || ! parentFieldInfo . backwardRelationSpec )
478473 throw new Error ( "Did not receive backward relation spec" ) ;
479- const {
480- keyAttributes,
481- foreignKeyAttributes,
482- } : BackwardRelationSpec = parentFieldInfo . backwardRelationSpec ;
474+ const { keyAttributes, foreignKeyAttributes } : BackwardRelationSpec =
475+ parentFieldInfo . backwardRelationSpec ;
483476
484477 const foreignTableAlias = sql . identifier ( Symbol ( ) ) ;
485478 const sqlIdentifier = sql . identifier (
0 commit comments