Browse Source

graph2: Added clearFictionalDate option to editChapter mutation input

1.0
Gisle Aune 6 years ago
parent
commit
8388ee2446
  1. 4
      graph2/queries/chapter.go
  2. 3
      graph2/schema/types/Chapter.gql

4
graph2/queries/chapter.go

@ -55,6 +55,10 @@ func (r *mutationResolver) EditChapter(ctx context.Context, input input.ChapterE
return models.Chapter{}, errors.New("Unauthorized") return models.Chapter{}, errors.New("Unauthorized")
} }
if input.ClearFictionalDate != nil && *input.ClearFictionalDate == true {
input.FictionalDate = &time.Time{}
}
return chapters.Edit(chapter, input.Title, input.Source, input.FictionalDate) return chapters.Edit(chapter, input.Title, input.Source, input.FictionalDate)
} }

3
graph2/schema/types/Chapter.gql

@ -56,6 +56,9 @@ input ChapterEditInput {
# Set the fictional date for a chapter # Set the fictional date for a chapter
fictionalDate: Date fictionalDate: Date
# Remove the fictional date for a chapter
clearFictionalDate: Boolean
} }
# Input for removeChapter mutation # Input for removeChapter mutation

Loading…
Cancel
Save