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
13 changes: 9 additions & 4 deletions src/UploadFieldPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ module.exports = function UploadFieldPlugin(
}
if (defs.length === 1) {
const fieldName = inflection.column(attr);
memo[fieldName] = defs[0].resolve;
memo[fieldName] = {
resolve: defs[0].resolve,
attribute: attr
};
}
return memo;
}, {});
Expand All @@ -108,11 +111,13 @@ module.exports = function UploadFieldPlugin(
if (obj[key] instanceof Promise) {
if (uploadResolversByFieldName[key]) {
const upload = await obj[key];
// eslint-disable-next-line require-atomic-updates
obj[key] = await uploadResolversByFieldName[key](
obj[key] = await uploadResolversByFieldName[key].resolve(
upload,
args,
context,
{
...context,
attribute: uploadResolversByFieldName[key].attribute
},
info
);
}
Expand Down