Added mergeLog mutation.
the build was successful

This commit is contained in:
2019-08-16 12:32:50 +02:00
parent 2a0e6534ff
commit 8fbaea2078
4 changed files with 104 additions and 13 deletions
+6
View File
@@ -62,6 +62,12 @@ func (r *mutationResolver) SplitLog(ctx context.Context, input graphcore.LogSpli
return r.s.Logs.SplitLog(ctx, input.LogID, input.StartPostID)
}
func (r *mutationResolver) MergeLog(ctx context.Context, input graphcore.LogMergeInput) (*models.Log, error) {
removeAfter := input.RemoveAfter != nil && *input.RemoveAfter
return r.s.Logs.MergeLogs(ctx, input.TargetLogID, input.SourceLogID, removeAfter)
}
func (r *mutationResolver) EditLog(ctx context.Context, input graphcore.LogEditInput) (*models.Log, error) {
update := models.LogUpdate{
Open: input.Open,
+3
View File
@@ -120,6 +120,9 @@ type Mutation {
# Split a log
splitLog(input: LogSplitInput!): Log!
# Merge a log
mergeLog(input: LogMergeInput!): Log!
# Edit a log
editLog(input: LogEditInput!): Log!
+15 -1
View File
@@ -129,10 +129,24 @@ input LogSplitInput {
"Log ID"
logId: String!
"After Post ID"
"Split out all posts from and including the post with this ID"
startPostId: String!
}
"""
Input for mergeLog mutation.
"""
input LogMergeInput {
"Target log ID"
targetLogId: String!
"Source log ID"
sourceLogId: String!
"Remove the source log after merging"
removeAfter: Boolean
}
enum LogImporter {
"""
mIRC-like: This importer parses logs that copied from mIRC posts without spaces.