Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function buildForeignKeyConstraints(
const constraints: ForeignKeyConstraintMeta[] = [];

for (const [relationName, relation] of Object.entries(relations)) {
if (relation.isReferencee !== false) continue;
if (relation.isReferencee) continue;

const remoteCodec = relation.remoteResource?.codec;
const remoteAttributes = remoteCodec?.attributes || {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export function buildBelongsToRelations(
const belongsTo: BelongsToRelation[] = [];

for (const [relationName, relation] of Object.entries(relations)) {
if (relation.isReferencee !== false) continue;
// PostGraphile only sets isReferencee when true (reverse FK);
// forward relations have isReferencee undefined, not false.
if (relation.isReferencee) continue;

const localAttributes = relation.localAttributes || [];
const isUnique = uniques.some((unique) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function buildTableMeta(
}
}
for (const relation of Object.values(relations)) {
if (relation.isReferencee !== false) continue;
if (relation.isReferencee) continue;
for (const attrName of relation.localAttributes || []) fkAttrNames.add(attrName);
}

Expand Down
Loading