Skip to content
Snippets Groups Projects
Commit 346a1a9d authored by Jure's avatar Jure
Browse files

refactor: move review's graphql things into single file

parent 145b5845
No related branches found
No related tags found
No related merge requests found
......@@ -60,4 +60,48 @@ const resolvers = {
},
}
module.exports = resolvers
const typeDefs = `
extend type Mutation {
updateReview(id: ID, input: ReviewInput): Review!
completeReview(id: ID!): TeamMember
}
type Review implements Object {
id: ID!
created: DateTime!
updated: DateTime
recommendation: String
isDecision: Boolean
open: Boolean
user: User
reviewComment: ReviewComment
confidentialComment: ReviewComment
decisionComment: ReviewComment
}
input ReviewInput {
reviewComment: ReviewCommentInput
confidentialComment: ReviewCommentInput
decisionComment: ReviewCommentInput
recommendation: String
isDecision: Boolean
manuscriptId: ID!
}
type ReviewComment implements Object {
id: ID!
created: DateTime!
updated: DateTime
commentType: String
content: String
files: [File]
}
input ReviewCommentInput {
id: ID
commentType: String
content: String
}
`
module.exports = { resolvers, typeDefs }
const resolvers = require('./resolvers')
const typeDefs = require('./typeDefs')
const graphql = require('./graphql')
module.exports = {
resolvers,
typeDefs,
...graphql,
models: [
{ modelName: 'Review', model: require('./review') },
{ modelName: 'ReviewComment', model: require('./review_comment') },
......
const typeDefs = `
extend type Mutation {
updateReview(id: ID, input: ReviewInput): Review!
completeReview(id: ID!): TeamMember
}
type Review implements Object {
id: ID!
created: DateTime!
updated: DateTime
recommendation: String
isDecision: Boolean
open: Boolean
user: User
reviewComment: ReviewComment
confidentialComment: ReviewComment
decisionComment: ReviewComment
}
input ReviewInput {
reviewComment: ReviewCommentInput
confidentialComment: ReviewCommentInput
decisionComment: ReviewCommentInput
recommendation: String
isDecision: Boolean
manuscriptId: ID!
}
type ReviewComment implements Object {
id: ID!
created: DateTime!
updated: DateTime
commentType: String
content: String
files: [File]
}
input ReviewCommentInput {
id: ID
commentType: String
content: String
}
`
module.exports = typeDefs
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