diff --git a/config/default.js b/config/default.js index c67756653b7e13f4ff9f2345309ebb36cc67cac6..27e3fd2096fed065502483fb9fc7173c05fa64a6 100644 --- a/config/default.js +++ b/config/default.js @@ -15,6 +15,28 @@ module.exports = { port: 3000, logger, uploads: 'uploads', + typeDefs: ` + type Manuscript { + id: ID! + title: String! + source: String! + metadata: SubmissionMeta! + } + + type SubmissionMeta { + author: Author + correspondingAuthor: Author + + # more submission form stuff goes in here + } + + type Author { + firstName: String + lastName: String + email: String + institution: String + } + `, }, 'pubsweet-client': { API_ENDPOINT: '/api', diff --git a/config/validations.js b/config/validations.js index ac17f8ee5633ffb9dcd5341a18cfd1a4666b2176..12e8930f790925521ff46da90dac539449ee7b05 100644 --- a/config/validations.js +++ b/config/validations.js @@ -1,6 +1,14 @@ const Joi = require('joi') module.exports = { + fragment: [ + { + fragmentType: Joi.valid('manuscript').required(), + title: Joi.string().required(), + source: Joi.string(), + metadata: Joi.any(), + }, + ], user: { // make these core fields optional email: Joi.string().email(),