Skip to content
Open
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
26 changes: 14 additions & 12 deletions src/PostgraphileNestedTypesPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,20 @@ module.exports = function PostGraphileNestedTypesPlugin(
type: GraphQLBoolean,
};
}
pgNestedTableConnectorFields[foreignTable.id].forEach(
({ field, fieldName: connectorFieldName }) => {
operations[connectorFieldName] = {
description: `The primary key(s) for \`${foreignTableName}\` for the far side of the relationship.`,
type: isForward
? field
: isUnique
? field
: new GraphQLList(new GraphQLNonNull(field)),
};
},
);
if (pgNestedTableConnectorFields[foreignTable.id]) {
pgNestedTableConnectorFields[foreignTable.id].forEach(
({ field, fieldName: connectorFieldName }) => {
operations[connectorFieldName] = {
description: `The primary key(s) for \`${foreignTableName}\` for the far side of the relationship.`,
type: isForward
? field
: isUnique
? field
: new GraphQLList(new GraphQLNonNull(field)),
};
},
);
}
if (deleteable) {
pgNestedTableDeleterFields[foreignTable.id].forEach(
({ field, fieldName: deleterFieldName }) => {
Expand Down