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
5 changes: 4 additions & 1 deletion src/UploadFieldPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ module.exports = function UploadFieldPlugin(
// Extract the old resolver from `field`
const { resolve: oldResolve = defaultResolver, ...rest } = field;

const tags = {};

const uploadResolversByFieldName = introspectionResultsByKind.attribute
.filter(attr => attr.classId === table.id)
.reduce((memo, attr) => {
Expand All @@ -97,6 +99,7 @@ module.exports = function UploadFieldPlugin(
if (defs.length === 1) {
const fieldName = inflection.column(attr);
memo[fieldName] = defs[0].resolve;
tags[fieldName] = attr.tags;
}
return memo;
}, {});
Expand All @@ -118,7 +121,7 @@ module.exports = function UploadFieldPlugin(
upload,
args,
context,
info
{...info, uploadPlugin: {tags: tags[key]}}
);
}
} else if (obj[key] !== null && typeof obj[key] === "object") {
Expand Down