feat: source + history (wip)

This commit is contained in:
Nicolas Giard
2018-11-25 01:28:20 -05:00
parent 076aeaf749
commit 78ba895eee
17 changed files with 374 additions and 81 deletions

View File

@@ -10,6 +10,12 @@ module.exports = {
async pages() { return {} }
},
PageQuery: {
async history(obj, args, context, info) {
return WIKI.models.pageHistory.getHistory({
pageId: args.id,
offset: args.offset || 0
})
},
async list(obj, args, context, info) {
return WIKI.models.pages.query().select(
'pages.*',

View File

@@ -15,6 +15,11 @@ extend type Mutation {
# -----------------------------------------------
type PageQuery {
history(
id: Int!
offset: Int
): [PageHistory]
list(
filter: String
orderBy: String
@@ -92,3 +97,13 @@ type Page {
createdAt: Date!
updatedAt: Date!
}
type PageHistory {
versionId: Int!
authorId: Int!
authorName: String!
actionType: String!
valueBefore: String
valueAfter: String
createdAt: Date!
}