diff --git a/server/model-manuscript/src/graphql.js b/server/model-manuscript/src/graphql.js index 81e51a136d45c495fe6b4071cf22e79ee98543bd..2991ddeba17012bd14bfd0b0e346811cbd5e7ab2 100644 --- a/server/model-manuscript/src/graphql.js +++ b/server/model-manuscript/src/graphql.js @@ -21,6 +21,14 @@ const ManuscriptResolvers = ({ isVersion }) => { await ctx.models.Manuscript.query().findById(parent.id) ).$relatedQuery('teams') }, + async files(parent, _, ctx) { + return parent.files + ? parent.files + : ( + await ctx.models.Manuscript.query().findById(parent.id) + ).$relatedQuery('files') + }, + meta(parent) { return { ...parent.meta, manuscriptId: parent.id } },