File tree Expand file tree Collapse file tree
graphile/graphile-settings/src/plugins/meta-schema Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export function buildForeignKeyConstraints(
9494 const constraints : ForeignKeyConstraintMeta [ ] = [ ] ;
9595
9696 for ( const [ relationName , relation ] of Object . entries ( relations ) ) {
97- if ( relation . isReferencee !== false ) continue ;
97+ if ( relation . isReferencee ) continue ;
9898
9999 const remoteCodec = relation . remoteResource ?. codec ;
100100 const remoteAttributes = remoteCodec ?. attributes || { } ;
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ export function buildBelongsToRelations(
3636 const belongsTo : BelongsToRelation [ ] = [ ] ;
3737
3838 for ( const [ relationName , relation ] of Object . entries ( relations ) ) {
39- if ( relation . isReferencee !== false ) continue ;
39+ // PostGraphile only sets isReferencee when true (reverse FK);
40+ // forward relations have isReferencee undefined, not false.
41+ if ( relation . isReferencee ) continue ;
4042
4143 const localAttributes = relation . localAttributes || [ ] ;
4244 const isUnique = uniques . some ( ( unique ) =>
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function buildTableMeta(
5050 }
5151 }
5252 for ( const relation of Object . values ( relations ) ) {
53- if ( relation . isReferencee !== false ) continue ;
53+ if ( relation . isReferencee ) continue ;
5454 for ( const attrName of relation . localAttributes || [ ] ) fkAttrNames . add ( attrName ) ;
5555 }
5656
You can’t perform that action at this time.
0 commit comments