Skip to content

Commit

Permalink
Try pgNestedPluginForwardInputTypes after `pgNestedPluginReverseInp…
Browse files Browse the repository at this point in the history
…utTypes`

Fixes #22
  • Loading branch information
archlemon authored Oct 21, 2019
1 parent 06180a8 commit 991f9f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/PostgraphileNestedMutationsPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,14 @@ module.exports = function PostGraphileNestedMutationPlugin(builder) {

await Promise.all(
Object.keys(inputData).map(async (key) => {
const nestedField = pgNestedPluginReverseInputTypes[table.id].find(
let nestedField = pgNestedPluginReverseInputTypes[table.id].find(
(obj) => obj.name === key,
);
if (!nestedField) {
nestedField = pgNestedPluginForwardInputTypes[table.id].find(
(obj) => obj.name === key,
);
}
if (!nestedField || !inputData[key]) {
return;
}
Expand Down

0 comments on commit 991f9f5

Please sign in to comment.