From 415b5f684c18809956fc7ca2bf54e73bce8b927e Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Sat, 1 Apr 2023 18:07:49 +0700 Subject: [PATCH] Always add ...Exists field on virtual foreign key constraints --- src/PgConnectionArgFilterForwardRelationsPlugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PgConnectionArgFilterForwardRelationsPlugin.ts b/src/PgConnectionArgFilterForwardRelationsPlugin.ts index 55a1085..4c797fa 100644 --- a/src/PgConnectionArgFilterForwardRelationsPlugin.ts +++ b/src/PgConnectionArgFilterForwardRelationsPlugin.ts @@ -245,7 +245,8 @@ const PgConnectionArgFilterForwardRelationsPlugin: Plugin = (builder) => { ); const keyIsNullable = !keyAttributes.every((attr) => attr.isNotNull); - if (keyIsNullable) { + const isFake = (constraint as unknown as { isFake?: boolean }).isFake; + if (keyIsNullable || isFake) { const existsFieldName = inflection.filterForwardRelationExistsFieldName(fieldName); addField(