@@ -29,3 +29,11 @@ func (r *queryResolver) Files(ctx context.Context, filter *models.FileFilter) ([
|
||||
func (r *mutationResolver) UploadFile(ctx context.Context, input *graphcore.FileUploadInput) (*models.File, error) {
|
||||
return r.s.Files.Upload(ctx, input.File.File, input.Name, input.Public, input.File.Size)
|
||||
}
|
||||
|
||||
func (r *mutationResolver) EditFile(ctx context.Context, input *graphcore.FileEditInput) (*models.File, error) {
|
||||
return r.s.Files.Edit(ctx, input.ID, input.Name, input.Public)
|
||||
}
|
||||
|
||||
func (r *mutationResolver) RemoveFile(ctx context.Context, input *graphcore.FileRemoveInput) (*models.File, error) {
|
||||
return r.s.Files.Remove(ctx, input.ID)
|
||||
}
|
||||
|
||||
@@ -168,6 +168,12 @@ type Mutation {
|
||||
|
||||
"Upload a file"
|
||||
uploadFile(input: FileUploadInput): File!
|
||||
|
||||
"Edit a file"
|
||||
editFile(input: FileEditInput): File!
|
||||
|
||||
"Remove a file"
|
||||
removeFile(input: FileRemoveInput): File!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
|
||||
@@ -27,7 +27,7 @@ type Change {
|
||||
objects: [ChangeObject!]!
|
||||
}
|
||||
|
||||
union ChangeObject = Character | Channel | Log | Post | Story | Tag | Chapter | Comment
|
||||
union ChangeObject = Character | Channel | Log | Post | Story | Tag | Chapter | Comment | File
|
||||
|
||||
"""
|
||||
A change key is a key associated with a change, used for filtering
|
||||
|
||||
@@ -51,7 +51,7 @@ input FileUploadInput {
|
||||
}
|
||||
|
||||
# Input for editFile mutation
|
||||
input EditFileInput {
|
||||
input FileEditInput {
|
||||
# The file's unique ID
|
||||
id: String!
|
||||
|
||||
@@ -61,4 +61,10 @@ input EditFileInput {
|
||||
|
||||
# The file's name
|
||||
name: String
|
||||
}
|
||||
|
||||
# Input for removeFile mutation
|
||||
input FileRemoveInput {
|
||||
# The file's unique ID
|
||||
id: String!
|
||||
}
|
||||
Reference in New Issue
Block a user