wikijs-fork/server/graph/schemas/asset.graphql

80 lines
1.5 KiB
GraphQL
Raw Permalink Normal View History

# ===============================================
# ASSETS
# ===============================================
extend type Query {
assets: AssetQuery
}
extend type Mutation {
assets: AssetMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type AssetQuery {
list(
2019-05-21 20:45:27 +00:00
folderId: Int!
kind: AssetKind!
): [AssetItem] @auth(requires: ["manage:system", "read:assets"])
2019-05-21 20:45:27 +00:00
folders(
parentFolderId: Int!
): [AssetFolder] @auth(requires: ["manage:system", "read:assets"])
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type AssetMutation {
2019-05-21 20:45:27 +00:00
createFolder(
parentFolderId: Int!
slug: String!
name: String
): DefaultResponse @auth(requires: ["manage:system", "write:assets"])
2019-05-26 01:38:29 +00:00
renameAsset(
id: Int!
filename: String!
): DefaultResponse @auth(requires: ["manage:system", "manage:assets"])
deleteAsset(
id: Int!
): DefaultResponse @auth(requires: ["manage:system", "manage:assets"])
2019-07-06 21:06:42 +00:00
flushTempUploads: DefaultResponse @auth(requires: ["manage:system"])
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type AssetItem {
id: Int!
filename: String!
ext: String!
kind: AssetKind!
mime: String!
fileSize: Int!
metadata: String
createdAt: Date!
updatedAt: Date!
folder: AssetFolder
author: User
}
type AssetFolder {
id: Int!
2019-05-21 20:45:27 +00:00
slug: String!
name: String
}
enum AssetKind {
IMAGE
BINARY
ALL
}