File model and api is almost complete

- Added "Kind" field to File model
- Added file query
- Added editFile mutation
- Added removeFile mutation
This commit is contained in:
2018-06-12 23:06:35 +02:00
parent 1978883cd7
commit 90a3597602
4 changed files with 232 additions and 0 deletions
+11
View File
@@ -22,6 +22,10 @@ type Query {
posts(ids: [String!]!): [Post!]!
# Find file by ID
file(id: String!): File
# Find current session
session: Session!
}
@@ -67,6 +71,13 @@ type Mutation {
removePost(id: String!): Post!
# Edit a file
editFile(input: EditFileInput!): File!
# Remove a file
removeFile(id: String!): File
# Log in
login(username: String!, password: String!): Session!
+43
View File
@@ -0,0 +1,43 @@
# A File contains information about a file and where to download it.
type File {
# The file's unique ID
id: String!
# The kind of file. Most will be "upload", but some that are ported from the wiki will have other values for this.
kind: String!
# The time of uploading
time: String!
# Whether the file is publicly listable. Someone with knowledge of the ID
# will still be able to view it, however.
public: Boolean!
# The file's name
name: String!
# The MIME type of the file
mimeType: String!
# The file's size in bytes
size: Int!
# The uploader
author: String!
# The URL where the file is hosted
url: String
}
# Input for editFile mutation
input EditFileInput {
# The file's unique ID
id: String!
# Whether the file is publicly listable. Someone with knowledge of the ID
# will still be able to view it, however.
public: Boolean
# The file's name
name: String
}