Skip to content

Commit

Permalink
fix: uniqueKey/pgViewUniqueKey applies to views (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed May 12, 2021
1 parent 9bd6c3b commit b715f6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/graphile-build-pg/src/plugins/PgAllRows.js
Expand Up @@ -64,7 +64,7 @@ export default (async function PgAllRows(
const uniqueIdAttribute = viewUniqueKey
? attributes.find(attr => attr.name === viewUniqueKey)
: undefined;
if (isView && table.tags.uniqueKey && !uniqueIdAttribute) {
if (isView(table) && table.tags.uniqueKey && !uniqueIdAttribute) {
throw new Error(
`Could not find the named unique key '${table.tags.uniqueKey}' on view '${table.namespaceName}.${table.name}'`
);
Expand Down

0 comments on commit b715f6d

Please sign in to comment.