Skip to content

Commit b52c0d5

Browse files
committed
throw if parent row is not update/selected
1 parent 99e3be3 commit b52c0d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/PostgraphileNestedMutationsPlugin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,11 @@ module.exports = function PostGraphileNestedMutationPlugin(builder) {
438438
});
439439

440440
if (primaryKeys) {
441+
if (!connectedRow) {
442+
throw new Error(
443+
'Unable to update/select parent row.',
444+
);
445+
}
441446
const rowKeyValues = {};
442447
primaryKeys.forEach((col) => {
443448
rowKeyValues[col.name] = connectedRow[col.name];
@@ -520,7 +525,7 @@ module.exports = function PostGraphileNestedMutationPlugin(builder) {
520525
);
521526
}),
522527
);
523-
528+
524529
if (fieldValue.deleteOthers) {
525530
// istanbul ignore next
526531
if (!primaryKeys) {

0 commit comments

Comments
 (0)