Commit cd51950e authored by Alexandros Georgantas's avatar Alexandros Georgantas

feat(template manager): init template manager

parent 104ca992
const models = require('editoria-data-model')
module.exports = {
resolvers: require('./template.resolvers'),
typeDefs: require('../graphqlLoaderUtil')('template/template.graphql'),
model: models.template,
}
type Template {
id: ID!
templateName: String!
thumbnailSrc: String
author: String
files: [File]!
}
input CreateTemplateInput{
templateName: String!
thumbnailSrc: String
author: String
files: [File]!
}
input UpdateTemplateInput{
id: ID!
templateName: String
thumbnailSrc: String
author: String
files: [File]
}
extend type Query {
getTemplates(ascending: Boolean, sortKey: String): [Template]!
getTemplate(id:ID!): Template!
}
extend type Mutation {
createTemplate(input: CreateTemplateInput): Template!
updateTemplate(input: UpdateTemplateInput): Template!
deleteTemplate(id:ID!): ID!
}
\ No newline at end of file
const indexOf = require('lodash/indexOf')
const find = require('lodash/find')
const utils = require('../helpers/utils')
const config = require('config')
const {
Template,
File,
FileTranslation,
} = require('editoria-data-model/src').models
// const pubsweetServer = require('pubsweet-server')
// const { pubsubManager } = pubsweetServer
const getTemplates = async (_, {}, ctx) => {}
const getTemplate = async (_, {}, ctx) => {}
const createTemplate = async (_, {}, ctx) => {}
const updateTemplate = async (_, {}, ctx) => {}
const deleteTemplate = async (_, {}, ctx) => {}
module.exports = {
Query: {
getTemplates,
getTemplate,
},
Mutation: {
createTemplate,
updateTemplate,
deleteTemplate,
},
Template: {
async files(divisionId, _, ctx) {
// TODO:
},
},
Subscription: {},
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment